Package org.eclipse.lemminx
Class XMLTextDocumentService
java.lang.Object
org.eclipse.lemminx.AbstractTextDocumentService<DOMDocument>
org.eclipse.lemminx.XMLTextDocumentService
- All Implemented Interfaces:
org.eclipse.lsp4j.services.TextDocumentService
XML text document service.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.eclipse.lemminx.AbstractTextDocumentService
documents, xmlLanguageServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this service can handle the document with the given URI.CompletableFuture<List<org.eclipse.lsp4j.jsonrpc.messages.Either<org.eclipse.lsp4j.Command, org.eclipse.lsp4j.CodeAction>>> codeAction(org.eclipse.lsp4j.CodeActionParams params) CompletableFuture<List<? extends org.eclipse.lsp4j.CodeLens>> codeLens(org.eclipse.lsp4j.CodeLensParams params) CompletableFuture<List<org.eclipse.lsp4j.ColorPresentation>> colorPresentation(org.eclipse.lsp4j.ColorPresentationParams params) CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<org.eclipse.lsp4j.CompletionItem>, org.eclipse.lsp4j.CompletionList>> completion(org.eclipse.lsp4j.CompletionParams params) <R> CompletableFuture<R> computeDOMAsync(org.eclipse.lsp4j.TextDocumentIdentifier documentIdentifier, BiFunction<DOMDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, R> code) Compute the DOM Document for a given uri in a future and then apply the given function.<R> CompletableFuture<R> computeDOMAsyncCompose(org.eclipse.lsp4j.TextDocumentIdentifier documentIdentifier, BiFunction<DOMDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, CompletableFuture<R>> code) CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<? extends org.eclipse.lsp4j.Location>, List<? extends org.eclipse.lsp4j.LocationLink>>> definition(org.eclipse.lsp4j.DefinitionParams params) voiddidChange(org.eclipse.lsp4j.DidChangeTextDocumentParams params) This method is triggered when the user types on an XML document.voiddidClose(org.eclipse.lsp4j.DidCloseTextDocumentParams params) voiddidOpen(org.eclipse.lsp4j.DidOpenTextDocumentParams params) voiddidSave(org.eclipse.lsp4j.DidSaveTextDocumentParams params) CompletableFuture<List<org.eclipse.lsp4j.ColorInformation>> documentColor(org.eclipse.lsp4j.DocumentColorParams params) CompletableFuture<List<? extends org.eclipse.lsp4j.DocumentHighlight>> documentHighlight(org.eclipse.lsp4j.DocumentHighlightParams params) booleandocumentIsOpen(String uri) CompletableFuture<List<org.eclipse.lsp4j.DocumentLink>> documentLink(org.eclipse.lsp4j.DocumentLinkParams params) CompletableFuture<List<org.eclipse.lsp4j.jsonrpc.messages.Either<org.eclipse.lsp4j.SymbolInformation, org.eclipse.lsp4j.DocumentSymbol>>> documentSymbol(org.eclipse.lsp4j.DocumentSymbolParams params) CompletableFuture<List<org.eclipse.lsp4j.FoldingRange>> foldingRange(org.eclipse.lsp4j.FoldingRangeRequestParams params) CompletableFuture<List<? extends org.eclipse.lsp4j.TextEdit>> formatting(org.eclipse.lsp4j.DocumentFormattingParams params) getDocument(String uri) Returns the text document from the given uri.protected List<ConfigurationField> Returns the list of configuration fields that can be scoped per folder viaworkspace/configuration.CompletableFuture<org.eclipse.lsp4j.Hover> hover(org.eclipse.lsp4j.HoverParams params) CompletableFuture<List<org.eclipse.lsp4j.InlayHint>> inlayHint(org.eclipse.lsp4j.InlayHintParams params) CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<org.eclipse.lsp4j.InlineCompletionItem>, org.eclipse.lsp4j.InlineCompletionList>> inlineCompletion(org.eclipse.lsp4j.InlineCompletionParams params) booleanCompletableFuture<org.eclipse.lsp4j.LinkedEditingRanges> linkedEditingRange(org.eclipse.lsp4j.LinkedEditingRangeParams params) CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either3<org.eclipse.lsp4j.Range, org.eclipse.lsp4j.PrepareRenameResult, org.eclipse.lsp4j.PrepareRenameDefaultBehavior>> prepareRename(org.eclipse.lsp4j.PrepareRenameParams params) CompletableFuture<List<? extends org.eclipse.lsp4j.TextEdit>> rangeFormatting(org.eclipse.lsp4j.DocumentRangeFormattingParams params) CompletableFuture<List<? extends org.eclipse.lsp4j.Location>> references(org.eclipse.lsp4j.ReferenceParams params) CompletableFuture<org.eclipse.lsp4j.WorkspaceEdit> rename(org.eclipse.lsp4j.RenameParams params) CompletableFuture<org.eclipse.lsp4j.CodeAction> resolveCodeAction(org.eclipse.lsp4j.CodeAction unresolved) CompletableFuture<org.eclipse.lsp4j.CompletionItem> resolveCompletionItem(org.eclipse.lsp4j.CompletionItem unresolved) CompletableFuture<List<org.eclipse.lsp4j.SelectionRange>> selectionRange(org.eclipse.lsp4j.SelectionRangeParams params) CompletableFuture<org.eclipse.lsp4j.SemanticTokens> semanticTokensFull(org.eclipse.lsp4j.SemanticTokensParams params) voidCompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<? extends org.eclipse.lsp4j.Location>, List<? extends org.eclipse.lsp4j.LocationLink>>> typeDefinition(org.eclipse.lsp4j.TypeDefinitionParams params) voidupdateClientCapabilities(org.eclipse.lsp4j.ClientCapabilities capabilities, ExtendedClientCapabilities extendedClientCapabilities) voidupdateCodeLensSettings(XMLCodeLensSettings newSettings) voidupdateCompletionSettings(XMLCompletionSettings newCompletion) voidupdateInlayHintSettings(XMLInlayHintSettings newSettings) voidupdatePreferences(XMLPreferences newPreferences) voidupdateSemanticTokensSettings(XMLSemanticTokensSettings newSettings) voidupdateSettings(Object settings) Update settings of the language service.voidupdateSymbolSettings(XMLSymbolSettings newSettings) Methods inherited from class org.eclipse.lemminx.AbstractTextDocumentService
clearAllScopedSettings, computeModelAsync, computeModelAsyncCompose, getOrPullScopedSettings, onDidChange, onDidClose, onDidOpen, onIndexScanCompleted, publishDiagnostics, setClientConfigurationSupportMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.lsp4j.services.TextDocumentService
callHierarchyIncomingCalls, callHierarchyOutgoingCalls, declaration, diagnostic, documentLinkResolve, implementation, inlineValue, moniker, onTypeFormatting, prepareCallHierarchy, prepareTypeHierarchy, rangesFormatting, resolveCodeLens, resolveInlayHint, semanticTokensFullDelta, semanticTokensRange, signatureHelp, typeHierarchySubtypes, typeHierarchySupertypes, willSave, willSaveWaitUntil
-
Constructor Details
-
XMLTextDocumentService
-
-
Method Details
-
getScopedFields
Description copied from class:AbstractTextDocumentServiceReturns the list of configuration fields that can be scoped per folder viaworkspace/configuration. Subclasses should override to return the appropriate scoped fields for their file type.- Overrides:
getScopedFieldsin classAbstractTextDocumentService<DOMDocument>- Returns:
- the scoped fields, or
nullif scoped settings are not supported by this service.
-
canHandle
Description copied from class:AbstractTextDocumentServiceReturns whether this service can handle the document with the given URI.- Specified by:
canHandlein classAbstractTextDocumentService<DOMDocument>- Parameters:
uri- the document URI.- Returns:
- true if this service handles the file type.
-
updateClientCapabilities
public void updateClientCapabilities(org.eclipse.lsp4j.ClientCapabilities capabilities, ExtendedClientCapabilities extendedClientCapabilities) -
completion
public CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<org.eclipse.lsp4j.CompletionItem>,org.eclipse.lsp4j.CompletionList>> completion(org.eclipse.lsp4j.CompletionParams params) - Specified by:
completionin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
completionin classAbstractTextDocumentService<DOMDocument>
-
resolveCompletionItem
public CompletableFuture<org.eclipse.lsp4j.CompletionItem> resolveCompletionItem(org.eclipse.lsp4j.CompletionItem unresolved) - Specified by:
resolveCompletionItemin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
resolveCompletionItemin classAbstractTextDocumentService<DOMDocument>
-
inlineCompletion
public CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<org.eclipse.lsp4j.InlineCompletionItem>,org.eclipse.lsp4j.InlineCompletionList>> inlineCompletion(org.eclipse.lsp4j.InlineCompletionParams params) - Specified by:
inlineCompletionin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
inlineCompletionin classAbstractTextDocumentService<DOMDocument>
-
hover
- Specified by:
hoverin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
hoverin classAbstractTextDocumentService<DOMDocument>
-
documentHighlight
public CompletableFuture<List<? extends org.eclipse.lsp4j.DocumentHighlight>> documentHighlight(org.eclipse.lsp4j.DocumentHighlightParams params) - Specified by:
documentHighlightin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
documentHighlightin classAbstractTextDocumentService<DOMDocument>
-
documentSymbol
public CompletableFuture<List<org.eclipse.lsp4j.jsonrpc.messages.Either<org.eclipse.lsp4j.SymbolInformation,org.eclipse.lsp4j.DocumentSymbol>>> documentSymbol(org.eclipse.lsp4j.DocumentSymbolParams params) - Specified by:
documentSymbolin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
documentSymbolin classAbstractTextDocumentService<DOMDocument>
-
formatting
public CompletableFuture<List<? extends org.eclipse.lsp4j.TextEdit>> formatting(org.eclipse.lsp4j.DocumentFormattingParams params) - Specified by:
formattingin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
formattingin classAbstractTextDocumentService<DOMDocument>
-
rangeFormatting
public CompletableFuture<List<? extends org.eclipse.lsp4j.TextEdit>> rangeFormatting(org.eclipse.lsp4j.DocumentRangeFormattingParams params) - Specified by:
rangeFormattingin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
rangeFormattingin classAbstractTextDocumentService<DOMDocument>
-
prepareRename
public CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either3<org.eclipse.lsp4j.Range,org.eclipse.lsp4j.PrepareRenameResult, prepareRenameorg.eclipse.lsp4j.PrepareRenameDefaultBehavior>> (org.eclipse.lsp4j.PrepareRenameParams params) - Specified by:
prepareRenamein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
prepareRenamein classAbstractTextDocumentService<DOMDocument>
-
rename
public CompletableFuture<org.eclipse.lsp4j.WorkspaceEdit> rename(org.eclipse.lsp4j.RenameParams params) - Specified by:
renamein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
renamein classAbstractTextDocumentService<DOMDocument>
-
didOpen
public void didOpen(org.eclipse.lsp4j.DidOpenTextDocumentParams params) - Specified by:
didOpenin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
didOpenin classAbstractTextDocumentService<DOMDocument>
-
didChange
public void didChange(org.eclipse.lsp4j.DidChangeTextDocumentParams params) This method is triggered when the user types on an XML document.- Specified by:
didChangein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
didChangein classAbstractTextDocumentService<DOMDocument>
-
didClose
public void didClose(org.eclipse.lsp4j.DidCloseTextDocumentParams params) - Specified by:
didClosein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
didClosein classAbstractTextDocumentService<DOMDocument>
-
foldingRange
public CompletableFuture<List<org.eclipse.lsp4j.FoldingRange>> foldingRange(org.eclipse.lsp4j.FoldingRangeRequestParams params) - Specified by:
foldingRangein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
foldingRangein classAbstractTextDocumentService<DOMDocument>
-
documentLink
public CompletableFuture<List<org.eclipse.lsp4j.DocumentLink>> documentLink(org.eclipse.lsp4j.DocumentLinkParams params) - Specified by:
documentLinkin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
documentLinkin classAbstractTextDocumentService<DOMDocument>
-
definition
public CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<? extends org.eclipse.lsp4j.Location>,List<? extends org.eclipse.lsp4j.LocationLink>>> definition(org.eclipse.lsp4j.DefinitionParams params) - Specified by:
definitionin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
definitionin classAbstractTextDocumentService<DOMDocument>
-
typeDefinition
public CompletableFuture<org.eclipse.lsp4j.jsonrpc.messages.Either<List<? extends org.eclipse.lsp4j.Location>,List<? extends org.eclipse.lsp4j.LocationLink>>> typeDefinition(org.eclipse.lsp4j.TypeDefinitionParams params) - Specified by:
typeDefinitionin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
typeDefinitionin classAbstractTextDocumentService<DOMDocument>
-
references
public CompletableFuture<List<? extends org.eclipse.lsp4j.Location>> references(org.eclipse.lsp4j.ReferenceParams params) - Specified by:
referencesin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
referencesin classAbstractTextDocumentService<DOMDocument>
-
codeLens
public CompletableFuture<List<? extends org.eclipse.lsp4j.CodeLens>> codeLens(org.eclipse.lsp4j.CodeLensParams params) - Specified by:
codeLensin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
codeLensin classAbstractTextDocumentService<DOMDocument>
-
inlayHint
public CompletableFuture<List<org.eclipse.lsp4j.InlayHint>> inlayHint(org.eclipse.lsp4j.InlayHintParams params) - Specified by:
inlayHintin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
inlayHintin classAbstractTextDocumentService<DOMDocument>
-
codeAction
public CompletableFuture<List<org.eclipse.lsp4j.jsonrpc.messages.Either<org.eclipse.lsp4j.Command,org.eclipse.lsp4j.CodeAction>>> codeAction(org.eclipse.lsp4j.CodeActionParams params) - Specified by:
codeActionin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
codeActionin classAbstractTextDocumentService<DOMDocument>
-
resolveCodeAction
public CompletableFuture<org.eclipse.lsp4j.CodeAction> resolveCodeAction(org.eclipse.lsp4j.CodeAction unresolved) - Specified by:
resolveCodeActionin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
resolveCodeActionin classAbstractTextDocumentService<DOMDocument>
-
selectionRange
public CompletableFuture<List<org.eclipse.lsp4j.SelectionRange>> selectionRange(org.eclipse.lsp4j.SelectionRangeParams params) - Specified by:
selectionRangein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
selectionRangein classAbstractTextDocumentService<DOMDocument>
-
linkedEditingRange
public CompletableFuture<org.eclipse.lsp4j.LinkedEditingRanges> linkedEditingRange(org.eclipse.lsp4j.LinkedEditingRangeParams params) - Specified by:
linkedEditingRangein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
linkedEditingRangein classAbstractTextDocumentService<DOMDocument>
-
documentColor
public CompletableFuture<List<org.eclipse.lsp4j.ColorInformation>> documentColor(org.eclipse.lsp4j.DocumentColorParams params) - Specified by:
documentColorin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
documentColorin classAbstractTextDocumentService<DOMDocument>
-
semanticTokensFull
public CompletableFuture<org.eclipse.lsp4j.SemanticTokens> semanticTokensFull(org.eclipse.lsp4j.SemanticTokensParams params) - Specified by:
semanticTokensFullin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
semanticTokensFullin classAbstractTextDocumentService<DOMDocument>
-
colorPresentation
public CompletableFuture<List<org.eclipse.lsp4j.ColorPresentation>> colorPresentation(org.eclipse.lsp4j.ColorPresentationParams params) - Specified by:
colorPresentationin interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
colorPresentationin classAbstractTextDocumentService<DOMDocument>
-
didSave
public void didSave(org.eclipse.lsp4j.DidSaveTextDocumentParams params) - Specified by:
didSavein interfaceorg.eclipse.lsp4j.services.TextDocumentService- Overrides:
didSavein classAbstractTextDocumentService<DOMDocument>
-
updateSettings
Update settings of the language service.- Overrides:
updateSettingsin classAbstractTextDocumentService<DOMDocument>- Parameters:
settings-
-
updateCompletionSettings
-
updateSymbolSettings
-
updateCodeLensSettings
-
updateInlayHintSettings
-
updateSemanticTokensSettings
-
updatePreferences
-
setInitialized
public void setInitialized() -
isIncrementalSupport
public boolean isIncrementalSupport()- Overrides:
isIncrementalSupportin classAbstractTextDocumentService<DOMDocument>
-
getValidationSettings
-
getPreferences
-
getDocument
Returns the text document from the given uri.- Overrides:
getDocumentin classAbstractTextDocumentService<DOMDocument>- Parameters:
uri- the uri- Returns:
- the text document from the given uri.
-
allDocuments
- Overrides:
allDocumentsin classAbstractTextDocumentService<DOMDocument>
-
documentIsOpen
- Overrides:
documentIsOpenin classAbstractTextDocumentService<DOMDocument>
-
computeDOMAsync
public <R> CompletableFuture<R> computeDOMAsync(org.eclipse.lsp4j.TextDocumentIdentifier documentIdentifier, BiFunction<DOMDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, R> code) Compute the DOM Document for a given uri in a future and then apply the given function.- Type Parameters:
R-- Parameters:
documentIdentifier- the document indetifier.code- a bi function that accepts aCancelCheckerand parsedDOMDocumentand returns the to be computed value- Returns:
- the DOM Document for a given uri in a future and then apply the given function.
-
computeDOMAsyncCompose
public <R> CompletableFuture<R> computeDOMAsyncCompose(org.eclipse.lsp4j.TextDocumentIdentifier documentIdentifier, BiFunction<DOMDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker, CompletableFuture<R>> code) -
getLimitExceededWarner
-