Skip to content

Commit

Permalink
server: condition lens publication on configuration option
Browse files Browse the repository at this point in the history
  • Loading branch information
samcowger committed Jan 24, 2025
1 parent c5366fe commit 7538fa3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cn-lsp/lib/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module Config = struct
(** The client controls these options, and sends them at a server's request *)
type t =
{ run_CN_on_save : bool [@key "runOnSave"]
; show_gillian_debug_lenses : bool [@key "showGillianDebugLenses"]
; telemetry_dir : string option [@default None] [@key "telemetryDir"]
}
[@@deriving yojson { strict = false }]
Expand All @@ -58,7 +59,9 @@ module Config = struct
CN-specific settings *)
let section : string = "CN"

let default : t = { run_CN_on_save = false; telemetry_dir = None }
let default : t =
{ run_CN_on_save = false; show_gillian_debug_lenses = false; telemetry_dir = None }
;;
end

let sprintf = Printf.sprintf
Expand Down Expand Up @@ -174,7 +177,9 @@ class lsp_server (env : LspCn.cerb_env) =
~partialResultToken:(_ : ProgressToken.t option)
(_ : Rpc.doc_state)
: CodeLens.t list IO.t =
IO.return (Lenses.gillian_lenses_for uri)
if server_config.show_gillian_debug_lenses
then IO.return (Lenses.gillian_lenses_for uri)
else IO.return []

method on_unknown_request
~(notify_back : Rpc.notify_back)
Expand Down

0 comments on commit 7538fa3

Please sign in to comment.