Skip to content

Commit c73fee2

Browse files
committed
Merge branch 'main' into v9.1
2 parents e668c1e + 108e0b2 commit c73fee2

File tree

13 files changed

+120
-70
lines changed

13 files changed

+120
-70
lines changed

CHANGES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# unreleased
2-
------------------------------
1+
# coq-lsp 0.2.5: New epoch
2+
--------------------------
33

44
- [build] [wasm] [code] bump esbuild from 0.16 to 0.25, miscellaneous
55
npm dependencies bump (@ejgallego, #1033)
@@ -88,6 +88,8 @@
8888
- [vscode] Add config manager for handling client configuration
8989
changes in the infoview. Add configuration option for number of
9090
messages displayed (@Durbatuluk1701, #1067)
91+
- [wasm] Update interrupt patch to account for timeouts (@ejgallego,
92+
Shachar Itzhaky, #1078)
9193

9294
# coq-lsp 0.2.4: (W)Activation
9395
------------------------------

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ patch-for-js:
237237
ifndef VENDORED_SETUP
238238
git clone --depth=1 https://github.com/coq/coq.git -b $(COQ_BRANCH) $(COQ_SRC_DIR)
239239
endif
240-
cd $(COQ_SRC_DIR) && git apply $(PATCH_DIR)/0001-coq-lsp-patch.patch
240+
cd $(COQ_SRC_DIR) && git apply $(PATCH_DIR)/0001-jscoq-Interrupt-and-timeout-Rocq-patch.patch
241241
cd $(COQ_SRC_DIR) && git apply $(PATCH_DIR)/0001-jscoq-lib-system.ml-de-unix-stat.patch
242242
cd $(COQ_SRC_DIR) && git apply $(PATCH_DIR)/0001-engine-trampoline.patch
243243
cd $(COQ_SRC_DIR) && git apply $(PATCH_DIR)/0001-ocaml-4-12.patch

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
[![Github CI][ci-badge]][ci-link]
44

5+
**Note**: the rocq-lsp project is in search of a new maintainer. As of version 0.2.5, the development on this repository is not active anymore.
6+
57
`rocq-lsp` is a [Language Server](https://microsoft.github.io/language-server-protocol/) for the [Rocq Prover](https://rocq-prover.org/). It provides a single server that implements:
68

79
- the [LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)

editor/code/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# coq-lsp 0.2.5: New epoch
2+
--------------------------
3+
4+
- Several bugfixes and improvements.
5+
- Notably new config option `limit_messages` to configure the
6+
infoview
7+
18
# coq-lsp 0.2.4: (W)Activation
29
------------------------------
310

editor/code/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/code/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "coq-lsp",
33
"displayName": "Coq LSP",
44
"description": "Coq LSP provides native vsCode support for checking Coq proof documents",
5-
"version": "0.2.5-dev",
5+
"version": "0.2.5",
66
"contributors": [
77
"Emilio Jesús Gallego Arias <e@x80.org>",
88
"Ali Caglayan <alizter@gmail.com>",

etc/0001-coq-lsp-patch.patch

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
From d8ca76a4cc493a2fe89c53fd9e2c5fd38c9dc2fb Mon Sep 17 00:00:00 2001
2+
From: Emilio Jesus Gallego Arias <e+git@x80.org>
3+
Date: Mon, 1 Dec 2025 00:56:30 +0100
4+
Subject: [PATCH] [jscoq] Interrupt and timeout Rocq patch
5+
6+
---
7+
lib/control.ml | 36 +++++++++++++++++++++++++++++++++---
8+
lib/dune | 4 ++++
9+
lib/jscoq_extern.c | 4 ++++
10+
3 files changed, 41 insertions(+), 3 deletions(-)
11+
create mode 100644 lib/jscoq_extern.c
12+
13+
diff --git a/lib/control.ml b/lib/control.ml
14+
index 5321357a1c..513677565f 100644
15+
--- a/lib/control.ml
16+
+++ b/lib/control.ml
17+
@@ -18,7 +18,19 @@ let enable_thread_delay = ref false
18+
19+
exception Timeout
20+
21+
+(* implemented in backend/jsoo/js_stub/interrupt.js *)
22+
+external interrupt_pending : unit -> bool = "interrupt_pending"
23+
+
24+
+let timeout_deadline : (float * (unit -> unit)) option ref = ref None
25+
+
26+
+let jscoq_event_yield () =
27+
+ if interrupt_pending() then interrupt := true;
28+
+ match !timeout_deadline with
29+
+ | Some (time, callback) -> if Unix.gettimeofday () > time then callback ();
30+
+ | None -> ()
31+
+
32+
let check_for_interrupt () =
33+
+ jscoq_event_yield ();
34+
if !interrupt then begin interrupt := false; raise Sys.Break end;
35+
if !enable_thread_delay then begin
36+
incr steps;
37+
@@ -93,11 +105,29 @@ let windows_timeout n f x =
38+
let () = killed := true in
39+
Exninfo.iraise e
40+
41+
+let unwind ~(protect:unit -> unit) f =
42+
+ try let y = f () in protect (); y
43+
+ with e -> protect (); raise e
44+
+
45+
+let jscoq_timeout n f x =
46+
+ let expired = ref false in
47+
+ timeout_deadline := Some (Unix.gettimeofday () +. n,
48+
+ fun () -> expired := true; interrupt := true);
49+
+ let protect () = jscoq_event_yield (); timeout_deadline := None;
50+
+ interrupt := false in
51+
+ let res = try Ok (unwind ~protect (fun () -> f x))
52+
+ with Sys.Break -> if !expired then Error Exninfo.null else raise Sys.Break in
53+
+ if !expired then Error Exninfo.null
54+
+ else res
55+
+
56+
type timeout = { timeout : 'a 'b. float -> ('a -> 'b) -> 'a -> ('b, Exninfo.info) result }
57+
58+
-let timeout_fun = match Sys.os_type with
59+
-| "Unix" | "Cygwin" -> { timeout = unix_timeout }
60+
-| _ -> { timeout = windows_timeout }
61+
+(* let timeout_fun = match Sys.os_type with *)
62+
+(* | "Unix" | "Cygwin" -> { timeout = unix_timeout } *)
63+
+(* | _ -> { timeout = windows_timeout } *)
64+
+
65+
+let _ = windows_timeout, unix_timeout
66+
+let timeout_fun = { timeout = jscoq_timeout }
67+
68+
let timeout_fun_ref = ref timeout_fun
69+
let set_timeout f = timeout_fun_ref := f
70+
diff --git a/lib/dune b/lib/dune
71+
index e86e9decb1..b3e2d070c9 100644
72+
--- a/lib/dune
73+
+++ b/lib/dune
74+
@@ -4,6 +4,10 @@
75+
(public_name rocq-runtime.lib)
76+
(wrapped false)
77+
(modules_without_implementation xml_datatype)
78+
+ (foreign_stubs
79+
+ (language c)
80+
+ (names jscoq_extern)
81+
+ (flags :standard (:include %{project_root}/config/dune.c_flags)))
82+
(libraries
83+
rocq-runtime.boot rocq-runtime.clib rocq-runtime.config
84+
(select instr.ml from
85+
diff --git a/lib/jscoq_extern.c b/lib/jscoq_extern.c
86+
new file mode 100644
87+
index 0000000000..7d0bb8c8bc
88+
--- /dev/null
89+
+++ b/lib/jscoq_extern.c
90+
@@ -0,0 +1,4 @@
91+
+#include <caml/mlvalues.h>
92+
+
93+
+// jsCoq Stub; actual implementation is in backend/jsoo/js_stub/interrupt.js
94+
+value interrupt_pending() { return Val_false; }
95+
--
96+
2.43.0
97+

examples/Demo.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Theorem add_0_r : forall n:nat, n + 0 = n.
22
Proof.
3+
Timeout 1 intros n.
34
intros n. induction n as [| n' IHn'].
45
- (* n = 0 *) reflexivity.
56
- (* n = S n' *) simpl. rewrite -> IHn'. reflexivity. Qed.

fleche/version.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ type t = string
1010

1111
(************************************************************************)
1212
(* UPDATE VERSION HERE *)
13-
let server = "0.2.5-dev"
13+
let server = "0.2.5"
1414
(* UPDATE VERSION HERE *)
1515
(************************************************************************)

0 commit comments

Comments
 (0)