Lsp.Text_document
val make : position_encoding:encoding -> Types.DidOpenTextDocumentParams.t -> t
val languageId : t -> string
val documentUri : t -> Lsp__.Uri0.t
val version : t -> int
val text : t -> string
exception Invalid_utf of invalid_utf
val apply_content_changes :
?version:int ->
t ->
Types.TextDocumentContentChangeEvent.t list ->
t
val apply_text_document_edits : t -> Types.TextEdit.t list -> t
Apply a list of non overlapping text edits. The order of application matters when multiple inserts are done in the same position. All the offsets are interpreted relative to the original document.
val absolute_position : t -> Types.Position.t -> int
absolute_position t pos
returns the absolute position of pos
inside text t
. If the position is outside the bounds of the document, the offset returned will be the length of the document. pos
is interpreted with position_encoding t
val absolute_range : t -> Types.Range.t -> int * int