package coq-lsp

  1. Overview
  2. Docs
Language Server Protocol native server for Coq

Install

Dune Dependency

Authors

Maintainers

Sources

coq-lsp-0.2.3.9.0.tbz
sha256=8776582dddfe768623870cf540ff6ba1e96a44a36e85db18ab93d238d640f92a
sha512=2837889bf99bfe715bd0e752782211a76a14aac71ed37a4fb784f4f0abe338352c9c6d8caa37daf79c036997add1cb306c523f793625b38709f3b5e245380223

doc/coq-lsp.petanque/Petanque/Agent/index.html

Module Petanque.AgentSource

Sourcemodule State : sig ... end

Petanque.Agent

Sourcemodule Error : sig ... end

Petanque errors

Sourcemodule R : sig ... end

Petanque results

Sourcemodule Run_opts : sig ... end
Sourcemodule Run_result : sig ... end

Protocol notes:

The idea is that the types of the functions here have a direct translation to the JSON-RPC (or any other) protocol.

Thus, types here correspond to types in the wire, except for cases where the protocol layer performs an implicit mapping on types.

So far, the mappings are:

  • uri <-> Doc.t
  • int <-> State.t

The State.t mapping is easy to do at the protocol level with a simple mapping, however uri -> Doc.t may need to yield to the document manager to build the corresponding doc. This is very convenient for users, but introduces a little bit more machinery.

We could imagine a future where State.t need to be managed asynchronously, then the same approach that we use for Doc.t could happen.

Sourceval get_root_state : ?opts:Run_opts.t -> doc:Fleche.Doc.t -> unit -> State.t Run_result.t R.t

get_root_state ?opts ~doc return the root state of the document doc.

Sourceval get_state_at_pos : ?opts:Run_opts.t -> doc:Fleche.Doc.t -> point:(int * int) -> unit -> State.t Run_result.t R.t

get_state_at_pos ?opts ~doc ~position return the state at position position in doc. Note that LSP positions are zero-based!

Sourceval start : token:Coq.Limits.Token.t -> doc:Fleche.Doc.t -> ?opts:Run_opts.t -> ?pre_commands:string -> thm:string -> unit -> State.t Run_result.t R.t

start ~token ~doc ~pre_commands ~thm start a new proof for theorem thm in file uri under fn. token can be used to interrupt the computation. Returns the proof state or error otherwise. pre_commands is a string of dot-separated Coq commands that will be executed before the proof starts.

Sourceval run : token:Coq.Limits.Token.t -> ?opts:Run_opts.t -> st:State.t -> tac:string -> unit -> State.t Run_result.t R.t

run ~token ?memo ~st ~tac tries to run tac over state st. memo (by default true) controls whether the command execution will be memoized in Flèche incremental engine.

Sourceval goals : token:Coq.Limits.Token.t -> st:State.t -> string Coq.Goals.reified_pp option R.t

goals ~token ~st return the list of goals for a given st

Sourcemodule Premise : sig ... end
Sourceval premises : token:Coq.Limits.Token.t -> st:State.t -> Premise.t list R.t

Return the list of defined constants and inductives for a given state. For now we just return their fully qualified name, but more options are of course possible.

Sourceval version : int

Petanque version

OCaml

Innovation. Community. Security.