Skip to content

Commit f3b9c72

Browse files
committed
fix: allow disabling dune integration
Signed-off-by: Rudi Grinberg <[email protected]>
1 parent 584808a commit f3b9c72

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ocaml-lsp-server/src/dune.ml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,17 @@ let create workspaces (client_capabilities : ClientCapabilities.t) diagnostics
584584
; workspaces
585585
})
586586

587+
let enabled = false
588+
589+
let create_disabled () = ref Closed
590+
591+
let create workspaces (client_capabilities : ClientCapabilities.t) diagnostics
592+
progress ~log =
593+
if enabled then
594+
create workspaces client_capabilities diagnostics progress ~log
595+
else
596+
Fiber.return (create_disabled ())
597+
587598
let run_loop t =
588599
Fiber.repeat_while ~init:() ~f:(fun () ->
589600
match !t with
@@ -598,7 +609,7 @@ let run_loop t =
598609
let run t : unit Fiber.t =
599610
Fiber.of_thunk (fun () ->
600611
match !t with
601-
| Closed -> Code_error.raise "dune already closed" []
612+
| Closed -> Fiber.return ()
602613
| Active active ->
603614
Fiber.fork_and_join_unit
604615
(fun () -> run_loop t)

0 commit comments

Comments
 (0)