Skip to content

Commit 3a749b2

Browse files
committed
Merge branch 'main' into v9.1
2 parents 724c9aa + 6756c79 commit 3a749b2

File tree

36 files changed

+544
-29
lines changed

36 files changed

+544
-29
lines changed

CHANGES.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
unreleased
2-
----------
1+
# coq-lsp 0.2.4: (W)Activation
2+
------------------------------
33

44
- [js] [deps] Bump to findlib 1.9.8, use vanilla API for loading and
55
remove our own local wrapper (@ejgallego, #975).
@@ -53,6 +53,14 @@ unreleased
5353
- [coq] incorporate experimental `coq-layout-engine` printer, both in
5454
client and server parts (@ejgallego, #668, see also #72 and
5555
https://github.com/jscoq/jscoq/pull/282 )
56+
- [lsp] [code] New notification `$/coq/executionInformation` which
57+
will signal clients when rocq-lsp does intent to start to execute a
58+
sentence. Experimentally, this is used to provide a red glow on
59+
long-running commands in coq-lsp/VSCode, to provide better user
60+
feedback on long-running commands (@ejgallego, suggested by
61+
@jpoiret, #1002)
62+
- [lsp] [outline] Support `Notation`, `Ltac` and `Ltac Notation` in
63+
outline entries (@ejgallego, #1025, fixes #632)
5664

5765
# coq-lsp 0.2.3: Barrage
5866
------------------------

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,12 @@ The checklist for the release as of today is the following:
410410
411411
### Prepare a release commit
412412
413-
- update the version number at `editor/code/package.json`, do `npm i`
414-
- update the version number at `fleche/version.ml`
415413
- update the client changelog at `editor/code/CHANGELOG.md`, commit
414+
- update the version number at `lsp-server/wasm/package.json`
415+
- update the version number at `editor/code/package.json`
416+
- do `make extension` to update the `package-lock.json` files
417+
- update the version number at `fleche/version.ml`
416418
- add release notes in `etc/release_notes/` if needed
417-
- do `make extension` to update the `package-lock.json` file
418419
419420
### Tag and test release commit
420421

compiler/output.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module Fcc_verbose = struct
2727

2828
let serverVersion _ = ()
2929
let serverStatus _ = ()
30+
let execInfo ~uri:_ ~version:_ ~range:_ = ()
3031

3132
let cb =
3233
Fleche.Io.CallBack.
@@ -37,6 +38,7 @@ module Fcc_verbose = struct
3738
; perfData
3839
; serverVersion
3940
; serverStatus
41+
; execInfo
4042
}
4143
end
4244

controller/lsp_core.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ struct
827827
let serverVersion vi = Lsp.JFleche.mk_serverVersion vi |> ofn
828828
let serverStatus st = Lsp.JFleche.mk_serverStatus st |> ofn
829829

830+
let execInfo ~uri ~version ~range =
831+
Lsp.JFleche.mk_execinfo ~uri ~version ~range |> ofn
832+
830833
let cb =
831834
Fleche.Io.CallBack.
832835
{ trace
@@ -836,5 +839,6 @@ struct
836839
; perfData
837840
; serverVersion
838841
; serverStatus
842+
; execInfo
839843
}
840844
end

coq-layout-engine/boxModel.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module H = Tyxml.Html
7272

7373
module Render = struct
7474
let xxx kind = H.txt ("uninplemented: " ^ kind)
75-
let _class c = [ H.a_class [ c ] ]
75+
let _class c = [ H.a_class [ c; "box" ] ]
7676

7777
let span ?(extra = []) c e =
7878
let a = _class c in

coq-layout-engine/dune

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
(library
22
(name layout)
33
(public_name coq-lsp.layout-printer)
4-
(libraries rocq-runtime.interp rocq-runtime.parsing rocq-runtime.printing tyxml))
4+
(libraries
5+
rocq-runtime.interp
6+
rocq-runtime.parsing
7+
rocq-runtime.printing
8+
tyxml))

coq/ast.ml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ module Kinds = struct
151151
let enumMember = 22
152152
let struct_ = 23
153153
let _event = 24
154-
let _operator = 25
154+
let operator = 25
155155
let _typeParameter = 26
156156
end
157157

@@ -233,6 +233,9 @@ let mk_name ~lines (id : Names.lname) : Lang.Ast.Name.t Lang.With_range.t =
233233
let mk_id ~lines (id : Names.lident) =
234234
CAst.map (fun id -> Names.Name id) id |> mk_name ~lines
235235

236+
let mk_string ~lines (id : Names.lstring) =
237+
CAst.map (fun id -> Names.(Name (Id.of_string_soft id))) id |> mk_name ~lines
238+
236239
let constructor_info ~lines ((_, (id, _typ)) : constructor_expr) =
237240
let range = Option.get id.loc in
238241
let range = Utils.to_range ~lines range in
@@ -300,6 +303,11 @@ let symbol_info ~lines ~range
300303
in
301304
List.map mk_info idents
302305

306+
let fixup_range ~loc id =
307+
match id.loc with
308+
| None -> CAst.make ?loc id.v
309+
| Some _ -> id
310+
303311
let make_info ~st:_ ~lines CAst.{ loc; v } : Lang.Ast.Info.t list option =
304312
let open Vernacexpr in
305313
match loc with
@@ -339,4 +347,36 @@ let make_info ~st:_ ~lines CAst.{ loc; v } : Lang.Ast.Info.t list option =
339347
let kind = Kinds.method_ in
340348
let detail = "Rewrite Rule" in
341349
Some [ Lang.Ast.Info.make ~range ~name ~kind ~detail () ]
350+
| VernacSynterp (VernacNotation (_infix, { ntn_decl_string; _ })) ->
351+
let name = mk_string ~lines ntn_decl_string in
352+
let kind = Kinds.operator in
353+
let detail = "Notation" in
354+
Some [ Lang.Ast.Info.make ~range ~name ~kind ~detail () ]
355+
| VernacSynterp
356+
(VernacExtend
357+
({ ext_entry = "VernacDeclareTacticDefinition"; _ }, glist)) ->
358+
let ids =
359+
List.concat_map Serlib.Ser_analysis.NameAnalysis.analyze glist
360+
in
361+
let kind = Kinds.function_ in
362+
let detail = "Tactic" in
363+
let mk_info id =
364+
let name = mk_name ~lines id in
365+
Lang.Ast.Info.make ~range ~name ~detail ~kind ()
366+
in
367+
Some (List.map mk_info ids)
368+
| VernacSynterp
369+
(VernacExtend ({ ext_entry = "VernacTacticNotation"; _ }, glist)) ->
370+
let ids =
371+
List.concat_map Serlib.Ser_analysis.NameAnalysis.analyze glist
372+
in
373+
let kind = Kinds.function_ in
374+
let detail = "Tactic Notation" in
375+
let mk_info id =
376+
(* Tactic notation doesn't properly set id location *)
377+
let id = fixup_range ~loc id in
378+
let name = mk_name ~lines id in
379+
Lang.Ast.Info.make ~range ~name ~detail ~kind ()
380+
in
381+
Some (List.map mk_info ids)
342382
| _ -> None)

editor/code/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# coq-lsp 0.2.4: (W)Activation
2+
------------------------------
3+
4+
- The coq-lsp extension now includes a fully working rocq-lsp
5+
compiled with WebAssembly. This means you can run Rocq without
6+
having to install it, directly from `vscode.dev` or `github.dev`
7+
8+
This was made possible thanks to Shachar Itzhaky's excellent
9+
`ocaml-wasm`.
10+
- Sentences that take long to execute will be highlighted with a red
11+
glowing on the client.
12+
- Support for Rocq 9.1, `_RocqProject`, `rocq` markdown and LaTeX
13+
codeblocks.
14+
- Document outline now supports `Notation`, `Ltac`, and `Ltac
15+
Notation`.
16+
117
# coq-lsp 0.2.3: Barrage
218
------------------------
319

editor/code/lib/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,9 @@ export interface PetRunParams {
228228
st: number;
229229
tac: string;
230230
}
231+
232+
// Exec Info
233+
export interface ExecutionInfoParams {
234+
textDocument: VersionedTextDocumentIdentifier;
235+
range: Range;
236+
}

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.

0 commit comments

Comments
 (0)