12
12
(* *)
13
13
(* *************************************************************************)
14
14
15
+ [%% import " vscoq_config.mlh" ]
16
+
15
17
open Dm
16
18
open Base
17
19
open Types
18
20
open Protocol.LspWrapper
19
21
22
+ [%% if lsp < (1 ,19 ,0 ) ]
23
+ let string_of_message x = x
24
+ [%% else ]
25
+ let string_of_message = function `String x -> x | _ -> assert false
26
+ [%% endif]
27
+
20
28
[%% if coq = " 8.18" || coq = " 8.19" || coq = " 8.20" ]
21
29
let injections =
22
30
Coqinit. init_ocaml () ;
@@ -180,7 +188,7 @@ type diag_spec =
180
188
181
189
let check_no_diag st =
182
190
let diagnostics = DocumentManager. all_diagnostics st in
183
- let diagnostics = List. map ~f: Lsp.Types.Diagnostic. (fun d -> d.range, d.message, d.severity) diagnostics in
191
+ let diagnostics = List. map ~f: Lsp.Types.Diagnostic. (fun d -> d.range, string_of_message d.message, d.severity) diagnostics in
184
192
[% test_pred: (Range. t * string * DiagnosticSeverity. t option ) list ] List. is_empty diagnostics
185
193
186
194
type diagnostic_summary = Range .t * string * DiagnosticSeverity .t option [@@ deriving sexp ]
@@ -189,7 +197,7 @@ let check_diag st specl =
189
197
let open Result in
190
198
let open Lsp.Types.Diagnostic in
191
199
let diagnostic_summary { range; message; severity } =
192
- let message = Str. global_replace (Str. regexp_string " \n " ) " " message in
200
+ let message = Str. global_replace (Str. regexp_string " \n " ) " " (string_of_message message) in
193
201
let message = Str. global_replace (Str. regexp " Raised at .*$" ) " " message in
194
202
(range, message, severity) in
195
203
let match_diagnostic r s rex (range , message , severity ) =
0 commit comments