Package org.eclipse.lemminx.commons
Class ModelTextDocument<T,S>
java.lang.Object
org.eclipse.lsp4j.TextDocumentItem
org.eclipse.lemminx.commons.TextDocument
org.eclipse.lemminx.commons.ModelTextDocument<T,S>
- Type Parameters:
T- the model type (ex : DOM Document)S- the scoped settings type (ex : CompositeSettings)
A
TextDocument which is associate to a model loaded in async.- Author:
- Angelo ZERR
-
Constructor Summary
ConstructorsConstructorDescriptionModelTextDocument(String text, String uri, BiFunction<TextDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, T> parse) ModelTextDocument(org.eclipse.lsp4j.TextDocumentItem document, BiFunction<TextDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, T> parse) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddispose()Dispose this document, preventing any further re-parsing and releasing all retained memory (model and text content) for garbage collection.Returns the existing parsed model synchronized with last version of the text document and null otherwise.getModel()Returns the parsed model synchronized with last version of the text document.voidsetSettings(S settings) voidvoidsetVersion(int version) voidUpdate text of the document by using the changes and according the incremental support.Methods inherited from class org.eclipse.lemminx.commons.TextDocument
getText, getText, getTextSequence, getWordRangeAt, getWordRangeAt, isDisposed, isIncremental, lineAt, lineDelimiter, lineOffsetAt, lineText, offsetAt, positionAt, setIncrementalMethods inherited from class org.eclipse.lsp4j.TextDocumentItem
equals, getLanguageId, getUri, getVersion, hashCode, setLanguageId, setUri, toString
-
Constructor Details
-
ModelTextDocument
public ModelTextDocument(org.eclipse.lsp4j.TextDocumentItem document, BiFunction<TextDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, T> parse) -
ModelTextDocument
public ModelTextDocument(String text, String uri, BiFunction<TextDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, T> parse)
-
-
Method Details
-
getExistingModel
Returns the existing parsed model synchronized with last version of the text document and null otherwise.- Returns:
- the existing parsed model synchronized with last version of the text document and null otherwise.
-
getModel
Returns the parsed model synchronized with last version of the text document.- Returns:
- the parsed model synchronized with last version of the text document.
-
setText
- Overrides:
setTextin classTextDocument
-
update
Description copied from class:TextDocumentUpdate text of the document by using the changes and according the incremental support.- Overrides:
updatein classTextDocument- Parameters:
changes- the text document changes.
-
setVersion
public void setVersion(int version) - Overrides:
setVersionin classorg.eclipse.lsp4j.TextDocumentItem
-
getSettings
-
setSettings
-
clearSettings
public void clearSettings() -
dispose
public void dispose()Dispose this document, preventing any further re-parsing and releasing all retained memory (model and text content) for garbage collection.- Overrides:
disposein classTextDocument
-