Skip to content

Commit 17df8cf

Browse files
committed
Merge branch 'main' into v9.0
2 parents d902b74 + 08f212c commit 17df8cf

File tree

18 files changed

+448
-91
lines changed

18 files changed

+448
-91
lines changed

CHANGES.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# unreleased
2-
------------
1+
# coq-lsp 0.2.3: Barrage
2+
------------------------
33

44
- [fleche] fix quick fixes for errors being lost due to incorrect
55
handling of `send_diags_extra_data` (@ejgallego, #850)
@@ -71,6 +71,13 @@
7171
(@JulesViennotFranca, @ejgallego, #962)
7272
- [doc] [petanque] Document petanque v1, improve readme (@ejgallego,
7373
#963)
74+
- [plugin] [astdump] Make the JSON and SEXP output into a line per
75+
object by default (@blackbird1128, @ejgallego, #874)
76+
- [doc] [emacs] [protocol] Improve documentation for `proof/goals`,
77+
add link to official emacs mode by Josselin Poiret (@ejgallego,
78+
#969, thanks to @jpoiret, cc: #941)
79+
- [goals] Include `range` in `proof/goals` answer. This is useful for
80+
clients willing to do highlighting (@ejgallego, @jpoiret, #970)
7481

7582
# coq-lsp 0.2.2: To Virtual or not To Virtual
7683
---------------------------------------------

CONTRIBUTING.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,12 @@ Debug" panel in Visual Studio Code, or the F5 keybinding.
310310
You can of course install the extension in your `~/.vscode/` folder if so you
311311
desire, although this is not recommended.
312312
313-
### Nix
314-
In the case of the client we expose a separate shell, `client-vscode`, which can be spawned with the following line (this can be done on top of the original `nix develop`).
313+
### Nix
314+
315+
In the case of the client we expose a separate shell, `client-vscode`,
316+
which can be spawned with the following line (this can be done on top
317+
of the original `nix develop`).
318+
315319
```
316320
nix develop .#client-vscode
317321
```
@@ -388,41 +392,49 @@ README there for more details.
388392
389393
The checklist for the release as of today is the following:
390394
391-
### Pre-release
395+
### Prepare a release commit
392396
393397
- update the version number at `editor/code/package.json`, do `npm i`
394398
- update the version number at `fleche/version.ml`
399+
- update the client changelog at `editor/code/CHANGELOG.md`, commit
400+
- add release notes in `etc/release_notes/` if needed
401+
- do `make extension` to update the `package-lock.json` file
395402
396-
### Client:
403+
### Tag and test release commit
404+
405+
```
406+
export COQLSPV=0.2.3
407+
git checkout main && make && make test test-compiler && dune-release tag ${COQLSPV}
408+
git checkout v9.0 && git merge main && make && make test test-compiler && dune-release tag ${COQLSPV}+9.0
409+
git checkout v8.20 && git merge v9.0 && make && make test test-compiler && dune-release tag ${COQLSPV}+8.20
410+
git checkout v8.19 && git merge v8.20 && make && make test test-compiler && dune-release tag ${COQLSPV}+8.19
411+
git checkout v8.18 && git merge v8.19 && make && make test test-compiler && dune-release tag ${COQLSPV}+8.18
412+
git checkout v8.17 && git merge v8.18 && make && make test test-compiler && dune-release tag ${COQLSPV}+8.17
413+
```
414+
415+
### Client release:
397416
398-
- update the client changelog at `editor/code/CHANGELOG.md`, commit
399-
- for the `main` branch: `dune release tag $coq_lsp_version`
400417
- build the extension with `npm run vscode:prepublish`
401418
- check with `vsce ls` that the client contents are OK
402-
- `vsce publish`
403-
- upload vsix to OpenVSX marketplace
419+
- upload to official VSCode marketplace: `vsce publish`
420+
- upload vsix to OpenVSX marketplace:
404421
405422
### Server:
406423
407-
- sync branches for previous Coq versions, using `git merge`, test and push to CI.
408-
- `dune release tag` for each `$coq_lsp_version+$coq_version`
409-
- `dune release` for each version that should to the main opam repos
410-
- [deprecated] update pre-release packages to coq-opam-archive
424+
`dune release` for each version that should to the main opam repos:
411425
412-
The above can be done with:
413426
```
414-
export COQLSPV=0.2.1
415-
git checkout main && make && dune-release tag ${COQLSPV}
416-
git checkout v8.20 && git merge main && make && dune-release tag ${COQLSPV}+8.20 && dune-release
417-
git checkout v8.19 && git merge v8.20 && make && dune-release tag ${COQLSPV}+8.19 && dune-release
418-
git checkout v8.18 && git merge v8.19 && make && dune-release tag ${COQLSPV}+8.18 && dune-release
419-
git checkout v8.17 && git merge v8.18 && make && dune-release tag ${COQLSPV}+8.17 && dune-release
427+
export COQLSPV=0.2.3
428+
git checkout v9.0 && dune-release
429+
git checkout v8.20 && dune-release
430+
git checkout v8.19 && dune-release
431+
git checkout v8.18 && dune-release
432+
git checkout v8.17 && dune-release
420433
```
421434
422-
### After release
435+
### [important] After release commit
423436
424-
- [important] bump `version.ml` and `editor/code/package.json` version
425-
string to a `-dev` suffix
437+
- bump `version.ml` and `editor/code/package.json` version string to a `$version+1-dev`
426438
427439
## Emacs
428440

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ vendor/coq/config/coq_config.ml: vendor/coq
7373
-libdir "$$EPATH/_build/install/default/lib/coq" \
7474
-bytecode-compiler $(COQVM) \
7575
-native-compiler no \
76-
&& cp theories/dune.disabled theories/dune \
77-
&& cp user-contrib/Ltac2/dune.disabled user-contrib/Ltac2/dune
76+
&& cp theories/Corelib/dune.disabled theories/Corelib/dune \
77+
&& cp theories/Ltac2/dune.disabled theories/Ltac2/dune
7878

7979
# We set windows parameters a bit better, note the need to use forward
8080
# slashed (cygpath -m) due to escaping :( , a conversion to `-w` is
@@ -86,8 +86,8 @@ winconfig:
8686
&& ./configure -no-ask -prefix "$$EPATH\\_build\\install\\default\\" \
8787
-libdir "$$EPATH\\_build\\install\\default\\lib\\coq\\" \
8888
-native-compiler no \
89-
&& cp theories/dune.disabled theories/dune \
90-
&& cp user-contrib/Ltac2/dune.disabled user-contrib/Ltac2/dune
89+
&& cp theories/Corelib/dune.disabled theories/Corelib/dune \
90+
&& cp theories/Ltac2/dune.disabled theories/Ltac2/dune
9191

9292
.PHONY: wp
9393
wp:

README.md

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,66 @@
1-
# Coq LSP <img align="right" height="42" src="./etc/img/inria-logo.png"/> <!-- omit in toc -->
1+
# Rocq LSP <img align="right" height="42" src="./etc/img/inria-logo.png"/> <!-- omit in toc -->
22

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

5-
`coq-lsp` is a [Language
6-
Server](https://microsoft.github.io/language-server-protocol/) for the [Rocq
7-
Prover](https://coq.inria.fr). It implements the
8-
[LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) protocol, with custom [extensions](./etc/doc/PROTOCOL.md), including the [petanque](./petanque)
9-
protocol, designed for low-latency interaction with Rocq, particularly suited for AI and
10-
Software Engineering applications.
5+
`coq-lsp` is a [Language Server](https://microsoft.github.io/language-server-protocol/) for the [Rocq Prover](https://coq.inria.fr). It provides a single server that implements:
6+
7+
- the [LSP](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)
8+
protocol, with custom [extensions](./etc/doc/PROTOCOL.md)
9+
- the [petanque](./petanque) protocol, designed for low-latency interaction with
10+
Rocq, idel for AI and software engineering applications
11+
- the [MCP](https://modelcontextprotocol.io/) protocol (upcoming), an open
12+
protocol that standardizes how applications provide context to LLMs
1113

1214
**Key [features](#Features)** of `coq-lsp` are: continuous, incremental document
1315
checking, real-time interruptions and limits, programmable error recovery,
14-
literate Rocq/Markdown/LaTeX document support, multiple workspaces, positional
15-
goals, information panel, performance data, extensible command-line compiler,
16-
a plugin system, and more.
16+
literate Markdown and LaTeX document support, multiple workspaces, positional
17+
goals, information panel, performance data, completion, jump to definition,
18+
extensible command-line compiler, a plugin system, and more.
19+
20+
`coq-lsp` is built on **Flèche**, a new document checking engine for formal
21+
documents based on our previous work on
22+
[SerAPI](https://github.com/ejgallego/coq-serapi/) and
23+
[jsCoq](https://github.com/jscoq/jscoq).
24+
25+
Designed for interactive use and web-native environments, Flèche is extensible
26+
and supports [advanced tooling integration](#-a-platform-for-research) and
27+
capabilities beyond standard Rocq.
1728

18-
See the [User Manual](./etc/doc/USER_MANUAL.md) and the [General
19-
Documentation Index](./etc/doc/) for more details.
29+
See the [User Manual](./etc/doc/USER_MANUAL.md) and the [General Documentation Index](./etc/doc/) for more details.
2030

2131
This repository also includes the `coq-lsp` [Visual Studio
2232
Code](https://code.visualstudio.com/) editor extension for the [Rocq Proof
23-
Assistant](https://coq.inria.fr), and a few other components, see our
24-
[contributing guide](#contributing) for more information. Experimental support
33+
Assistant](https://coq.inria.fr), and a few other components. See our
34+
[contributing guide](#contributing) for more information. Support
2535
for [Emacs](#emacs), [Vim](#vim) and [Neovim](#neovim) is also available in
2636
their own projects.
2737

2838
**Quick Install**:
2939

30-
- **🐧 Linux / 🍎 macOs / **🪟 Windows:**:**
40+
- **🐧 Linux / 🍎 macOs / 🪟 Windows:**
3141
```
3242
$ opam install coq-lsp && code --install-extension ejgallego.coq-lsp
3343
```
3444

35-
- **🪟 Windows:** (alternative method) Download the [Coq Platform installer](#-server)
45+
- **🪟 Windows:** (alternative method)
3646

37-
Try it online ☕☕ (experimental) https://github.dev/ejgallego/hello-rocq
47+
Download the [Coq Platform installer](#-server)
3848

39-
`coq-lsp` aims to deliver a modern, seamless experience for interactive theorem
40-
proving, while serving as a robust platform for research and integration with
41-
other tools.
49+
- **🦄 Emacs**:
4250

43-
`coq-lsp` is built on **Flèche**, a new document checking engine for
44-
formal documents developed from the lessons of
45-
[SerAPI](https://github.com/ejgallego/coq-serapi/) and
46-
[jsCoq](https://github.com/jscoq/jscoq). Flèche is optimized for
47-
interactive use, [SerAPI-like tooling integration](#-a-platform-for-research),
48-
and web-native environments, offering capabilities beyond standard Rocq.
51+
```elisp
52+
(use-package rocq-mode
53+
:vc (:url "https://codeberg.org/jpoiret/rocq-mode.el.git"
54+
:rev :newest)
55+
:mode "\\.v\\'"
56+
:hook
57+
(rocq-mode . rocq-follow-viewport-mode)
58+
(rocq-mode . rocq-auto-goals-at-point-mode))
59+
```
60+
61+
- **☕ Try it online ☕ (experimental)**:
4962

50-
`coq-lsp` supports 🐧 Linux, 🍎 macOS, 🪟 Windows , and ☕ JavaScript (Node/Browser)
63+
https://github.dev/ejgallego/hello-rocq
5164

5265
## Table of Contents <!-- omit in toc -->
5366

@@ -257,10 +270,11 @@ ready.
257270

258271
### 🏘️ Supported Coq Versions
259272

260-
`coq-lsp` supports Coq 8.20, Coq 8.19, Coq 8.18, Coq 8.17, and Coq's `master`
261-
branch. Code for each Coq version can be found in the corresponding branch.
273+
`coq-lsp` supports Rocq 9.0, Coq 8.20, Coq 8.19, Coq 8.18, Coq 8.17, and Coq's
274+
`master` branch. Code for each Coq version can be found in the corresponding
275+
branch.
262276

263-
We recommended using Coq 8.19 or `master` version. For other Coq versions, we
277+
We recommended using Rocq 9.0 or `master` version. For other Coq versions, we
264278
recommend users to install the custom Coq tree as detailed in [Coq Upstream
265279
Bugs](#coq-upstream-bugs).
266280

@@ -308,10 +322,8 @@ guide](./CONTRIBUTING.md)
308322

309323
### 🦄 Emacs
310324

311-
- An experimental configuration for `lsp-mode` has been provided by Arthur
312-
Azevedo de Amorim, supporting goal display, see [the Zulip
313-
thread](https://coq.zulipchat.com/#narrow/stream/329642-coq-lsp/topic/coq-lsp.20under.20Emacs.2E)
314-
for more information.
325+
The official Rocq Emacs mode is https://codeberg.org/jpoiret/rocq-mode.el ,
326+
maintained by Josselin Poiret with contributions by Arthur Azevedo de Amorim.
315327

316328
### ✅ Vim
317329

controller-js/jsso.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,5 @@ let rec json_to_obj (cobj : < .. > Js.t) (json : Yojson.Safe.t) : < .. > Js.t =
5151
| `String s -> coerce @@ Js.string s
5252
| `Int m -> coerce @@ Js.number_of_float (float_of_int m)
5353
| `Intlit s -> coerce @@ Js.number_of_float (float_of_string s)
54-
| `Tuple t -> coerce @@ Array.(Js.array @@ map ofresh (of_list t))
55-
| `Variant (_, _) -> pure_js_expr "undefined"
5654

5755
let json_to_obj json = json_to_obj (Js.Unsafe.obj [||]) json

controller/rq_goals.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ let goals ~pp_format ~mode ~pretac () ~token ~doc ~point =
6060
let open Coq.Protect.E.O in
6161
let+ goals, program = get_goal_info ~token ~doc ~point ~mode ~pretac () in
6262
let node = Info.LC.node ~doc ~point Exact in
63+
let range = Option.map Fleche.Doc.Node.range node in
6364
let messages = mk_messages node in
6465
let error = Option.bind node mk_error in
6566
let pp = pp ~pp_format in
6667
Lsp.JFleche.GoalsAnswer.(
67-
to_yojson pp { textDocument; position; goals; program; messages; error })
68+
to_yojson pp
69+
{ textDocument; position; range; goals; program; messages; error })
6870
|> Result.ok
6971

7072
let goals ~pp_format ~mode ~pretac () ~token ~doc ~point =

editor/code/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
# coq-lsp 0.2.3: Barrage
2+
------------------------
3+
4+
Mainly small tweaks and improvements, note the changed keybindings in
5+
OSX; summary of user-visible changes:
6+
7+
- [vscode] [macos] Resolve keybinding conflict with Cmd+N and
8+
Cmd+Enter, we now use Alt+N and Alt+Shift+Enter, (Andrei
9+
Listochkin, #926)
10+
- [fleche] fix quick fixes for errors being lost due to incorrect
11+
handling of `send_diags_extra_data` (@ejgallego, #850)
12+
- [vscode] Syntax highlighting for Coq 8.17-8.20 (@4ever2, #872)
13+
- [vscode] [web] Fix web extension not exporting the coq-lsp
14+
extension API (@ejgallego, reported by @amblafont, #911, fixes
15+
#877)
16+
- [hover] New option `show_state_hash_on_hover` that displays state
17+
hash on hover for debug (@ejgallego, #954)
18+
- [doc] [faq] Updated FAQ to account for VSCoq 2 release in 2023,
19+
thanks to Patrick Nicodemus for pointing out the outdated
20+
documentation (@ejgallego, #846, fixes #817)
21+
- [rocq] [fleche] Disable memprof-limits interruption backend by
22+
default, as released Rocq versions are not safe yet. If you want to
23+
enable it, you can still do it with the `--int_backend=Mp` command
24+
line option (@ejgallego, #957, fixes #857, reported by @dariusf,
25+
cc: rocq-prover/rocq#19177)
26+
- [lsp] [controller] Include Rocq feedback on request errors, using
27+
the optional `data` field. This is useful to still be able to
28+
obtain feedback messages such as debug messages even when a request
29+
fails. This also opens the door to better protocol handling and
30+
petanque integration (@ejgallego, #959, #961)
31+
132
# coq-lsp 0.2.2: To Virtual or not To Virtual
233
---------------------------------------------
334

editor/code/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export type ProgramInfo = [Id, OblsView][];
6060
export interface GoalAnswer<Pp> {
6161
textDocument: VersionedTextDocumentIdentifier;
6262
position: Position;
63+
range: Range;
6364
goals?: GoalConfig<Pp>;
6465
program?: ProgramInfo;
6566
messages: Pp[] | Message<Pp>[];

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.3-dev",
5+
"version": "0.2.3",
66
"contributors": [
77
"Emilio Jesús Gallego Arias <[email protected]>",
88
"Ali Caglayan <[email protected]>",

0 commit comments

Comments
 (0)