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

[coq] Support for token-based interruption #509

Merged
merged 1 commit into from
May 28, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ recommend that if you are installing via opam, you use the following branches
that have some fixes backported:

- For 8.20: No known problems
- For 8.19: No known problems
- For 8.19: `opam pin add coq-core https://github.com/ejgallego/coq.git#v8.19+lsp`
- For 8.18: `opam pin add coq-core https://github.com/ejgallego/coq.git#v8.18+lsp`
- For 8.17: `opam pin add coq-core https://github.com/ejgallego/coq.git#v8.17+lsp`
- For 8.16: `opam pin add coq https://github.com/ejgallego/coq.git#v8.16+lsp`
Expand Down
10 changes: 9 additions & 1 deletion coq/limits.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ let select = function
| Coq -> backend := (module Coq)
| Mp -> backend := (module Mp)

(* Set this to false for 8.19 and lower *)
let sane_coq_base_version = true

let sane_coq_branch =
CString.string_contains ~where:Coq_config.version ~what:"+lsp"

let safe_coq = sane_coq_base_version || sane_coq_branch

let select_best = function
| None -> if Mp.available then select Mp else select Coq
| None -> if Mp.available && safe_coq then select Mp else select Coq
| Some backend -> select backend

module Token = struct
Expand Down
14 changes: 12 additions & 2 deletions etc/doc/USER_MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ not fully completed. Also, you can work with bullets and `coq-lsp`
will automatically admit unfinished ones, so you can follow the
natural proof structure.

## Settings
### Embedded Markdown and LaTeX documents



## Coq LSP Settings

### Goal display

Expand All @@ -91,6 +95,9 @@ A setting to have `coq-lsp` check documents continuously exists.

## Memory management

You can tell the server to free up memory with the "Coq LSP: Free
memory" command.

## Advanced: Multiple workspaces

## Interrupting coq-lsp
Expand Down Expand Up @@ -119,10 +126,13 @@ on Coq <= 8.19 do need to install a version of Coq with the backported
fixes. See the information about Coq upstream bugs in the README for
more information about available branches.

`coq-lsp` will reject to enable the new interruption mode by default
on Coq < 8.20 unless the `lsp` Coq branch version is detected.

## Advanced incremental tricks

You can use the `Reset $id` and `Back $steps` commands to isolate
parts of the document from each others in terms of rechecking.
parts of the document from each other in terms of rechecking.

For example, the command `Reset $id` will make the parts of the
document after it use the state before the node `id` was found. Thus,
Expand Down
Loading