package quill

  1. Overview
  2. Docs

Source file kernel.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
(*---------------------------------------------------------------------------
  Copyright (c) 2026 The Raven authors. All rights reserved.
  SPDX-License-Identifier: ISC
  ---------------------------------------------------------------------------*)

type status = Starting | Idle | Busy | Shutting_down

type event =
  | Output of { cell_id : Cell.id; output : Cell.output }
  | Finished of { cell_id : Cell.id; success : bool }
  | Status_changed of status

type completion_kind =
  | Value
  | Type
  | Module
  | Module_type
  | Constructor
  | Label

type completion_item = {
  label : string;
  kind : completion_kind;
  detail : string;
}

type severity = Error | Warning

type diagnostic = {
  from_pos : int;
  to_pos : int;
  severity : severity;
  message : string;
}

type type_info = {
  typ : string;
  doc : string option;
  from_pos : int;
  to_pos : int;
}

type t = {
  execute : cell_id:Cell.id -> code:string -> unit;
  interrupt : unit -> unit;
  complete : code:string -> pos:int -> completion_item list;
  type_at : (code:string -> pos:int -> type_info option) option;
  diagnostics : (code:string -> diagnostic list) option;
  is_complete : (string -> bool) option;
  status : unit -> status;
  shutdown : unit -> unit;
}