View Source Lexical.Document.Changes (lexical_shared v0.5.0)
A Lexical.Document.Container
for text edits.
This struct is helpful if you need to express one or several text edits in an LSP response.
It will convert cleanly into either a single TextEdit
or a list of TextEdit
s depending on
whether you passed a single edit or a list of edits.
Using this struct allows efficient conversions at the language server border, as the document doesn't have to be looked up (and possibly read off the filesystem) by the language server.
Link to this section Summary
Functions
Creates a new Changes struct given a document and edits.
Link to this section Types
@type edits() :: Lexical.Document.Edit.t() | [Lexical.Document.Edit.t()]
@type t() :: %Lexical.Document.Changes{document: Lexical.Document.t(), edits: edits()}
Link to this section Functions
@spec new(Lexical.Document.t(), edits()) :: t()
Creates a new Changes struct given a document and edits.