class

LSP::TextDocument

Inherits Reference / Object

Represents a text document

Constructors

new(uri : DocumentUri, language_id : String, version : Int32, text : String)

Initialize a text document

Source

Instance methods

apply_change(change : TextDocumentContentChangeEvent)

Apply a change to the text document

Source
get_line(line : Int32) : String | Nil

Get a line from the text document

Source
get_word_at_position(position : Position) : String | Nil

Get a word at a position in the text document

Source
language_id
Source
language_id=(language_id : String)
Source
lines
Source
lines=(lines : Array(String))
Source
offset_at(position : Position) : Int32

Get the offset at a position in the text document

Source
position_at(offset : Int32) : Position

Get the position at an offset in the text document

Source
text
Source
text=(text : String)
Source
uri=(uri : DocumentUri)
Source
version
Source
version=(version : Int32)
Source