Package org.eclipse.lemminx.commons
Class TextDocument
java.lang.Object
org.eclipse.lsp4j.TextDocumentItem
org.eclipse.lemminx.commons.TextDocument
- Direct Known Subclasses:
ModelTextDocument
public class TextDocument
extends org.eclipse.lsp4j.TextDocumentItem
Text document extends LSP4j
TextDocumentItem to provide methods to
retrieve position.-
Constructor Summary
ConstructorsConstructorDescriptionTextDocument(String text, String uri) TextDocument(org.eclipse.lsp4j.TextDocumentItem document) -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.lsp4j.RangegetWordRangeAt(int textOffset, Pattern wordDefinition) booleanlineDelimiter(int lineNumber) intlineOffsetAt(int position) lineText(int lineNumber) intoffsetAt(org.eclipse.lsp4j.Position position) org.eclipse.lsp4j.PositionpositionAt(int position) voidsetIncremental(boolean incremental) voidUpdate text of the document by using the changes and according the incremental support.Methods inherited from class org.eclipse.lsp4j.TextDocumentItem
equals, getLanguageId, getText, getUri, getVersion, hashCode, setLanguageId, setText, setUri, setVersion, toString
-
Constructor Details
-
TextDocument
public TextDocument(org.eclipse.lsp4j.TextDocumentItem document) -
TextDocument
-
-
Method Details
-
setIncremental
public void setIncremental(boolean incremental) -
isIncremental
public boolean isIncremental() -
positionAt
- Throws:
BadLocationException
-
offsetAt
- Throws:
BadLocationException
-
lineText
- Throws:
BadLocationException
-
lineOffsetAt
- Throws:
BadLocationException
-
lineDelimiter
- Throws:
BadLocationException
-
getWordRangeAt
-
update
Update text of the document by using the changes and according the incremental support.- Parameters:
changes- the text document changes.
-