package vscoq-language-server
Install
Dune Dependency
Authors
Maintainers
Sources
md5=8a4ff41372c157688170f0174e58d646
sha512=852f4e8cc7e687805e0707368a5625ef3c226d1373f677a731d32a04f8d0cb2f5d64ffdf350b0a5e446ff5075982dc36f2bc9d533d3862009f73fc22fd04fcc0
doc/vscoq-language-server.dm/Dm/Document/index.html
Module Dm.Document
Source
This file defines operations on the content of a document (text, parsing of sentences, scheduling).
The document gathers the text, which is partially validated (parsed into sentences
create_document init_synterp_state text
creates a fresh document with content defined by text
under init_synterp_state
.
val validate_document :
document ->
Types.sentence_id option * Types.sentence_id_set * document
validate_document doc
parses the document without forcing any execution and returns the id of the bottommost sentence of the prefix which has not changed since the previous validation, as well as the set of invalidated sentences
type parsed_ast = {
ast : Synterp.vernac_control_entry;
classification : Vernacextend.vernac_classification;
tokens : Tok.t list;
}
parse_errors doc
returns the list of sentences which failed to parse (see validate_document) together with their error message
apply_text_edits doc edits
updates the text of doc
with edits
. The new text is not parsed or executed.
type sentence = {
start : int;
stop : int;
synterp_state : Vernacstate.Synterp.t;
scheduler_state_before : Scheduler.state;
scheduler_state_after : Scheduler.state;
ast : parsed_ast;
id : Types.sentence_id;
}
find_sentence pos loc
finds the sentence containing the loc
find_sentence_before pos loc
finds the last sentence before the loc
find_sentence_after pos loc
finds the first sentence after the loc
get_first_sentence doc
returns the first parsed sentence
get_last_sentence doc
returns the last parsed sentence