package vscoq-language-server

  1. Overview
  2. Docs

The document manager holds the view that Coq has of the currently open states. It makes it easy for IDEs to handle text edits, navigate and get feedback. Note that it does not require IDEs to parse vernacular sentences.

type observe_id =
  1. | Id of Types.sentence_id
  2. | Top
type blocking_error = {
  1. last_range : Protocol.LspWrapper.Range.t;
  2. error_range : Protocol.LspWrapper.Range.t;
}
type state
type event
val pp_event : Format.formatter -> event -> unit
type events = event Sel.Event.t list
type handled_event = {
  1. state : state option;
  2. events : events;
  3. update_view : bool;
  4. notification : Protocol.ExtProtocol.Notification.Server.t option;
}
val is_parsing : state -> bool
val init : Vernacstate.t -> opts:Coqargs.injection_command list -> Lsp.Types.DocumentUri.t -> text:string -> state * events

init st opts uri text initializes the document manager with initial vernac state st on which command line opts will be set.

val apply_text_edits : state -> Types.text_edit list -> state * events

apply_text_edits doc edits updates the text of doc with edits. A ParseEvent is triggered, once processed: the new document is parsed, outdated executions states are invalidated, and the observe id is updated.

val reset_to_top : state -> state

reset_to_top state updates the state to make the observe_id Top

get_next_range st pos get the range of the next sentence relative to pos

get_previous_pos st pos get the range of the previous sentence relative to pos

interpret_to_position state pos check_mode point_interp_mode navigates to the last sentence ending before or at pos and returns the resulting state, events that need to take place, and a possible blocking error.

val interpret_to_next_position : state -> Protocol.LspWrapper.Position.t -> Protocol.Settings.Mode.t -> state * events

interpret_to_next_position state pos check_mode navigates to the first sentence after or at pos (excluding whitespace) and returns the resulting state, events that need to take place, a possible blocking error.

val interpret_to_previous : state -> Protocol.Settings.Mode.t -> state * events

interpret_to_previous doc check_mode navigates to the previous sentence in doc and returns the resulting state.

val interpret_to_next : state -> Protocol.Settings.Mode.t -> state * events

interpret_to_next doc navigates to the next sentence in doc and returns the resulting state.

val interpret_to_end : state -> Protocol.Settings.Mode.t -> state * events

interpret_to_end doc navigates to the last sentence in doc and returns the resulting state.

val interpret_in_background : state -> should_block_on_error:bool -> state * events

interpret_in_background doc same as interpret_to_end but computation is done in background (with lower priority)

val reset : state -> state * events

resets Coq

executes_ranges doc mode returns the ranges corresponding to the sentences that have been executed. mode allows to send a "cut" range that only goes until the observe_id in the case of manual mode

val observe_id_range : state -> Protocol.LspWrapper.Range.t option

returns the range of the sentence referenced by observe_id *

returns the messages associated to a given position

returns the Feedback.Info level messages associated to a given position

val get_document_symbols : state -> Lsp.Types.DocumentSymbol.t list
val get_document_proofs : state -> Protocol.ProofState.proof_block list
val all_diagnostics : state -> Lsp.Types.Diagnostic.t list

all_diagnostics doc returns the diagnostics corresponding to the sentences that have been executed in doc.

handles events and returns a new state if it was updated. On top of the next events, it also returns info on whether execution has halted due to an error and returns a boolean flag stating whether the view should be updated

Returns an optional Result: if None, the position did not have a word, if Some, an Ok/Error result is returned.

val jump_to_definition : state -> Protocol.LspWrapper.Position.t -> (Protocol.LspWrapper.Range.t * string) option
module Internal : sig ... end
OCaml

Innovation. Community. Security.