package coq-lsp
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=8776582dddfe768623870cf540ff6ba1e96a44a36e85db18ab93d238d640f92a
sha512=2837889bf99bfe715bd0e752782211a76a14aac71ed37a4fb784f4f0abe338352c9c6d8caa37daf79c036997add1cb306c523f793625b38709f3b5e245380223
doc/coq-lsp.fleche/Fleche/Doc/index.html
Module Fleche.Doc
Source
Enviroment external to the document, this includes for now the init
Coq state and the workspace
, which are used to build the first state of the document, usually by importing the prelude and other libs implicitly.
type t = private {
uri : Lang.LUri.File.t;
(*
*)uri
of the documentversion : int;
(*
*)version
of the documentcontents : Contents.t;
(*
*)contents
of the documentnodes : Node.t list;
(*List of document nodes
*)completed : Completion.t;
(*Status of the document, usually either completed, suspended, or waiting for some IO / external event
*)toc : Node.t CString.Map.t;
(*table of contents
*)env : Env.t;
(*External document enviroment
*)root : Coq.State.t;
(*
*)root
contains the first state document state, obtained by applying a workspace to Coq's initial statediags_dirty : bool;
(*internal field
*)
}
A Flèche document is basically a node list
, which is a crude form of a meta-data map Range.t -> data
, where for now data
is the contents of Node.t
.
Return the list of all asts in the doc
Return the list of all diags in the doc
val create :
token:Coq.Limits.Token.t ->
env:Env.t ->
uri:Lang.LUri.File.t ->
version:int ->
raw:string ->
t
Create a new Coq document, this is cached! Note that this operation always suceeds, but the document could be created in a `Failed` state if problems arise.
Update the contents of a document, updating the right structures for incremental checking. If the operation fails, the document will be left in `Failed` state.
val check :
io:Io.CallBack.t ->
token:Coq.Limits.Token.t ->
target:Target.t ->
doc:t ->
unit ->
t
check ~io ~target ~doc ()
, check document doc
, target
will have Flèche stop after the point specified there has been reached. Output functions are in the io
record, used to send partial updates.
save ~doc
will save doc
.vo file. It will fail if proofs are open, or if the document completion status is not Yes
val run :
token:Coq.Limits.Token.t ->
?loc:Loc.t ->
?memo:bool ->
st:Coq.State.t ->
string ->
(Coq.State.t, Loc.t) Coq.Protect.E.t
run ~token ?loc ?memo ~st cmds
run commands cmds
starting on state st
, without commiting changes to the document. loc
can be used to seed an initial location if desired, if not the locations will be considered relative to the initial location. memo
controls if the execution is memoized, by default true
.
This API is experimental, used for speculative execution petanque and goals
, the API is expected to change as to better adapt to users.