package coq-lsp
Language Server Protocol native server for Coq
Install
Dune Dependency
Authors
Maintainers
Sources
coq-lsp-0.1.9.8.19.tbz
sha256=ef664281ab6e242dd79374cbbe4f177f2f071d3457cd3b75c23643948d475961
sha512=3c180c0c2e1218936b6cacb37197370cf80be4c372c46e38a2ab403a5a6e99cd6403f927ecfc017aefa2ead856abb389d48feb183049bf2c7badb029ce13f1ee
doc/src/Astdump_plugin/main.ml.html
Source file main.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
open Fleche let pp_json fmt (ast : Doc.Node.Ast.t) = let jast = Lsp.JCoq.Ast.to_yojson ast.v in Yojson.Safe.pretty_print fmt jast let pp_sexp fmt (ast : Doc.Node.Ast.t) = let sast = Serlib.Ser_vernacexpr.sexp_of_vernac_control (Coq.Ast.to_coq ast.v) in Sexplib.Sexp.pp_hum fmt sast let pw pp fmt ast = Format.fprintf fmt "@[%a@]" pp ast let dump_asts ~out_file pp asts = let out = Stdlib.open_out out_file in let fmt = Format.formatter_of_out_channel out in List.iter (pw pp fmt) asts; Format.pp_print_flush fmt (); Stdlib.close_out out let dump_ast ~io ~token:_ ~(doc : Doc.t) = let uri = doc.uri in let uri_str = Lang.LUri.File.to_string_uri uri in let out_file_j = Lang.LUri.File.to_string_file uri ^ ".json.astdump" in let out_file_s = Lang.LUri.File.to_string_file uri ^ ".sexp.astdump" in let lvl = Io.Level.info in let message = Format.asprintf "[ast plugin] dumping ast for %s ..." uri_str in Io.Report.message ~io ~lvl ~message; let asts = Doc.asts doc in let () = dump_asts ~out_file:out_file_j pp_json asts in let () = dump_asts ~out_file:out_file_s pp_sexp asts in let message = Format.asprintf "[ast plugin] dumping ast for %s was completed!" uri_str in Io.Report.message ~io ~lvl ~message; () let main () = Theory.Register.Completed.add dump_ast let () = main ()
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>