Skip to content

Commit

Permalink
[limits] Don't enable limits automatically on Coq 8.19 or lower unles…
Browse files Browse the repository at this point in the history
…s on a sane branch.

This will prevent frustation from users.
  • Loading branch information
ejgallego committed May 28, 2024
1 parent 2586131 commit ab56289
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
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

0 comments on commit ab56289

Please sign in to comment.