Skip to content

Commit

Permalink
fix: fix lspManager for prior versions of coq (8.18, 8.19, 8.20) and …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
rtetley committed Nov 19, 2024
1 parent 8eb8c57 commit 0454b11
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ suite('Should get diagnostics', function () {

const ext = vscode.extensions.getExtension('maximedenes.vscoq')!;
await ext.activate();
vscode.workspace.getConfiguration().update('vscoq.proof.mode','Continuous');

const doc = await common.openTextFile('basic.v');

Expand All @@ -34,6 +35,7 @@ suite('Should get diagnostics', function () {

const ext = vscode.extensions.getExtension('maximedenes.vscoq')!;
await ext.activate();
vscode.workspace.getConfiguration().update('vscoq.proof.mode','Continuous');

const doc1 = await common.openTextFile('basic.v');
const doc2 = await common.openTextFile('warn.v');
Expand Down
16 changes: 15 additions & 1 deletion language-server/vscoqtop/lspManager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,19 @@ let init_document local_args vst =
Vernacstate.freeze_full_state ()
[%%endif]

[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
let parse_args args =
let usage = {
Boot.Usage.executable_name = "";
extra_args = "";
extra_options = "";
} in
fst @@ Coqargs.parse_args ~init:Coqargs.default ~usage args
[%%else]
let parse_args args =
fst @@ Coqargs.parse_args ~init:Coqargs.default args
[%%endif]

let open_new_document uri text =
let vst = get_init_state () in

Expand All @@ -282,7 +295,8 @@ let open_new_document uri text =
let project = CoqProject_file.read_project_file ~warning_fn:(fun _ -> ()) f in
let args = CoqProject_file.coqtop_args_from_project project in
log (Printf.sprintf "Arguments from project file %s: %s" f (String.concat " " args));
fst @@ Coqargs.parse_args ~init:Coqargs.default args
parse_args args

in

let vst = init_document local_args vst in
Expand Down

0 comments on commit 0454b11

Please sign in to comment.