-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fleche] Protect Coq document creation
`Coq.Init` will actually often `Require` Coq's prelude and perform arbitrary actions, we now reflect this on the type. We still have a way to improve here, but for now the code is clear and the server should not crash anymore unless there is a real bug in coq-lsp. Closes #91
- Loading branch information
Showing
6 changed files
with
60 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
module Error : sig | ||
type t = Loc.t option * Pp.t | ||
end | ||
|
||
module R : sig | ||
type 'a t = | ||
| Completed of ('a, Loc.t option * Pp.t) result | ||
| Completed of ('a, Error.t) result | ||
| Interrupted (* signal sent, eval didn't complete *) | ||
|
||
val map : f:('a -> 'b) -> 'a t -> 'b t | ||
val map_error : f:(Error.t -> Error.t) -> 'a t -> 'a t | ||
|
||
(** Update the loc stored in the result, this is used by our cache-aware | ||
location *) | ||
val map_loc : f:(Loc.t -> Loc.t) -> 'a t -> 'a t | ||
end | ||
|
||
(** Eval a function and reify the exceptions. Note [f] _must_ be pure, as in | ||
case of anomaly [f] may be re-executed with debug options. *) | ||
val eval : f:('i -> 'o) -> 'i -> 'o R.t | ||
|
||
(** Update the loc stored in the result, this is used by our cache-aware | ||
location *) | ||
val map_loc : f:(Loc.t -> Loc.t) -> 'a R.t -> 'a R.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters