Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[coq-lsp] Tweak to --help crash fix.
Browse files Browse the repository at this point in the history
ejgallego committed Jun 5, 2024
1 parent 121c2d8 commit ede113e
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,9 @@
- [fleche] Preserve view hint across document changes. With this
change, we get local continuous checking mode when the view-port
heuristic is enabled (@ejgallego, #748)
- [nix] Add `pet-server` deps to flake.nix (Léo Stefanesco, #754)
- [coq-lsp] Fix crash on `--help` option (Léo Stefanesco, @ejgallego,
#754)

# coq-lsp 0.1.10: Hasta el 40 de Mayo _en effect_...
----------------------------------------------------
17 changes: 9 additions & 8 deletions coq/args.ml
Original file line number Diff line number Diff line change
@@ -85,24 +85,25 @@ let ri_from : (string option * string) list Term.t =

let int_backend =
let doc =
"Select Interruption Backend, if absent, the best available for your OCaml \
version will be selected"
"Select Interruption Backend. 'Mp' = memprof-limits token-based \
interruption , 'Coq' = Coq's polling mode (unreliable). The 'Mp' backend \
is only supported in OCaml 4.x series."
in
let absent = "'Mp' for OCaml 4.x, 'Coq' for OCaml 5.x" in
let backends = [ ("Coq", Limits.Coq); ("Mp", Limits.Mp) ] in
let docv = Cmdliner.Arg.doc_alts_enum ~quoted:true backends in
Arg.(
value
& opt
(enum
[ ("Coq", Some Limits.Coq); ("Mp", Some Limits.Mp); ("auto", None) ])
None
& info [ "int_backend" ] ~docv:"INT_BACKEND" ~doc)
& opt (some (enum backends)) None
& info [ "int_backend" ] ~docv ~doc ~absent)

let roots : string list Term.t =
let doc = "Workspace(s) root(s)" in
Arg.(value & opt_all string [] & info [ "root" ] ~docv:"ROOTS" ~doc)

let coq_diags_level : int Term.t =
let doc =
"Controsl whether Coq Info and Notice message appear in diagnostics.\n\
"Controls whether Coq Info and Notice message appear in diagnostics.\n\
\ 0 = None; 1 = Notices, 2 = Notices and Info"
in
Arg.(value & opt int 0 & info [ "diags_level" ] ~docv:"DIAGS_LEVEL" ~doc)

0 comments on commit ede113e

Please sign in to comment.