-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- ps-id: c6aaf75b-0994-4ab7-a173-e9f77c462266 --> Signed-off-by: Ali Caglayan <alizter@gmail.com>
- Loading branch information
Showing
13 changed files
with
191 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,87 @@ | ||
module Debug = struct | ||
type t = | ||
{ cache : bool | ||
; send : bool | ||
; read : bool | ||
; lsp_init : bool | ||
; parsing : bool | ||
; scan : bool | ||
; backtraces : bool | ||
; unicode : bool | ||
; sched_wakeup : bool | ||
; request_delay : bool | ||
; mem_stats : bool | ||
; gc_quick_stats : bool | ||
} | ||
|
||
let all = | ||
{ cache = true | ||
; send = true | ||
; read = true | ||
; lsp_init = true | ||
; parsing = true | ||
; scan = true | ||
; backtraces = true | ||
; unicode = true | ||
; sched_wakeup = true | ||
; request_delay = true | ||
; mem_stats = true | ||
; gc_quick_stats = true | ||
} | ||
|
||
let none = | ||
{ cache = false | ||
; send = false | ||
; read = false | ||
; lsp_init = false | ||
; parsing = false | ||
; scan = false | ||
; backtraces = false | ||
; unicode = false | ||
; sched_wakeup = false | ||
; request_delay = false | ||
; mem_stats = false | ||
; gc_quick_stats = false | ||
} | ||
|
||
let lsp = | ||
{ cache = false | ||
; send = true | ||
; read = true | ||
; lsp_init = true | ||
; parsing = false | ||
; scan = false | ||
; backtraces = false | ||
; unicode = false | ||
; sched_wakeup = false | ||
; request_delay = false | ||
; mem_stats = false | ||
; gc_quick_stats = true | ||
} | ||
end | ||
|
||
type t = | ||
{ mem_stats : bool [@default false] | ||
(** [mem_stats] Call [Obj.reachable_words] for every sentence. This is | ||
very slow and not very useful, so disabled by default *) | ||
; gc_quick_stats : bool [@default true] | ||
(** [gc_quick_stats] Show the diff of [Gc.quick_stats] data for each | ||
sentence *) | ||
; client_version : string [@default "any"] | ||
; eager_diagnostics : bool [@default true] | ||
(** [eager_diagnostics] Send (full) diagnostics after processing each *) | ||
; ok_diagnostics : bool [@default false] (** Show diagnostic for OK lines *) | ||
; goal_after_tactic : bool [@default false] | ||
(** When showing goals and the cursor is in a tactic, if false, show | ||
goals before executing the tactic, if true, show goals after *) | ||
; show_coq_info_messages : bool [@default false] | ||
(** Show `msg_info` messages in diagnostics *) | ||
; show_notices_as_diagnostics : bool [@default false] | ||
(** Show `msg_notice` messages in diagnostics *) | ||
; admit_on_bad_qed : bool [@default true] | ||
(** [admit_on_bad_qed] There are two possible error recovery strategies | ||
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. *) | ||
{ client_version : string | ||
; eager_diagnostics : bool | ||
; ok_diagnostics : bool | ||
; goal_after_tactic : bool | ||
; show_coq_info_messages : bool | ||
; show_notices_as_diagnostics : bool | ||
; admit_on_bad_qed : bool | ||
; debug : Debug.t | ||
} | ||
|
||
let default = | ||
{ mem_stats = false | ||
; gc_quick_stats = true | ||
; client_version = "any" | ||
{ client_version = "any" | ||
; eager_diagnostics = true | ||
; ok_diagnostics = false | ||
; goal_after_tactic = false | ||
; show_coq_info_messages = false | ||
; show_notices_as_diagnostics = false | ||
; admit_on_bad_qed = true | ||
; debug = Debug.none | ||
} | ||
|
||
let v = ref default | ||
let debug_all () = v := { !v with debug = Debug.all } | ||
let debug_lsp () = v := { !v with debug = Debug.lsp } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
module Debug : sig | ||
(** Debug configuration *) | ||
|
||
type t = | ||
{ cache : bool [@default false] (** Debug info about caching. *) | ||
; send : bool [@default false] (** LSP messages: Send and receive *) | ||
; read : bool [@default false] | ||
; lsp_init : bool [@default false] | ||
(** Parsing (this is a bit expensive as it will call the printer *) | ||
; parsing : bool [@default false] (** scanning of prefix-incrementality *) | ||
; scan : bool [@default false] (** Backtraces *) | ||
; backtraces : bool [@default false] (** Unicode conversion *) | ||
; unicode : bool [@default false] (** Sched wakeup *) | ||
; sched_wakeup : bool [@default false] (** Request event queue *) | ||
; request_delay : bool [@default true] | ||
; mem_stats : bool [@default false] (* TODO: unused? *) | ||
(** [mem_stats] Call [Obj.reachable_words] for every sentence. This is | ||
very slow and not very useful, so disabled by default *) | ||
; gc_quick_stats : bool [@default true] | ||
(** [gc_quick_stats] Show the diff of [Gc.quick_stats] data for each | ||
sentence *) | ||
} | ||
end | ||
|
||
type t = | ||
{ client_version : string [@default "any"] | ||
; eager_diagnostics : bool [@default true] | ||
(** [eager_diagnostics] Send (full) diagnostics after processing each *) | ||
; ok_diagnostics : bool [@default false] (** Show diagnostic for OK lines *) | ||
; goal_after_tactic : bool [@default false] | ||
(** When showing goals and the cursor is in a tactic, if false, show | ||
goals before executing the tactic, if true, show goals after *) | ||
; show_coq_info_messages : bool [@default false] | ||
(** Show `msg_info` messages in diagnostics *) | ||
; show_notices_as_diagnostics : bool [@default false] | ||
(** Show `msg_notice` messages in diagnostics *) | ||
; admit_on_bad_qed : bool [@default true] | ||
(** [admit_on_bad_qed] There are two possible error recovery strategies | ||
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 : Debug.t | ||
[@default | ||
(* Cannot use Debug.none here :-( *) | ||
{ cache = false | ||
; send = false | ||
; read = false | ||
; lsp_init = false | ||
; parsing = false | ||
; scan = false | ||
; backtraces = false | ||
; unicode = false | ||
; sched_wakeup = false | ||
; request_delay = false | ||
; mem_stats = false | ||
; gc_quick_stats = false | ||
}] | ||
} | ||
|
||
(** Current configuration. *) | ||
val v : t ref | ||
|
||
(** Enable all debug options. *) | ||
val debug_all : unit -> unit | ||
|
||
(** Enable all LSP related debug options. *) | ||
val debug_lsp : unit -> unit |
Oops, something went wrong.