Skip to content

Commit

Permalink
[config] Add debug client option.
Browse files Browse the repository at this point in the history
This is a simpler version of #217

Co-authored-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
ejgallego and Alizter committed Jan 28, 2023
1 parent 6c85ee5 commit 02b6cc8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
fixes #224)
- In `_CoqProject`, `-impredicative-set` is now parsed correctly
(@artagnon, #241)
- `debug` option in the client / protocol that will enable Coq's backtraces
(@Alizter, @ejgallego, #217, #XXX)

# coq-lsp 0.1.3: Event
----------------------
Expand Down
1 change: 1 addition & 0 deletions controller/coq_lsp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ let rec lsp_init_loop ic ofmt ~cmdline ~debug : Coq.Workspace.t =
Rq.answer ~ofmt ~id result;
LIO.logMessage ~lvl:3 ~message:"Server initialized";
(* Workspace initialization *)
let debug = debug || !Fleche.Config.v.debug in
let workspace = Coq.Workspace.guess ~cmdline ~debug in
log_workspace workspace;
workspace
Expand Down
5 changes: 5 additions & 0 deletions editor/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@
"default": "messages",
"description": "Traces the communication between VS Code and the language server."
},
"coq-lsp.debug": {
"type": "boolean",
"default": false,
"description": "Enable Debug in Coq Server, usually this will produce backtraces on errors"
},
"coq-lsp.path": {
"type": "string",
"default": "coq-lsp",
Expand Down
3 changes: 3 additions & 0 deletions fleche/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type t =
when a [Qed] fails: one is not to add the constant to the state, the
other one is admit it. We find the second behavior more useful, but
YMMV. *)
; debug : bool [@default false]
(** Enable debug on Coq side, including backtraces *)
}

let default =
Expand All @@ -33,6 +35,7 @@ let default =
; show_coq_info_messages = false
; show_notices_as_diagnostics = false
; admit_on_bad_qed = true
; debug = false
}

let v = ref default

0 comments on commit 02b6cc8

Please sign in to comment.