Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to coq/coq#19741 (parse_extra has an additional argument) #931

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions language-server/dm/delegationManager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ module type Worker = sig

(* for worker toplevels *)
type options
[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
val parse_options : string list -> options * string list
[%%else]
val parse_options : Coqargs.t -> string list -> options * string list
[%%endif]
(* the sentence ids of the remote_mapping being delegated *)
val setup_plumbing : options -> ((job_update_request -> unit) * job_t)

Expand Down Expand Up @@ -338,6 +342,12 @@ let parse_options extra_args =
Printf.eprintf "unknown arguments: %s" (String.concat " " extra_args);
exit 2

[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
let parse_options a = parse_options a
[%%else]
let parse_options _ a = parse_options a
[%%endif]

let log = log_worker

end
4 changes: 4 additions & 0 deletions language-server/dm/delegationManager.mli
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ module type Worker = sig

(* for worker toplevels *)
type options
[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
val parse_options : string list -> options * string list
[%%else]
val parse_options : Coqargs.t -> string list -> options * string list
[%%endif]
(* the sentence ids of the remote_mapping being delegated *)
val setup_plumbing : options -> ((job_update_request -> unit) * job_t)

Expand Down
6 changes: 5 additions & 1 deletion language-server/dm/executionManager.mli
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ val print_exec_overview_of_state : state -> unit
(** Coq toplevels for delegation without fork *)
module ProofWorkerProcess : sig
type options
val parse_options : string list -> options * string list
[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
val parse_options : string list -> options * string list
[%%else]
val parse_options : Coqargs.t -> string list -> options * string list
[%%endif]
val main : st:Vernacstate.t -> options -> unit
val log : string -> unit
end
6 changes: 5 additions & 1 deletion language-server/dm/parTactic.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
(**************************************************************************)
module TacticWorkerProcess : sig
type options
val parse_options : string list -> options * string list
[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
val parse_options : string list -> options * string list
[%%else]
val parse_options : Coqargs.t -> string list -> options * string list
[%%endif]
val main : st:Vernacstate.t -> options -> unit
val log : string -> unit
end
Expand Down
3 changes: 2 additions & 1 deletion language-server/vscoqtop/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
(modules vscoqtop lspManager)
(flags -linkall)
(package vscoq-language-server)
(libraries coq-core.sysinit coq-core.tactics sel yojson dm lsp))
(preprocess (pps ppx_optcomp -- -cookie "ppx_optcomp.env=env ~coq:(Defined \"%{coq:version.major}.%{coq:version.minor}\")"))
(libraries coq-core.sysinit coq-core.tactics sel yojson dm lsp))
9 changes: 8 additions & 1 deletion language-server/vscoqtop/vscoqtop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ let rec skip_xd acc = function
| "-vscoq-d" :: _ :: rest -> skip_xd acc rest
| x :: rest -> skip_xd (x::acc) rest

[%%if coq = "8.18" || coq = "8.19" || coq = "8.20"]
let parse_extra x =
skip_xd [] x
[%%else]
let parse_extra _ x = skip_xd [] x
[%%endif]

let _ =
Coqinit.init_ocaml ();
log "------------------ begin ---------------";
Expand All @@ -70,7 +77,7 @@ let _ =
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 ~usage:vscoqtop_specific_usage ~init:Coqargs.default args in
let opts, () = Coqinit.parse_arguments ~usage:vscoqtop_specific_usage ~initial_args ~parse_extra:(fun x -> skip_xd [] x) () in
let opts, () = Coqinit.parse_arguments ~usage:vscoqtop_specific_usage ~initial_args ~parse_extra () in
let injections = Coqinit.init_runtime opts in
Safe_typing.allow_delayed_constants := true; (* Needed to delegate or skip proofs *)
Sys.(set_signal sigint Signal_ignore);
Expand Down
Loading