package vscoq-language-server

  1. Overview
  2. Docs

Module Dm.DocumentManagerSource

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.

Sourcetype observe_id =
  1. | Id of Types.sentence_id
  2. | Top
Sourcetype state
Sourcetype event
Sourceval pp_event : Format.formatter -> event -> unit
Sourcetype events = event Sel.Event.t list
Sourceval init : Vernacstate.t -> opts:Coqargs.injection_command list -> Lsp.Types.DocumentUri.t -> text:string -> observe_id option -> state * events

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

Sourceval apply_text_edits : state -> Types.text_edit list -> state

apply_text_edits doc edits updates the text of doc with edits. The new document is parsed, outdated executions states are invalidated, and the observe id is updated.

Sourceval clear_observe_id : state -> state

clear_observe_id state updates the state to make the observe_id None

Sourceval 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

Sourceval interpret_to_position : state -> Protocol.LspWrapper.Position.t -> state * events

interpret_to_position stateful doc pos navigates to the last sentence ending before or at pos and returns the resulting state. The stateful flag determines if we record the resulting position in the state.

Sourceval interpret_to_previous : state -> state * events

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

Sourceval interpret_to_next : state -> state * events

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

Sourceval interpret_to_end : state -> state * events

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

Sourceval interpret_in_background : state -> state * events

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

Sourceval reset : state -> state * events

resets Coq

Sourceval executed_ranges : state -> Types.exec_overview

returns the ranges corresponding to the sentences that have been executed and remotely executes

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

returns the range of the sentence referenced by observe_id *

Sourceval all_diagnostics : state -> Lsp.Types.Diagnostic.t list

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

Sourceval handle_event : event -> state -> state option * events

handles events and returns a new state if it was updated

Sourceval about : state -> Protocol.LspWrapper.Position.t -> pattern:string -> (Protocol.Printing.pp, string) Result.t

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

Sourceval check : state -> Protocol.LspWrapper.Position.t -> pattern:string -> (Protocol.Printing.pp, string) Result.t
Sourceval locate : state -> Protocol.LspWrapper.Position.t -> pattern:string -> (Protocol.Printing.pp, string) Result.t
Sourceval print : state -> Protocol.LspWrapper.Position.t -> pattern:string -> (Protocol.Printing.pp, string) Result.t
Sourcemodule Internal : sig ... end
OCaml

Innovation. Community. Security.