-
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.
[protocol] New request
coq/getDocument
to get serialized document.
- Loading branch information
Showing
11 changed files
with
182 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(************************************************************************) | ||
(* Coq Language Server Protocol -- Document *) | ||
(* Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *) | ||
(* Copyright 2019-2023 Inria -- Dual License LGPL 2.1 / GPL3+ *) | ||
(* Written by: Emilio J. Gallego Arias *) | ||
(************************************************************************) | ||
|
||
let to_span { Fleche.Doc.Node.range; ast; _ } = | ||
let span = Option.map (fun { Fleche.Doc.Node.Ast.v; _ } -> v) ast in | ||
Lsp.JFleche.RangedSpan.{ range; span } | ||
|
||
let to_completed = function | ||
| Fleche.Doc.Completion.Yes range -> | ||
{ Lsp.JFleche.CompletionStatus.status = `Yes; range } | ||
| Stopped range -> { status = `Stopped; range } | ||
| Failed range | FailedPermanent range -> { status = `Failed; range } | ||
|
||
let request ~doc = | ||
let { Fleche.Doc.nodes; completed; _ } = doc in | ||
let spans = List.map to_span nodes in | ||
let completed = to_completed completed in | ||
Lsp.JFleche.FlecheDocument.({ spans; completed } |> to_yojson) |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(************************************************************************) | ||
(* Coq Language Server Protocol -- Document *) | ||
(* Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *) | ||
(* Copyright 2019-2023 Inria -- Dual License LGPL 2.1 / GPL3+ *) | ||
(* Written by: Emilio J. Gallego Arias *) | ||
(************************************************************************) | ||
|
||
val request : Requests.document_request |
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
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
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