Skip to content

Commit 92f4b86

Browse files
committed
Merge branch 'v8.19' into v8.18
2 parents 99948b3 + 8047506 commit 92f4b86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2130
-296
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100

101101
- name: Install Coq and SerAPI into OPAM switch
102102
run: |
103+
opam install lwt logs # Also build pet-server
103104
opam install memprof-limits # We need to do this to avoid coq-lsp rebuilding Coq below due to deptops
104105
opam install vendor/coq/{coq-core,coq-stdlib,coqide-server,coq}.opam
105106
opam install vendor/coq-serapi/coq-serapi.opam
@@ -110,6 +111,9 @@ jobs:
110111
- name: Test `coq-lsp` in installed switch
111112
run: opam exec -- fcc examples/Demo.v
112113

114+
- name: Test `pet-server` is built
115+
run: opam exec -- which pet-server
116+
113117
client-compile:
114118
runs-on: ubuntu-latest
115119
defaults:

CHANGES.md

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
# unreleased
2-
------------
1+
# coq-lsp 0.1.9: Hasta el 40 de Mayo...
2+
---------------------------------------
33

4-
- Added new heatmap feature allowing timing data to be seen in the
5-
editor. Can be enabled with the `Coq LSP: Toggle heatmap`
6-
comamnd. Can be configured to show memory usage. Colors and
7-
granularity are configurable. (@Alizter and @ejgallego, #686,
8-
grants #681).
94
- new option `show_loc_info_on_hover` that will display parsing debug
105
information on hover; previous flag was fixed in code, which is way
116
less flexible. This also fixes the option being on in 0.1.8 by
@@ -70,6 +65,11 @@
7065
#348)
7166
- fix Coq performance view display (@ejgallego, #663, regression in
7267
#513)
68+
- Added new heatmap feature allowing timing data to be seen in the
69+
editor. Can be enabled with the `Coq LSP: Toggle heatmap`
70+
command. Can be configured to show memory usage. Colors and
71+
granularity are configurable. (@Alizter and @ejgallego, #686,
72+
grants #681).
7373
- allow more than one input position in `selectionRange` LSP call
7474
(@ejgallego, #667, fixes #663)
7575
- new VSCode commands to allow to move one sentence backwards /
@@ -114,40 +114,73 @@
114114
(@ejgallego, @Alizter, #689, #693)
115115
- Better types `coq/perfData` call (@ejgallego @Alizter, #689)
116116
- New server option to enable / disable `coq/perfData` (@ejgallego, #689)
117-
- New cleint option to enable / disable `coq/perfData` (@ejgallego, #717)
117+
- New client option to enable / disable `coq/perfData` (@ejgallego, #717)
118118
- The `coq-lsp.document` VSCode command will now display the returned
119119
JSON data in a new editor (@ejgallego, #701)
120-
- New server option to enable / disable `coq/perfData` (@ejgallego,
121-
#689)
122120
- Update server settings on the fly when tweaking them in VSCode.
123121
Implement `workspace/didChangeConfiguration` (@ejgallego, #702)
124122
- [Coq API] Add functions to retrieve list of declarations done in
125123
.vo files (@ejallego, @eytans, #704)
126124
- New `petanque` API to interact directly with Coq's proof
127-
engine. (@ejgallego, @gbdrt, #703, thanks to Alex Sanchez-Stern)
125+
engine. (@ejgallego, @gbdrt, Laetitia Teodorescu #703, thanks to
126+
Alex Sanchez-Stern for many insightful feedback and testing)
128127
- New `petanque` JSON-RPC `pet.exe`, which can be used à la SerAPI
129128
to perform proof search and more (@ejgallego, @gbdrt, #705)
129+
- New `pet-server.exe` TCP server for keep-alive sessions (@gbdrt,
130+
#697)
130131
- Always dispose UI elements. This should improve some strange
131132
behaviors on extension restart (@ejgallego, #708)
132-
- Support Coq meta-commands (Reset, Reset Initial, Back) They are
133-
actually pretty useful to hint the incremental engine to ignore
134-
changes in some part of the document (@ejgallego, #709)
133+
- [code] Added new heatmap feature allowing timing data to be seen in
134+
the editor. Can be enabled with the `Coq LSP: Toggle heatmap`
135+
comamnd. Can be configured to show memory usage. Colors and
136+
granularity are configurable. (@Alizter and @ejgallego, #686,
137+
grants #681).
138+
- [server] Support Coq meta-commands (Reset, Reset Initial, Back)
139+
They are actually pretty useful to hint the incremental engine to
140+
ignore changes in some part of the document (@ejgallego, #709)
135141
- JSON-RPC library now supports all kind of incoming messages
136142
(@ejgallego, #713)
137-
- New `coq/viewRange` notification, from client to server, than hints
138-
the scheduler for the visible area of the document; combined with
139-
the new lazy checking mode, this provides checking on scroll, a
140-
feature inspired from Isabelle IDE (@ejgallego, #717)
141-
- Have VSCode wait for full LSP client shutdown on server
143+
- [code/server] New `coq/viewRange` notification, from client to
144+
server, than hints the scheduler for the visible area of the
145+
document; combined with the new lazy checking mode, this provides
146+
checking on scroll, a feature inspired from Isabelle IDE
147+
(@ejgallego, #717)
148+
- [code] Have VSCode wait for full LSP client shutdown on server
142149
restart. This fixes some bugs on extension restart (finally!)
143150
(@ejgallego, #719)
144-
- Center the view if cursor goes out of scope in
151+
- [code] Center the view if cursor goes out of scope in
145152
`sentenceNext/sentencePrevious` (@ejgallego, #718)
146153
- Switch Flèche range encoding to protocol native, this means UTF-16
147-
for now (Léo Stefanesco, @ejgallego, #624, fixes #620, #621)
154+
code points for now (Léo Stefanesco, @ejgallego, #624, fixes #620,
155+
#621)
148156
- Give `Goals` panel focus back if it has lost it (in case of
149157
multiple panels in the second viewColumn of Vscode) whenever
150158
user navigates proofs (@Alidra @ejgallego, #722, #725)
159+
- `fcc`: new option `--diags_level` to control whether Coq's notice
160+
and info messages appear as diagnostics
161+
- [code] Display the continous/on-request checking mode in the status bar,
162+
allow to change it by clicking on it (@ejgallego, #721)
163+
- Add an example of multiple workspaces (@ejgallego, @Blaisorblade,
164+
#611)
165+
- Don't show types of un-expanded goals. We should add an option for
166+
this, but we don't have the cycles (@ejgallego, #730, workarounds
167+
#525 #652)
168+
- Support for `.lv / .v.tex` TeX files with embedded Coq code
169+
(@ejgallego, #727)
170+
- Don't expand bullet goals at previous levels by default
171+
(@ejgallego, @Alizter, #731 cc #525)
172+
- [petanque] Return basic goal information after `run_tac`, so we
173+
avoid a `goals` round-trip for each tactic (@gbdrt, @ejgallego,
174+
#733)
175+
- [coq] Add support for reading glob files metadata (@ejgallego,
176+
#735)
177+
- [petanque] Return extra premise information: file name, position,
178+
raw_text, using the above support for reading .glob files
179+
(@ejgallego, #735)
180+
- [code] Display server status using the `LanguageStatusItem`
181+
facility, for now we display version and checking status
182+
information (moved from #721), and we also allow to toggle the
183+
checking mode from there (@ejgallego, #728)
151184

152185
# coq-lsp 0.1.8.1: Spring fix
153186
-----------------------------

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ document checking, advanced error recovery, hybrid Coq/markdown document
2020
support, multiple workspace support, positional goals and information panel,
2121
performance data, extensible command-line compiler, plugin system, and more.
2222

23+
See the [coq-lsp User Manual](./etc/doc/USER_MANUAL.md) for more information.
24+
2325
`coq-lsp` aims to provide a seamless, modern interactive theorem proving
2426
experience, as well as to serve as a maintainable platform for research and UI
2527
integration with other projects.
@@ -37,6 +39,7 @@ and web native usage, providing quite a few extra features from vanilla Coq.
3739

3840
- [🎁 Features](#-features)
3941
- [⏩ Incremental Compilation and Continuous Document Checking](#-incremental-compilation-and-continuous-document-checking)
42+
- [👁 On-demand, Follow The Viewport Document Checking](#-on-demand-follow-the-viewport-document-checking)
4043
- [🧠 Smart, Cache-Aware Error Recovery](#-smart-cache-aware-error-recovery)
4144
- [🥅 Whole-Document Goal Display](#-whole-document-goal-display)
4245
- [🗒️ Markdown Support](#️-markdown-support)
@@ -58,6 +61,7 @@ and web native usage, providing quite a few extra features from vanilla Coq.
5861
- [✅ Vim](#-vim)
5962
- [🩱 Neovim](#-neovim)
6063
- [🐍 Python](#-python)
64+
- [`coq-lsp` users and extensions](#-coq-lsp-users-and-extensions)
6165
- [🗣️ Discussion Channel](#️-discussion-channel)
6266
- [☎ Weekly Calls](#-weekly-calls)
6367
- [❓FAQ](#faq)
@@ -87,6 +91,14 @@ restart your proof session where you left it at the last time.
8791
Incremental support is undergoing refinement, if `coq-lsp` rechecks when it
8892
should not, please file a bug!
8993

94+
### 👁 On-demand, Follow The Viewport Document Checking
95+
96+
`coq-lsp` does also support on-demand checking. Two modes are available: follow
97+
the cursor, or follow the viewport; the modes can be toggled using the Language
98+
Status Item in Code's bottom right corner:
99+
100+
<img alt="On-demand checking" height="572px" src="etc/img/on_demand.gif"/>
101+
90102
### 🧠 Smart, Cache-Aware Error Recovery
91103

92104
`coq-lsp` won't stop checking on errors, but supports (and encourages) working
@@ -307,6 +319,17 @@ guide](./CONTRIBUTING.md)
307319
- Interact programmatically with Coq files by using the [Python `coq-lsp` client](https://github.com/sr-lab/coq-lsp-pyclient)
308320
by Pedro Carrott and Nuno Saavedra.
309321

322+
## `coq-lsp` users and extensions
323+
324+
The below projects are using `coq-lsp`, we recommend you try them!
325+
326+
- [CoqPilot uses Large Language Models to generate multiple potential proofs and then uses coq-lsp to typecheck them](https://github.com/JetBrains-Research/coqpilot).
327+
- [jsCoq: use Coq from your browser](https://github.com/jscoq/jscoq)
328+
- [Pytanque: a Python library implementing RL Environments](https://github.com/LLM4Coq/pytanque)
329+
- [ViZX: A Visualizer for the ZX Calculus](https://github.com/inQWIRE/ViZX).
330+
- [The Waterproof vscode extension helps students learn how to write mathematical proofs](https://github.com/impermeable/waterproof-vscode).
331+
- [Yade: Support for the YADE diagram editor in VSCode](https://github.com/amblafont/vscode-yade-example).
332+
310333
## 🗣️ Discussion Channel
311334

312335
`coq-lsp` discussion channel it at [Coq's
@@ -332,7 +355,7 @@ recommend that if you are installing via opam, you use the following branches
332355
that have some fixes backported:
333356

334357
- For 8.20: No known problems
335-
- For 8.19: No known problems
358+
- For 8.19: `opam pin add coq-core https://github.com/ejgallego/coq.git#v8.19+lsp`
336359
- For 8.18: `opam pin add coq-core https://github.com/ejgallego/coq.git#v8.18+lsp`
337360
- For 8.17: `opam pin add coq-core https://github.com/ejgallego/coq.git#v8.17+lsp`
338361
- For 8.16: `opam pin add coq https://github.com/ejgallego/coq.git#v8.16+lsp`

compiler/args.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type t =
1414
; plugins : string list (** Flèche plugins to load *)
1515
; max_errors : int option
1616
(** Maximum erros before aborting the compilation *)
17+
; coq_diags_level : int
18+
(** Whether to include feedback messages in the diagnostics *)
1719
}
1820

1921
let compute_default_plugins ~no_vo ~plugins =

compiler/compile.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let save_diags_file ~(doc : Fleche.Doc.t) =
2222
let file = Lang.LUri.File.to_string_file doc.uri in
2323
let file = Filename.remove_extension file ^ ".diags" in
2424
let diags = Fleche.Doc.diags doc in
25-
Fleche.Compat.format_to_file ~file ~f:Output.pp_diags diags
25+
Coq.Compat.format_to_file ~file ~f:Output.pp_diags diags
2626

2727
(** Return: exit status for file:
2828
@@ -47,9 +47,7 @@ let compile_file ~cc file : int =
4747
let workspace = workspace_of_uri ~io ~workspaces ~uri ~default in
4848
let files = Coq.Files.make () in
4949
let env = Doc.Env.make ~init:root_state ~workspace ~files in
50-
let raw =
51-
Fleche.Compat.Ocaml_414.In_channel.(with_open_bin file input_all)
52-
in
50+
let raw = Coq.Compat.Ocaml_414.In_channel.(with_open_bin file input_all) in
5351
let () = Theory.create ~io ~token ~env ~uri ~raw ~version:1 in
5452
match Theory.Check.maybe_check ~io ~token with
5553
| None -> 102

compiler/driver.ml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,20 @@ let apply_config ~max_errors =
3636
max_errors
3737

3838
let go ~int_backend args =
39-
let { Args.cmdline; roots; display; debug; files; plugins; max_errors } =
39+
let { Args.cmdline
40+
; roots
41+
; display
42+
; debug
43+
; files
44+
; plugins
45+
; max_errors
46+
; coq_diags_level
47+
} =
4048
args
4149
in
4250
(* Initialize event callbacks, in testing don't do perfData *)
4351
let perfData = Option.is_empty fcc_test in
44-
let io = Output.init display ~perfData in
52+
let io = Output.init ~display ~perfData ~coq_diags_level in
4553
(* Initialize Coq *)
4654
let debug = debug || Fleche.Debug.backtraces || !Fleche.Config.v.debug in
4755
let root_state = coq_init ~debug in

compiler/fcc.ml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ open Cmdliner
33
open Fcc_lib
44

55
let fcc_main int_backend roots display debug plugins files coqlib coqcorelib
6-
ocamlpath rload_path load_path require_libraries no_vo max_errors =
6+
ocamlpath rload_path load_path require_libraries no_vo max_errors
7+
coq_diags_level =
78
let vo_load_path = rload_path @ load_path in
89
let ml_include_path = [] in
910
let args = [] in
@@ -19,7 +20,16 @@ let fcc_main int_backend roots display debug plugins files coqlib coqcorelib
1920
in
2021
let plugins = Args.compute_default_plugins ~no_vo ~plugins in
2122
let args =
22-
Args.{ cmdline; roots; display; files; debug; plugins; max_errors }
23+
Args.
24+
{ cmdline
25+
; roots
26+
; display
27+
; files
28+
; debug
29+
; plugins
30+
; max_errors
31+
; coq_diags_level
32+
}
2333
in
2434
Driver.go ~int_backend args
2535

@@ -91,7 +101,7 @@ let fcc_cmd : int Cmd.t =
91101
Term.(
92102
const fcc_main $ int_backend $ roots $ display $ debug $ plugins $ file
93103
$ coqlib $ coqcorelib $ ocamlpath $ rload_paths $ qload_paths $ ri_from
94-
$ no_vo $ max_errors)
104+
$ no_vo $ max_errors $ coq_diags_level)
95105
in
96106
let exits = Exit_codes.[ fatal; stopped; scheduled; uri_failed ] in
97107
Cmd.(v (Cmd.info "fcc" ~exits ~version ~doc ~man) fcc_term)

compiler/output.ml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ let pp_diags fmt dl =
99
(* We will use this when we set eager diagnotics to true *)
1010
let diagnostics ~uri:_ ~version:_ _diags = ()
1111
let fileProgress ~uri:_ ~version:_ _progress = ()
12-
let perfData ~uri:_ ~version:_ _perf = ()
1312

1413
(* We print trace and messages, and perfData summary *)
1514
module Fcc_verbose = struct
@@ -24,26 +23,30 @@ module Fcc_verbose = struct
2423
let perfData ~uri:_ ~version:_ { Fleche.Perf.summary; _ } =
2524
Format.(eprintf "[perfdata]@\n@[%s@]@\n%!" summary)
2625

26+
let serverVersion _ = ()
27+
let serverStatus _ = ()
28+
2729
let cb =
28-
Fleche.Io.CallBack.{ trace; message; diagnostics; fileProgress; perfData }
30+
Fleche.Io.CallBack.
31+
{ trace
32+
; message
33+
; diagnostics
34+
; fileProgress
35+
; perfData
36+
; serverVersion
37+
; serverStatus
38+
}
2939
end
3040

3141
(* We print trace, messages *)
3242
module Fcc_normal = struct
3343
let trace _ ?extra:_ _ = ()
34-
let message = Fcc_verbose.message
35-
let perfData = Fcc_verbose.perfData
36-
37-
let cb =
38-
Fleche.Io.CallBack.{ trace; message; diagnostics; fileProgress; perfData }
44+
let cb = { Fcc_verbose.cb with trace }
3945
end
4046

4147
module Fcc_quiet = struct
42-
let trace _ ?extra:_ _ = ()
4348
let message ~lvl:_ ~message:_ = ()
44-
45-
let cb =
46-
Fleche.Io.CallBack.{ trace; message; diagnostics; fileProgress; perfData }
49+
let cb = { Fcc_normal.cb with message }
4750
end
4851

4952
let set_callbacks (display : Args.Display.t) =
@@ -56,16 +59,18 @@ let set_callbacks (display : Args.Display.t) =
5659
Fleche.Io.CallBack.set cb;
5760
cb
5861

59-
let set_config ~perfData =
62+
let set_config ~perfData ~coq_diags_level =
63+
let show_coq_info_messages = coq_diags_level > 1 in
64+
let show_notices_as_diagnostics = coq_diags_level > 0 in
6065
Fleche.Config.(
6166
v :=
6267
{ !v with
6368
send_perf_data = perfData
6469
; eager_diagnostics = false
65-
; show_coq_info_messages = true
66-
; show_notices_as_diagnostics = true
70+
; show_coq_info_messages
71+
; show_notices_as_diagnostics
6772
})
6873

69-
let init display ~perfData =
70-
set_config ~perfData;
74+
let init ~display ~coq_diags_level ~perfData =
75+
set_config ~perfData ~coq_diags_level;
7176
set_callbacks display

compiler/output.mli

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
(** Initialize Console Output System *)
2-
val init : Args.Display.t -> perfData:bool -> Fleche.Io.CallBack.t
2+
val init :
3+
display:Args.Display.t
4+
-> coq_diags_level:int
5+
-> perfData:bool
6+
-> Fleche.Io.CallBack.t
37

48
(** Report progress on file compilation *)
59
(* val report : unit -> unit *)

0 commit comments

Comments
 (0)