package lsp

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
type encoding := [
  1. | `UTF8
  2. | `UTF16
]
val make : position_encoding:encoding -> Types.DidOpenTextDocumentParams.t -> t
val languageId : t -> string
val documentUri : t -> Lsp__.Uri0.t
val position_encoding : t -> encoding
val version : t -> int
val text : t -> string
type invalid_utf =
  1. | Malformed of string
  2. | Insufficient_input
exception Invalid_utf of invalid_utf
val apply_content_changes : ?version:int -> t -> Types.TextDocumentContentChangeEvent.t list -> t
val set_version : t -> version:int -> 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
OCaml

Innovation. Community. Security.