package coq-lsp

  1. Overview
  2. Docs

Source file io.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
module CallBack = struct
  type t =
    { trace : string -> ?extra:string -> string -> unit
    ; send_diagnostics :
        uri:string -> version:int -> Types.Diagnostic.t list -> unit
    ; send_fileProgress :
        uri:string -> version:int -> (Types.Range.t * int) list -> unit
    }

  let default =
    { trace = (fun _ ?extra:_ _ -> ())
    ; send_diagnostics = (fun ~uri:_ ~version:_ _ -> ())
    ; send_fileProgress = (fun ~uri:_ ~version:_ _ -> ())
    }

  let cb = ref default
  let set t = cb := t
end

module Log = struct
  let trace d ?extra m = !CallBack.cb.trace d ?extra m
end

module Report = struct
  let diagnostics ~uri ~version d =
    !CallBack.cb.send_diagnostics ~uri ~version d

  let fileProgress ~uri ~version d =
    !CallBack.cb.send_fileProgress ~uri ~version d
end
OCaml

Innovation. Community. Security.