From 336d728cf42b4ef5cf3829ecb0e1746af3b55b16 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 7 Jun 2024 13:37:40 +0200 Subject: [PATCH] fixup https://github.com/coq-community/vscoq/pull/775 --- language-server/dm/dune | 2 ++ language-server/dm/vscoqtop_proof_worker.ml | 9 ++++++++- language-server/dm/vscoqtop_tactic_worker.ml | 9 ++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/language-server/dm/dune b/language-server/dm/dune index 151794fa..e26bf4e9 100644 --- a/language-server/dm/dune +++ b/language-server/dm/dune @@ -11,6 +11,7 @@ (modules vscoqtop_proof_worker) (flags -linkall) (package vscoq-language-server) + (preprocess (pps ppx_optcomp -- -cookie "ppx_optcomp.env=env ~coq:(Defined \"%{coq:version.major}.%{coq:version.minor}\")")) (libraries coq-core.sysinit coq-core.tactics lsp dm protocol)) (executable @@ -19,4 +20,5 @@ (modules vscoqtop_tactic_worker) (flags -linkall) (package vscoq-language-server) + (preprocess (pps ppx_optcomp -- -cookie "ppx_optcomp.env=env ~coq:(Defined \"%{coq:version.major}.%{coq:version.minor}\")")) (libraries coq-core.sysinit coq-core.tactics lsp dm protocol)) diff --git a/language-server/dm/vscoqtop_proof_worker.ml b/language-server/dm/vscoqtop_proof_worker.ml index b7504fb9..6b6d1571 100644 --- a/language-server/dm/vscoqtop_proof_worker.ml +++ b/language-server/dm/vscoqtop_proof_worker.ml @@ -32,11 +32,18 @@ let vscoqtop_specific_usage = Boot.Usage.{ extra_options = ""; } +[%%if coq = "8.18" || coq = "8.19"] +let start_library top opts = Coqinit.start_library ~top opts +[%%else] +let start_library top opts = + let intern = Vernacinterp.fs_intern in + Coqinit.start_library ~intern ~top opts; +[%%endif] let _ = Coqinit.init_ocaml (); let opts, emoptions = Coqinit.parse_arguments ~parse_extra:Dm.ExecutionManager.ProofWorkerProcess.parse_options ~usage:vscoqtop_specific_usage () in let injections = Coqinit.init_runtime opts in - Coqinit.start_library ~top:Coqargs.(dirpath_of_top opts.config.logic.toplevel_name) injections; + start_library Coqargs.(dirpath_of_top opts.config.logic.toplevel_name) injections; log @@ "started"; Sys.(set_signal sigint Signal_ignore); main_worker emoptions diff --git a/language-server/dm/vscoqtop_tactic_worker.ml b/language-server/dm/vscoqtop_tactic_worker.ml index f815365e..b57be73c 100644 --- a/language-server/dm/vscoqtop_tactic_worker.ml +++ b/language-server/dm/vscoqtop_tactic_worker.ml @@ -32,12 +32,19 @@ let vscoqtop_specific_usage = Boot.Usage.{ extra_options = ""; } +[%%if coq = "8.18" || coq = "8.19"] +let start_library top opts = Coqinit.start_library ~top opts +[%%else] +let start_library top opts = + let intern = Vernacinterp.fs_intern in + Coqinit.start_library ~intern ~top opts; +[%%endif] let _ = Coqinit.init_ocaml (); let opts, emoptions = Coqinit.parse_arguments ~parse_extra:Dm.ParTactic.TacticWorkerProcess.parse_options ~usage:vscoqtop_specific_usage () in let injections = Coqinit.init_runtime opts in - Coqinit.start_library ~top:Coqargs.(dirpath_of_top opts.config.logic.toplevel_name) injections; + start_library Coqargs.(dirpath_of_top opts.config.logic.toplevel_name) injections; log @@ "started"; Sys.(set_signal sigint Signal_ignore); main_worker ~opts emoptions ()