blob: 5da70ae64d6f34692aa1e5af9fca2d4b5f48e912 [file] [log] [blame] [edit]
/******************************************************************************
* Copyright (c) 2016-2018 TypeFox and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
******************************************************************************/
package org.eclipse.lsp4j
import com.google.common.annotations.Beta
import com.google.gson.annotations.JsonAdapter
import java.util.ArrayList
import java.util.Arrays
import java.util.LinkedHashMap
import java.util.List
import java.util.Map
import org.eclipse.lsp4j.adapters.CompletionItemTextEditTypeAdapter
import org.eclipse.lsp4j.adapters.DocumentChangeListAdapter
import org.eclipse.lsp4j.adapters.HoverTypeAdapter
import org.eclipse.lsp4j.adapters.InitializeParamsTypeAdapter
import org.eclipse.lsp4j.adapters.ProgressNotificationAdapter
import org.eclipse.lsp4j.adapters.ResourceChangeListAdapter
import org.eclipse.lsp4j.adapters.ResourceOperationTypeAdapter
import org.eclipse.lsp4j.adapters.SymbolInformationTypeAdapter
import org.eclipse.lsp4j.adapters.VersionedTextDocumentIdentifierTypeAdapter
import org.eclipse.lsp4j.generator.JsonRpcData
import org.eclipse.lsp4j.jsonrpc.json.adapters.JsonElementTypeAdapter
import org.eclipse.lsp4j.jsonrpc.messages.Either
import org.eclipse.lsp4j.jsonrpc.messages.Either3
import org.eclipse.lsp4j.jsonrpc.messages.Tuple
import org.eclipse.lsp4j.jsonrpc.validation.NonNull
import org.eclipse.lsp4j.util.Preconditions
@JsonRpcData
class DynamicRegistrationCapabilities {
/**
* Supports dynamic registration.
*/
Boolean dynamicRegistration
new() {
}
new(Boolean dynamicRegistration) {
this.dynamicRegistration = dynamicRegistration
}
}
/**
* Capabilities specific to {@link WorkspaceEdit}s
*/
@JsonRpcData
class WorkspaceEditCapabilities {
/**
* The client supports versioned document changes in {@link WorkspaceEdit}s
*/
Boolean documentChanges
/**
* The client supports resource changes
* in {@link WorkspaceEdit}s.
*
* @deprecated Since LSP introduced resource operations, use {@link #resourceOperations}
*/
@Deprecated
@Beta
Boolean resourceChanges
/**
* The resource operations the client supports. Clients should at least
* support 'create', 'rename' and 'delete' files and folders.
* <p>
* See {@link ResourceOperationKind} for allowed values.
* <p>
* Since 3.13.0
*/
List<String> resourceOperations
/**
* The failure handling strategy of a client if applying the workspace edit
* fails.
* <p>
* See {@link FailureHandlingKind} for allowed values.
* <p>
* Since 3.13.0
*/
String failureHandling
/**
* Whether the client normalizes line endings to the client specific
* setting.
* <p>
* If set to {@code true} the client will normalize line ending characters
* in a workspace edit to the client specific new line character(s).
* <p>
* Since 3.16.0
*/
Boolean normalizesLineEndings
/**
* Whether the client in general supports change annotations on text edits,
* create file, rename file and delete file changes.
* <p>
* Since 3.16.0
*/
WorkspaceEditChangeAnnotationSupportCapabilities changeAnnotationSupport
new() {
}
@Deprecated
new(Boolean documentChanges) {
this.documentChanges = documentChanges
}
}
/**
* Capabilities specific to the `workspace/didChangeConfiguration` notification.
*/
@JsonRpcData
class DidChangeConfigurationCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
*/
@JsonRpcData
class DidChangeWatchedFilesCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `workspace/symbol` request.
* Referred to in the spec as WorkspaceSymbolClientCapabilities.
*/
@JsonRpcData
class SymbolCapabilities extends DynamicRegistrationCapabilities {
/**
* Specific capabilities for the {@link SymbolKind} in the `workspace/symbol` request.
*/
SymbolKindCapabilities symbolKind
/**
* The client supports tags on {@link SymbolInformation}.
* Clients supporting tags have to handle unknown tags gracefully.
* <p>
* Since 3.16.0
*/
SymbolTagSupportCapabilities tagSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(SymbolKindCapabilities symbolKind) {
this.symbolKind = symbolKind
}
new(SymbolKindCapabilities symbolKind, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.symbolKind = symbolKind
}
}
/**
* Capabilities specific to the `workspace/executeCommand` request.
*/
@JsonRpcData
class ExecuteCommandCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Workspace specific client capabilities.
*/
@JsonRpcData
class WorkspaceClientCapabilities {
/**
* The client supports applying batch edits to the workspace by supporting
* the request 'workspace/applyEdit'.
*/
Boolean applyEdit
/**
* Capabilities specific to {@link WorkspaceEdit}s
*/
WorkspaceEditCapabilities workspaceEdit
/**
* Capabilities specific to the `workspace/didChangeConfiguration` notification.
*/
DidChangeConfigurationCapabilities didChangeConfiguration
/**
* Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
*/
DidChangeWatchedFilesCapabilities didChangeWatchedFiles
/**
* Capabilities specific to the `workspace/symbol` request.
*/
SymbolCapabilities symbol
/**
* Capabilities specific to the `workspace/executeCommand` request.
*/
ExecuteCommandCapabilities executeCommand
/**
* The client has support for workspace folders.
* <p>
* Since 3.6.0
*/
Boolean workspaceFolders
/**
* The client supports `workspace/configuration` requests.
* <p>
* Since 3.6.0
*/
Boolean configuration
/**
* Capabilities specific to the semantic token requests scoped to the
* workspace.
* <p>
* Since 3.16.0
*/
SemanticTokensWorkspaceCapabilities semanticTokens
/**
* Capabilities specific to the code lens requests scoped to the
* workspace.
* <p>
* Since 3.16.0
*/
CodeLensWorkspaceCapabilities codeLens
/**
* The client has support for file requests/notifications.
* <p>
* Since 3.16.0
*/
FileOperationsWorkspaceCapabilities fileOperations
}
@JsonRpcData
class SynchronizationCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports sending will save notifications.
*/
Boolean willSave
/**
* The client supports sending a will save request and
* waits for a response providing text edits which will
* be applied to the document before it is saved.
*/
Boolean willSaveWaitUntil
/**
* The client supports did save notifications.
*/
Boolean didSave
new() {
}
new(Boolean willSave, Boolean willSaveWaitUntil, Boolean didSave) {
this.willSave = willSave
this.willSaveWaitUntil = willSaveWaitUntil
this.didSave = didSave
}
new(Boolean willSave, Boolean willSaveWaitUntil, Boolean didSave, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.willSave = willSave
this.willSaveWaitUntil = willSaveWaitUntil
this.didSave = didSave
}
}
/**
* The client supports the following {@link CompletionItem} specific capabilities.
*/
@JsonRpcData
class CompletionItemCapabilities {
/**
* Client supports snippets as insert text.
* <p>
* A snippet can define tab stops and placeholders with `$1`, `$2`
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
* the end of the snippet. Placeholders with equal identifiers are linked,
* that is typing in one will update others too.
*/
Boolean snippetSupport
/**
* Client supports commit characters on a completion item.
*/
Boolean commitCharactersSupport
/**
* Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
*/
List<String> documentationFormat
/**
* Client supports the deprecated property on a completion item.
*/
Boolean deprecatedSupport
/**
* Client supports the preselect property on a completion item.
*/
Boolean preselectSupport
/**
* Client supports the tag property on a completion item. Clients supporting
* tags have to handle unknown tags gracefully. Clients especially need to
* preserve unknown tags when sending a completion item back to the server in
* a resolve call.
* <p>
* Since 3.15.0
*/
CompletionItemTagSupportCapabilities tagSupport
/**
* Client support insert replace edit to control different behavior if a
* completion item is inserted in the text or should replace text.
* <p>
* Since 3.16.0
*/
Boolean insertReplaceSupport
/**
* Indicates which properties a client can resolve lazily on a completion
* item. Before version 3.16.0 only the predefined properties {@link CompletionItem#documentation}
* and {@link CompletionItem#detail} could be resolved lazily.
* <p>
* Since 3.16.0
*/
CompletionItemResolveSupportCapabilities resolveSupport
/**
* The client supports the {@link CompletionItem#insertTextMode} property on
* a completion item to override the whitespace handling mode
* as defined by the client.
* <p>
* Since 3.16.0
*/
CompletionItemInsertTextModeSupportCapabilities insertTextModeSupport
new() {
}
new(Boolean snippetSupport) {
this.snippetSupport = snippetSupport
}
}
/**
* Client supports the tag property on a completion item. Clients supporting
* tags have to handle unknown tags gracefully. Clients especially need to
* preserve unknown tags when sending a completion item back to the server in
* a resolve call.
* <p>
* Since 3.15.0
*/
@JsonRpcData
class CompletionItemTagSupportCapabilities {
/**
* The tags supported by the client.
*/
@NonNull
List<CompletionItemTag> valueSet
new() {
this.valueSet = new ArrayList
}
new(@NonNull List<CompletionItemTag> valueSet) {
this.valueSet = Preconditions.checkNotNull(valueSet, 'valueSet')
}
}
/**
* Indicates which properties a client can resolve lazily on a completion
* item. Before version 3.16.0 only the predefined properties {@link CompletionItem#documentation}
* and {@link CompletionItem#detail} could be resolved lazily.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class CompletionItemResolveSupportCapabilities {
/**
* The properties that a client can resolve lazily.
*/
@NonNull
List<String> properties
new() {
this.properties = new ArrayList
}
new(@NonNull List<String> properties) {
this.properties = Preconditions.checkNotNull(properties, 'properties')
}
}
/**
* The client supports the {@link CompletionItem#insertTextMode} property on
* a completion item to override the whitespace handling mode
* as defined by the client.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class CompletionItemInsertTextModeSupportCapabilities {
@NonNull
List<InsertTextMode> valueSet
new() {
this.valueSet = new ArrayList
}
new(@NonNull List<InsertTextMode> valueSet) {
this.valueSet = Preconditions.checkNotNull(valueSet, 'valueSet')
}
}
/**
* The client supports the following {@link CompletionItemKind} specific
* capabilities.
*/
@JsonRpcData
class CompletionItemKindCapabilities {
/**
* The completion item kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
* <p>
* If this property is not present the client only supports
* the completion items kinds from {@link CompletionItemKind#Text} to
* {@link CompletionItemKind#Reference} as defined in the initial version of the protocol.
*/
List<CompletionItemKind> valueSet
new() {
}
new(List<CompletionItemKind> valueSet) {
this.valueSet = valueSet
}
}
/**
* Capabilities specific to the `textDocument/completion`
*/
@JsonRpcData
class CompletionCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports the following {@link CompletionItem} specific
* capabilities.
*/
CompletionItemCapabilities completionItem
/**
* The client supports the following {@link CompletionItemKind} specific
* capabilities.
*/
CompletionItemKindCapabilities completionItemKind
/**
* The client supports sending additional context information for a
* `textDocument/completion` request.
*/
Boolean contextSupport
new() {
}
new(CompletionItemCapabilities completionItem) {
this.completionItem = completionItem
}
new(CompletionItemKindCapabilities completionItemKind) {
this.completionItemKind = completionItemKind
}
new(Boolean contextSupport) {
this.contextSupport = contextSupport
}
}
/**
* Capabilities specific to the `textDocument/hover`
*/
@JsonRpcData
class HoverCapabilities extends DynamicRegistrationCapabilities {
/**
* Client supports the following content formats if the content
* property refers to {@link MarkupContent}.
* The order describes the preferred format of the client.
* <p>
* See {@link MarkupKind} for allowed values.
*/
List<String> contentFormat
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(List<String> contentFormat, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.contentFormat = contentFormat
}
}
/**
* The client supports the following {@link SignatureInformation} specific properties.
*/
@JsonRpcData
class SignatureInformationCapabilities {
/**
* Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
* <p>
* See {@link MarkupKind} for allowed values.
*/
List<String> documentationFormat
/**
* Client capabilities specific to parameter information.
*/
ParameterInformationCapabilities parameterInformation
/**
* The client supports the {@link SignatureInformation#activeParameter} property.
* <p>
* Since 3.16.0
*/
Boolean activeParameterSupport
new() {
}
new(List<String> documentationFormat) {
this.documentationFormat = documentationFormat
}
}
/**
* Client capabilities specific to parameter information.
*/
@JsonRpcData
class ParameterInformationCapabilities {
/**
* The client supports processing label offsets instead of a
* simple label string.
* <p>
* Since 3.14.0
*/
Boolean labelOffsetSupport
new() {
}
new(Boolean labelOffsetSupport) {
this.labelOffsetSupport = labelOffsetSupport
}
}
/**
* Capabilities specific to the `textDocument/signatureHelp`
*/
@JsonRpcData
class SignatureHelpCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports the following {@link SignatureInformation}
* specific properties.
*/
SignatureInformationCapabilities signatureInformation
/**
* The client supports to send additional context information for a
* `textDocument/signatureHelp` request. A client that opts into
* contextSupport will also support {@link SignatureHelpOptions#retriggerCharacters}.
* <p>
* Since 3.15.0
*/
Boolean contextSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(SignatureInformationCapabilities signatureInformation, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.signatureInformation = signatureInformation
}
}
/**
* Capabilities specific to the `textDocument/references`
*/
@JsonRpcData
class ReferencesCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `textDocument/documentHighlight`
*/
@JsonRpcData
class DocumentHighlightCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Specific capabilities for the {@link SymbolKind}.
*/
@JsonRpcData
class SymbolKindCapabilities {
/**
* The symbol kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
* <p>
* If this property is not present the client only supports
* the symbol kinds from {@link SymbolKind#File} to
* {@link SymbolKind#Array} as defined in the initial version of the protocol.
*/
List<SymbolKind> valueSet
new() {
}
new(List<SymbolKind> valueSet) {
this.valueSet = valueSet
}
}
/**
* Specific capabilities for the {@link SymbolTag}.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class SymbolTagSupportCapabilities {
/**
* The tags supported by the client.
*/
@NonNull
List<SymbolTag> valueSet
new() {
this.valueSet = new ArrayList
}
new(@NonNull List<SymbolTag> valueSet) {
this.valueSet = Preconditions.checkNotNull(valueSet, 'valueSet')
}
}
/**
* Capabilities specific to the `textDocument/documentSymbol`
*/
@JsonRpcData
class DocumentSymbolCapabilities extends DynamicRegistrationCapabilities {
/**
* Specific capabilities for the {@link SymbolKind}.
*/
SymbolKindCapabilities symbolKind
/**
* The client support hierarchical document symbols.
*/
Boolean hierarchicalDocumentSymbolSupport
/**
* The client supports tags on {@link SymbolInformation}. Tags are supported on
* {@link DocumentSymbol} if {@link #hierarchicalDocumentSymbolSupport} is set to true.
* Clients supporting tags have to handle unknown tags gracefully.
* <p>
* Since 3.16.0
*/
SymbolTagSupportCapabilities tagSupport
/**
* The client supports an additional label presented in the UI when
* registering a document symbol provider.
* <p>
* Since 3.16.0
*/
Boolean labelSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(SymbolKindCapabilities symbolKind) {
this.symbolKind = symbolKind
}
new(SymbolKindCapabilities symbolKind, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.symbolKind = symbolKind
}
new(SymbolKindCapabilities symbolKind, Boolean dynamicRegistration, Boolean hierarchicalDocumentSymbolSupport) {
super(dynamicRegistration)
this.symbolKind = symbolKind
this.hierarchicalDocumentSymbolSupport = hierarchicalDocumentSymbolSupport
}
}
/**
* Capabilities specific to the `textDocument/formatting`
*/
@JsonRpcData
class FormattingCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `textDocument/rangeFormatting`
*/
@JsonRpcData
class RangeFormattingCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `textDocument/onTypeFormatting`
*/
@JsonRpcData
class OnTypeFormattingCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `textDocument/definition`
* <p>
* Since 3.14.0
*/
@JsonRpcData
class DefinitionCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports additional metadata in the form of definition links.
*/
Boolean linkSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(Boolean dynamicRegistration, Boolean linkSupport) {
super(dynamicRegistration)
this.linkSupport = linkSupport
}
}
/**
* Capabilities specific to the `textDocument/declaration`
* <p>
* Since 3.14.0
*/
@JsonRpcData
class DeclarationCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports additional metadata in the form of declaration links.
*/
Boolean linkSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(Boolean dynamicRegistration, Boolean linkSupport) {
super(dynamicRegistration)
this.linkSupport = linkSupport
}
}
/**
* Capabilities specific to the `textDocument/typeDefinition`
* <p>
* Since 3.6.0
*/
@JsonRpcData
class TypeDefinitionCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports additional metadata in the form of definition links.
* <p>
* Since 3.14.0
*/
Boolean linkSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(Boolean dynamicRegistration, Boolean linkSupport) {
super(dynamicRegistration)
this.linkSupport = linkSupport
}
}
/**
* Capabilities specific to the `textDocument/implementation`.
* <p>
* Since 3.6.0
*/
@JsonRpcData
class ImplementationCapabilities extends DynamicRegistrationCapabilities {
/**
* The client supports additional metadata in the form of definition links.
* <p>
* Since 3.14.0
*/
Boolean linkSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(Boolean dynamicRegistration, Boolean linkSupport) {
super(dynamicRegistration)
this.linkSupport = linkSupport
}
}
@JsonRpcData
class CodeActionKindCapabilities {
/**
* The code action kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
* <p>
* See {@link CodeActionKind} for allowed values.
*/
@NonNull
List<String> valueSet
new() {
this.valueSet = new ArrayList
}
new(@NonNull List<String> valueSet) {
this.valueSet = Preconditions.checkNotNull(valueSet, 'valueSet')
}
}
@JsonRpcData
class CodeActionLiteralSupportCapabilities {
/**
* The code action kind is support with the following value
* set.
*/
CodeActionKindCapabilities codeActionKind
new() {
}
new(CodeActionKindCapabilities codeActionKind) {
this.codeActionKind = codeActionKind
}
}
/**
* Whether the client supports resolving additional code action
* properties via a separate `codeAction/resolve` request.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class CodeActionResolveSupportCapabilities {
/**
* The properties that a client can resolve lazily.
*/
@NonNull
List<String> properties
new() {
this.properties = new ArrayList
}
new(@NonNull List<String> properties) {
this.properties = Preconditions.checkNotNull(properties, 'properties')
}
}
/**
* Capabilities specific to the `textDocument/codeAction`
*/
@JsonRpcData
class CodeActionCapabilities extends DynamicRegistrationCapabilities {
/**
* The client support code action literals as a valid
* response of the `textDocument/codeAction` request.
*/
CodeActionLiteralSupportCapabilities codeActionLiteralSupport
/**
* Whether code action supports the {@link CodeAction#isPreferred} property.
* <p>
* Since 3.15.0
*/
Boolean isPreferredSupport
/**
* Whether code action supports the {@link CodeAction#disabled} property.
* <p>
* Since 3.16.0
*/
Boolean disabledSupport
/**
* Whether code action supports the {@link CodeAction#data} property which is
* preserved between a `textDocument/codeAction` and a
* `codeAction/resolve` request.
* <p>
* Since 3.16.0
*/
Boolean dataSupport
/**
* Whether the client supports resolving additional code action
* properties via a separate `codeAction/resolve` request.
* <p>
* Since 3.16.0
*/
CodeActionResolveSupportCapabilities resolveSupport
/**
* Whether the client honors the change annotations in
* text edits and resource operations returned via the
* {@link CodeAction#edit} property by for example presenting
* the workspace edit in the user interface and asking
* for confirmation.
* <p>
* Since 3.16.0
*/
Boolean honorsChangeAnnotations
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(CodeActionLiteralSupportCapabilities codeActionLiteralSupport, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.codeActionLiteralSupport = codeActionLiteralSupport
}
new(CodeActionLiteralSupportCapabilities codeActionLiteralSupport, Boolean dynamicRegistration, Boolean isPreferredSupport) {
this(codeActionLiteralSupport, dynamicRegistration)
this.isPreferredSupport = isPreferredSupport
}
}
/**
* Capabilities specific to the `textDocument/codeLens`
*/
@JsonRpcData
class CodeLensCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the code lens requests scoped to the
* workspace.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class CodeLensWorkspaceCapabilities {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
* <p>
* Note that this event is global and will force the client to refresh all
* code lenses currently shown. It should be used with absolute care and is
* useful for situations where a server for example detects a project-wide
* change that requires such a calculation.
*/
Boolean refreshSupport
new() {
}
new(Boolean refreshSupport) {
this.refreshSupport = refreshSupport
}
}
/**
* The client has support for file requests/notifications.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class FileOperationsWorkspaceCapabilities extends DynamicRegistrationCapabilities {
/**
* The client has support for sending didCreateFiles notifications.
*/
Boolean didCreate
/**
* The client has support for sending willCreateFiles requests.
*/
Boolean willCreate
/**
* The client has support for sending didRenameFiles notifications.
*/
Boolean didRename
/**
* The client has support for sending willRenameFiles requests.
*/
Boolean willRename
/**
* The client has support for sending didDeleteFiles notifications.
*/
Boolean didDelete
/**
* The client has support for sending willDeleteFiles requests.
*/
Boolean willDelete
new() {
}
}
/**
* Capabilities specific to the `textDocument/documentLink`
*/
@JsonRpcData
class DocumentLinkCapabilities extends DynamicRegistrationCapabilities {
/**
* Whether the client supports the {@link DocumentLink#tooltip} property.
* <p>
* Since 3.15.0
*/
Boolean tooltipSupport
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(Boolean dynamicRegistration, Boolean tooltipSupport) {
super(dynamicRegistration)
this.tooltipSupport = tooltipSupport
}
}
/**
* Capabilities specific to the `textDocument/documentColor` and the
* `textDocument/colorPresentation` request.
* <p>
* Since 3.6.0
*/
@JsonRpcData
class ColorProviderCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the `textDocument/rename`
*/
@JsonRpcData
class RenameCapabilities extends DynamicRegistrationCapabilities {
/**
* Client supports testing for validity of rename operations
* before execution.
* <p>
* Since 3.12.0
*/
Boolean prepareSupport
/**
* Client supports the default behavior result ({@code &#123; defaultBehavior: boolean &#125;}).
* <p>
* The value indicates the default behavior used by the client.
* <p>
* Since 3.16.0
*/
PrepareSupportDefaultBehavior prepareSupportDefaultBehavior
/**
* Whether the client honors the change annotations in
* text edits and resource operations returned via the
* rename request's workspace edit by for example presenting
* the workspace edit in the user interface and asking
* for confirmation.
* <p>
* Since 3.16.0
*/
Boolean honorsChangeAnnotations
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(Boolean prepareSupport, Boolean dynamicRegistration) {
super(dynamicRegistration)
this.prepareSupport = prepareSupport
}
}
/**
* Capabilities specific to `textDocument/publishDiagnostics`.
*/
@JsonRpcData
class PublishDiagnosticsCapabilities {
/**
* Whether the client accepts diagnostics with related information.
*/
Boolean relatedInformation
/**
* Client supports the tag property to provide meta data about a diagnostic.
* Clients supporting tags have to handle unknown tags gracefully.
* <p>
* This property had been added and implemented as boolean before it was
* added to the specification as {@link DiagnosticsTagSupport}. In order to
* keep this implementation compatible with intermediate clients (including
* vscode-language-client &lt; 6.0.0) we add an either type here.
* <p>
* Since 3.15
*/
Either<Boolean, DiagnosticsTagSupport> tagSupport
/**
* Whether the client interprets the version property of the
* `textDocument/publishDiagnostics` notification's parameter.
* <p>
* Since 3.15.0
*/
Boolean versionSupport
/**
* Client supports a codeDescription property
* <p>
* Since 3.16.0
*/
Boolean codeDescriptionSupport
/**
* Whether code action supports the {@link Diagnostic#data} property which is
* preserved between a `textDocument/publishDiagnostics` and
* `textDocument/codeAction` request.
* <p>
* Since 3.16.0
*/
Boolean dataSupport
new() {
}
new(Boolean relatedInformation) {
this.relatedInformation = relatedInformation
}
new(Boolean relatedInformation, DiagnosticsTagSupport tagSupport) {
this(relatedInformation)
this.tagSupport = tagSupport
}
new(Boolean relatedInformation, DiagnosticsTagSupport tagSupport, Boolean versionSupport) {
this(relatedInformation, tagSupport)
this.versionSupport = versionSupport
}
}
@JsonRpcData
class DiagnosticsTagSupport {
/**
* The tags supported by the client.
*/
@NonNull
List<DiagnosticTag> valueSet
new() {
this.valueSet = new ArrayList
}
new(@NonNull List<DiagnosticTag> valueSet) {
this.valueSet = Preconditions.checkNotNull(valueSet, 'valueSet')
}
}
/**
* Capabilities specific to `textDocument/foldingRange` requests.
* <p>
* Since 3.10.0
*/
@JsonRpcData
class FoldingRangeCapabilities extends DynamicRegistrationCapabilities {
/**
* The maximum number of folding ranges that the client prefers to receive per document. The value serves as a
* hint, servers are free to follow the limit.
*/
Integer rangeLimit
/**
* If set, the client signals that it only supports folding complete lines. If set, client will
* ignore specified {@link FoldingRange#startCharacter} and {@link FoldingRange#endCharacter} properties.
*/
Boolean lineFoldingOnly
}
/**
* Capabilities specific to the {@code textDocument/typeHierarchy}.
* <p>
* <b>Note:</b> the <a href=
* "https://github.com/Microsoft/vscode-languageserver-node/pull/426">{@code textDocument/typeHierarchy}
* language feature</a> is not yet part of the official LSP specification.
*/
@Beta
@JsonRpcData
class TypeHierarchyCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Capabilities specific to the {@code textDocument/prepareCallHierarchy}.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class CallHierarchyCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Since 3.16.0
*/
@JsonRpcData
class CallHierarchyOptions extends AbstractWorkDoneProgressOptions {
}
/**
* Since 3.16.0
*/
@JsonRpcData
class CallHierarchyRegistrationOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
/**
* The id used to register the request. The id can be used to deregister
* the request again. See also Registration#id.
*/
String id
new() {
}
new(String id) {
this.id = id
}
}
/**
* Capabilities specific to `textDocument/selectionRange` requests
* <p>
* Since 3.15.0
*/
@JsonRpcData
class SelectionRangeCapabilities extends DynamicRegistrationCapabilities {
new() {
}
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
}
/**
* Since 3.16.0
*/
@JsonRpcData
class SemanticTokensClientCapabilitiesRequestsFull {
/**
* The client will send the `textDocument/semanticTokens/full/delta` request if
* the server provides a corresponding handler.
*/
Boolean delta
new() {
}
new(Boolean delta) {
this.delta = delta
}
}
/**
* Since 3.16.0
*/
@JsonRpcData
class SemanticTokensClientCapabilitiesRequests {
/**
* The client will send the `textDocument/semanticTokens/range` request if
* the server provides a corresponding handler.
*/
Either<Boolean, Object> range
/**
* The client will send the `textDocument/semanticTokens/full` request if
* the server provides a corresponding handler.
*/
Either<Boolean, SemanticTokensClientCapabilitiesRequestsFull> full
new() {
}
new(Boolean full) {
this.full = full
}
new(SemanticTokensClientCapabilitiesRequestsFull full) {
this.full = full
}
new(Boolean full, Boolean range) {
this.full = full
this.range = range
}
new(SemanticTokensClientCapabilitiesRequestsFull full, Boolean range) {
this.full = full
this.range = range
}
}
/**
* Since 3.16.0
*/
@JsonRpcData
class SemanticTokensCapabilities extends DynamicRegistrationCapabilities {
/**
* Which requests the client supports and might send to the server.
*/
@NonNull
SemanticTokensClientCapabilitiesRequests requests
/**
* The token types that the client supports.
*/
@NonNull
List<String> tokenTypes
/**
* The token modifiers that the client supports.
*/
@NonNull
List<String> tokenModifiers
/**
* The formats the client supports.
* <p>
* See {@link TokenFormat} for allowed values.
*/
@NonNull
List<String> formats
/**
* Whether the client supports tokens that can overlap each other.
* <p>
* Since 3.16.0
*/
Boolean overlappingTokenSupport
/**
* Whether the client supports tokens that can span multiple lines.
* <p>
* Since 3.16.0
*/
Boolean multilineTokenSupport
new(Boolean dynamicRegistration) {
super(dynamicRegistration)
}
new(@NonNull SemanticTokensClientCapabilitiesRequests requests, @NonNull List<String> tokenTypes, @NonNull List<String> tokenModifiers, @NonNull List<String> formats) {
this.requests = Preconditions.checkNotNull(requests, 'requests')
this.tokenTypes = Preconditions.checkNotNull(tokenTypes, 'tokenTypes')
this.tokenModifiers = Preconditions.checkNotNull(tokenModifiers, 'tokenModifiers')
this.formats = Preconditions.checkNotNull(formats, 'formats')
}
new(Boolean dynamicRegistration, @NonNull SemanticTokensClientCapabilitiesRequests requests, @NonNull List<String> tokenTypes, @NonNull List<String> tokenModifiers, @NonNull List<String> formats) {
super(dynamicRegistration)
this.requests = Preconditions.checkNotNull(requests, 'requests')
this.tokenTypes = Preconditions.checkNotNull(tokenTypes, 'tokenTypes')
this.tokenModifiers = Preconditions.checkNotNull(tokenModifiers, 'tokenModifiers')
this.formats = Preconditions.checkNotNull(formats, 'formats')
}
}
/**
* Capabilities specific to the {@code textDocument/linkedEditingRange} request.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class LinkedEditingRangeCapabilities extends DynamicRegistrationCapabilities {
}
/**
* Capabilities specific to the semantic token requests scoped to the
* workspace.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class SemanticTokensWorkspaceCapabilities {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
* <p>
* Note that this event is global and will force the client to refresh all
* semantic tokens currently shown. It should be used with absolute care and is
* useful for situations where a server for example detects a project-wide
* change that requires such a calculation.
*/
Boolean refreshSupport
new() {
}
new(Boolean refreshSupport) {
this.refreshSupport = refreshSupport
}
}
/**
* Capabilities specific to the {@code textDocument/moniker} request.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class MonikerCapabilities extends DynamicRegistrationCapabilities {
}
/**
* Show message request client capabilities
* <p>
* Since 3.16.0
*/
@JsonRpcData
class WindowShowMessageRequestCapabilities {
/**
* Capabilities specific to the {@link MessageActionItem} type.
*/
WindowShowMessageRequestActionItemCapabilities messageActionItem
new() {
}
}
/**
* Client capabilities for the show document request.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class ShowDocumentCapabilities {
/**
* The client has support for the show document
* request.
*/
boolean support
new() {
}
new(boolean support) {
this.support = support
}
}
/**
* Capabilities specific to the {@link MessageActionItem} type of show message request.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class WindowShowMessageRequestActionItemCapabilities {
/**
* Whether the client supports additional attributes which
* are preserved and sent back to the server in the
* request's response.
*/
Boolean additionalPropertiesSupport
new() {
}
new(Boolean additionalPropertiesSupport) {
this.additionalPropertiesSupport = additionalPropertiesSupport
}
}
/**
* Client capabilities specific to regular expressions.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class RegularExpressionsCapabilities {
/**
* The engine's name.
*/
@NonNull
String engine
/**
* The engine's version.
*/
String version
new() {
}
new(@NonNull String engine) {
this.engine = Preconditions.checkNotNull(engine, 'engine')
}
new(@NonNull String engine, String version) {
this(engine)
this.version = version
}
}
/**
* Client capabilities specific to the used markdown parser.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class MarkdownCapabilities {
/**
* The name of the parser.
*/
@NonNull
String parser
/**
* The version of the parser.
*/
String version
new() {
}
new(@NonNull String parser) {
this.parser = Preconditions.checkNotNull(parser, 'parser')
}
new(@NonNull String parser, String version) {
this(parser)
this.version = version
}
}
/**
* Whether the client in general supports change annotations on text edits,
* create file, rename file and delete file changes.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class WorkspaceEditChangeAnnotationSupportCapabilities {
/**
* Whether the client groups edits with equal labels into tree nodes,
* for instance all edits labelled with "Changes in Strings" would
* be a tree node.
*/
Boolean groupsOnLabel
new() {
}
new(Boolean groupsOnLabel) {
this.groupsOnLabel = groupsOnLabel
}
}
/**
* Text document specific client capabilities.
*/
@JsonRpcData
class TextDocumentClientCapabilities {
SynchronizationCapabilities synchronization
/**
* Capabilities specific to the {@code textDocument/completion}
*/
CompletionCapabilities completion
/**
* Capabilities specific to the {@code textDocument/hover}
*/
HoverCapabilities hover
/**
* Capabilities specific to the {@code textDocument/signatureHelp}
*/
SignatureHelpCapabilities signatureHelp
/**
* Capabilities specific to the {@code textDocument/references}
*/
ReferencesCapabilities references
/**
* Capabilities specific to the {@code textDocument/documentHighlight}
*/
DocumentHighlightCapabilities documentHighlight
/**
* Capabilities specific to the {@code textDocument/documentSymbol}
*/
DocumentSymbolCapabilities documentSymbol
/**
* Capabilities specific to the {@code textDocument/formatting}
*/
FormattingCapabilities formatting
/**
* Capabilities specific to the {@code textDocument/rangeFormatting}
*/
RangeFormattingCapabilities rangeFormatting
/**
* Capabilities specific to the {@code textDocument/onTypeFormatting}
*/
OnTypeFormattingCapabilities onTypeFormatting
/**
* Capabilities specific to the {@code textDocument/declaration}
* <p>
* Since 3.14.0
*/
DeclarationCapabilities declaration
/**
* Capabilities specific to the {@code textDocument/definition}
* <p>
* Since 3.14.0
*/
DefinitionCapabilities definition
/**
* Capabilities specific to the {@code textDocument/typeDefinition}
* <p>
* Since 3.6.0
*/
TypeDefinitionCapabilities typeDefinition
/**
* Capabilities specific to the {@code textDocument/implementation}
* <p>
* Since 3.6.0
*/
ImplementationCapabilities implementation
/**
* Capabilities specific to the {@code textDocument/codeAction}
*/
CodeActionCapabilities codeAction
/**
* Capabilities specific to the {@code textDocument/codeLens}
*/
CodeLensCapabilities codeLens
/**
* Capabilities specific to the {@code textDocument/documentLink}
*/
DocumentLinkCapabilities documentLink
/**
* Capabilities specific to the {@code textDocument/documentColor} and the
* {@code textDocument/colorPresentation} request.
* <p>
* Since 3.6.0
*/
ColorProviderCapabilities colorProvider
/**
* Capabilities specific to the {@code textDocument/rename}
*/
RenameCapabilities rename
/**
* Capabilities specific to {@code textDocument/publishDiagnostics}.
*/
PublishDiagnosticsCapabilities publishDiagnostics
/**
* Capabilities specific to {@code textDocument/foldingRange} requests.
* <p>
* Since 3.10.0
*/
FoldingRangeCapabilities foldingRange
/**
* Capabilities specific to {@code textDocument/typeHierarchy}.
*/
@Beta
TypeHierarchyCapabilities typeHierarchyCapabilities
/**
* Capabilities specific to {@code textDocument/prepareCallHierarchy}.
* <p>
* Since 3.16.0
*/
CallHierarchyCapabilities callHierarchy
/**
* Capabilities specific to `textDocument/selectionRange` requests
* <p>
* Since 3.15.0
*/
SelectionRangeCapabilities selectionRange
/**
* Capabilities specific to {@code textDocument/semanticTokens}.
* <p>
* Since 3.16.0
*/
SemanticTokensCapabilities semanticTokens
/**
* Capabilities specific to the {@code textDocument/moniker} request.
* <p>
* Since 3.16.0
*/
MonikerCapabilities moniker
/**
* Capabilities specific to the {@code textDocument/linkedEditingRange} request.
* <p>
* Since 3.16.0
*/
LinkedEditingRangeCapabilities linkedEditingRange
}
/**
* Window specific client capabilities.
*/
@JsonRpcData
class WindowClientCapabilities {
/**
* Whether client supports handling progress notifications. If set servers are allowed to
* report in `workDoneProgress` property in the request specific server capabilities.
* <p>
* Since 3.15.0
*/
Boolean workDoneProgress
/**
* Capabilities specific to the showMessage request
* <p>
* Since 3.16.0
*/
WindowShowMessageRequestCapabilities showMessage
/**
* Client capabilities for the show document request.
* <p>
* Since 3.16.0
*/
ShowDocumentCapabilities showDocument
}
/**
* General client capabilities.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class GeneralClientCapabilities {
/**
* Client capabilities specific to regular expressions.
* <p>
* Since 3.16.0
*/
RegularExpressionsCapabilities regularExpressions
/**
* Client capabilities specific to the client's markdown parser.
* <p>
* Since 3.16.0
*/
MarkdownCapabilities markdown
}
/**
* `ClientCapabilities` now define capabilities for dynamic registration, workspace and text document features the client supports.
* The {@link #experimental} can be used to pass experimental capabilities under development.
* For future compatibility a `ClientCapabilities` object literal can have more properties set than currently defined.
* Servers receiving a `ClientCapabilities` object literal with unknown properties should ignore these properties.
* A missing property should be interpreted as an absence of the capability.
* If a property is missing that defines sub properties all sub properties should be interpreted as an absence of the capability.
* <p>
* Client capabilities got introduced with the version 3.0 of the protocol. They therefore only describe capabilities that got introduced in 3.x or later.
* Capabilities that existed in the 2.x version of the protocol are still mandatory for clients. Clients cannot opt out of providing them.
* So even if a client omits the {@link TextDocumentClientCapabilities#synchronization}
* it is still required that the client provides text document synchronization (e.g. open, changed and close notifications).
*/
@JsonRpcData
class ClientCapabilities {
/**
* Workspace specific client capabilities.
*/
WorkspaceClientCapabilities workspace
/**
* Text document specific client capabilities.
*/
TextDocumentClientCapabilities textDocument
/**
* Window specific client capabilities.
*/
WindowClientCapabilities window
/**
* General client capabilities.
* <p>
* Since 3.16.0
*/
GeneralClientCapabilities general
/**
* Experimental client capabilities.
*/
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object experimental
new() {
}
new(WorkspaceClientCapabilities workspace, TextDocumentClientCapabilities textDocument, Object experimental) {
this.workspace = workspace
this.textDocument = textDocument
this.experimental = experimental
}
new(WorkspaceClientCapabilities workspace, TextDocumentClientCapabilities textDocument, WindowClientCapabilities window, Object experimental) {
this.workspace = workspace
this.textDocument = textDocument
this.window = window
this.experimental = experimental
}
}
/**
* A code action represents a change that can be performed in code, e.g. to fix a problem or
* to refactor code.
* <p>
* A CodeAction must set either {@link #edit} and/or a {@link #command}.
* If both are supplied, the {@link #edit} is applied first, then the {@link #command} is executed.
*/
@JsonRpcData
class CodeAction {
/**
* A short, human-readable, title for this code action.
*/
@NonNull
String title
/**
* The kind of the code action.
* <p>
* Used to filter code actions.
*/
String kind
/**
* The diagnostics that this code action resolves.
*/
List<Diagnostic> diagnostics
/**
* Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
* by keybindings.
* <p>
* A quick fix should be marked preferred if it properly addresses the underlying error.
* A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
* <p>
* Since 3.15.0
*/
Boolean isPreferred
/**
* Marks that the code action cannot currently be applied.
* <p>
* Clients should follow the following guidelines regarding disabled code actions:
* <ul>
* <li>Disabled code actions are not shown in automatic <a href="https://code.visualstudio.com/docs/editor/editingevolved#_code-action">lightbulb</a>
* code action menu.
* <li>Disabled actions are shown as faded out in the code action menu when the user request a more specific type
* of code action, such as refactorings.
* <li>If the user has a <a href="https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions">keybinding</a>
* that auto applies a code action and only a disabled code actions are returned, the client should show the user an
* error message with {@link CodeActionDisabled#reason} in the editor.
* </ul><p>
* Since 3.16.0
*/
CodeActionDisabled disabled
/**
* The workspace edit this code action performs.
*/
WorkspaceEdit edit
/**
* A command this code action executes. If a code action
* provides a edit and a command, first the edit is
* executed and then the command.
*/
Command command
/**
* A data entry field that is preserved on a code action between
* a `textDocument/codeAction` and a `codeAction/resolve` request.
* <p>
* Since 3.16.0
*/
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object data
new() {
}
new(@NonNull String title) {
this.title = Preconditions.checkNotNull(title, 'title')
}
}
/**
* Marks that the code action cannot currently be applied.
* <p>
* Clients should follow the following guidelines regarding disabled code actions:
* <ul>
* <li>Disabled code actions are not shown in automatic <a href="https://code.visualstudio.com/docs/editor/editingevolved#_code-action">lightbulb</a>
* code action menu.
* <li>Disabled actions are shown as faded out in the code action menu when the user request a more specific type
* of code action, such as refactorings.
* <li>If the user has a <a href="https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions">keybinding</a>
* that auto applies a code action and only a disabled code actions are returned, the client should show the user an
* error message with {@link #reason} in the editor.
* </ul><p>
* Since 3.16.0
*/
@JsonRpcData
class CodeActionDisabled {
/**
* Human readable description of why the code action is currently disabled.
* <p>
* This is displayed in the code actions UI.
*/
@NonNull
String reason
new() {
}
new(@NonNull String reason) {
this.reason = Preconditions.checkNotNull(reason, 'reason')
}
}
/**
* Contains additional diagnostic information about the context in which a code action is run.
*/
@JsonRpcData
class CodeActionContext {
/**
* An array of diagnostics.
*/
@NonNull
List<Diagnostic> diagnostics
/**
* Requested kind of actions to return.
* <p>
* Actions not of this kind are filtered out by the client before being shown. So servers
* can omit computing them.
* <p>
* See {@link CodeActionKind} for allowed values.
*/
List<String> only
new() {
}
new(@NonNull List<Diagnostic> diagnostics) {
this.diagnostics = Preconditions.checkNotNull(diagnostics, 'diagnostics')
}
new(@NonNull List<Diagnostic> diagnostics, List<String> only) {
this(diagnostics)
this.only = only
}
}
/**
* The code action request is sent from the client to the server to compute commands for a given text document and range.
* These commands are typically code fixes to either fix problems or to beautify/refactor code.
*/
@JsonRpcData
class CodeActionParams extends WorkDoneProgressAndPartialResultParams {
/**
* The document in which the command was invoked.
*/
@NonNull
TextDocumentIdentifier textDocument
/**
* The range for which the command was invoked.
*/
@NonNull
Range range
/**
* Context carrying additional information.
*/
@NonNull
CodeActionContext context
new() {
}
new(@NonNull TextDocumentIdentifier textDocument, @NonNull Range range, @NonNull CodeActionContext context) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
this.range = Preconditions.checkNotNull(range, 'range')
this.context = Preconditions.checkNotNull(context, 'context')
}
}
/**
* A code lens represents a command that should be shown along with source text, like the number of references,
* a way to run tests, etc.
* <p>
* A code lens is <em>unresolved</em> when no command is associated to it. For performance reasons the creation of a
* code lens and resolving should be done to two stages.
*/
@JsonRpcData
class CodeLens {
/**
* The range in which this code lens is valid. Should only span a single line.
*/
@NonNull
Range range
/**
* The command this code lens represents.
*/
Command command
/**
* A data entry field that is preserved on a code lens item between a code lens and a code lens resolve request.
*/
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object data
new() {
}
new(@NonNull Range range) {
this.range = Preconditions.checkNotNull(range, 'range')
}
new(@NonNull Range range, Command command, Object data) {
this(range)
this.command = command
this.data = data
}
}
/**
* Code Action options.
*/
@JsonRpcData
class CodeActionOptions extends AbstractWorkDoneProgressOptions {
/**
* CodeActionKinds that this server may return.
* <p>
* The list of kinds may be generic, such as {@link CodeActionKind#Refactor}, or the server
* may list out every specific kind they provide.
*/
List<String> codeActionKinds
/**
* The server provides support to resolve additional
* information for a code action.
* <p>
* Since 3.16.0
*/
Boolean resolveProvider
new() {
}
new(List<String> codeActionKinds) {
this.codeActionKinds = codeActionKinds
}
}
/**
* Code Action registration options.
*/
@JsonRpcData
class CodeActionRegistrationOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
/**
* CodeActionKinds that this server may return.
* <p>
* The list of kinds may be generic, such as {@link CodeActionKind#Refactor}, or the server
* may list out every specific kind they provide.
*/
List<String> codeActionKinds
/**
* The server provides support to resolve additional
* information for a code action.
* <p>
* Since 3.16.0
*/
Boolean resolveProvider
new() {
}
new(List<String> codeActionKinds) {
this.codeActionKinds = codeActionKinds
}
}
/**
* Code Lens options.
*/
@JsonRpcData
class CodeLensOptions extends AbstractWorkDoneProgressOptions {
/**
* Code lens has a resolve provider as well.
*/
Boolean resolveProvider
new() {
}
new(Boolean resolveProvider) {
this.resolveProvider = resolveProvider
}
}
/**
* The code lens request is sent from the client to the server to compute code lenses for a given text document.
*/
@JsonRpcData
class CodeLensParams extends WorkDoneProgressAndPartialResultParams {
/**
* The document to request code lens for.
*/
@NonNull
TextDocumentIdentifier textDocument
new() {
}
new(@NonNull TextDocumentIdentifier textDocument) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
}
}
/**
* Represents a reference to a command. Provides a title which will be used to represent a command in the UI and,
* optionally, an array of arguments which will be passed to the command handler function when invoked.
*/
@JsonRpcData
class Command {
/**
* Title of the command, like `save`.
*/
@NonNull
String title
/**
* The identifier of the actual command handler.
*/
@NonNull
String command
/**
* Arguments that the command handler should be invoked with.
*/
List<Object> arguments
new() {
}
new(@NonNull String title, @NonNull String command) {
this.title = Preconditions.checkNotNull(title, 'title')
this.command = Preconditions.checkNotNull(command, 'command')
}
new(@NonNull String title, @NonNull String command, List<Object> arguments) {
this(title, command)
this.arguments = arguments
}
}
/**
* The Completion request is sent from the client to the server to compute completion items at a given cursor position.
* Completion items are presented in the IntelliSense user class. If computing complete completion items is expensive
* servers can additional provide a handler for the resolve completion item request. This request is send when a
* completion item is selected in the user class.
*/
@JsonRpcData
class CompletionItem {
/**
* The label of this completion item. By default also the text that is inserted when selecting this completion.
*/
@NonNull
String label
/**
* The kind of this completion item. Based of the kind an icon is chosen by the editor.
*/
CompletionItemKind kind
/**
* Tags for this completion item.
* <p>
* Since 3.15.0
*/
List<CompletionItemTag> tags
/**
* A human-readable string with additional information about this item, like type or symbol information.
*/
String detail
/**
* A human-readable string that represents a doc-comment.
*/
Either<String, MarkupContent> documentation
/**
* Indicates if this item is deprecated.
*
* @deprecated Use {@link #tags} instead if supported.
*/
@Deprecated
Boolean deprecated
/**
* Select this item when showing.
* <p>
* <em>Note</em> that only one completion item can be selected and that the
* tool / client decides which item that is. The rule is that the <em>first</em>
* item of those that match best is selected.
*/
Boolean preselect
/**
* A string that should be used when comparing this item with other items. When `falsy` the label is used.
*/
String sortText
/**
* A string that should be used when filtering a set of completion items. When `falsy` the label is used.
*/
String filterText
/**
* A string that should be inserted a document when selecting this completion. When `falsy` the label is used.
*/
String insertText
/**
* The format of the insert text. The format applies to both the {@link #insertText} property
* and the {@code newText} property of a provided {@link #textEdit}.
*/
InsertTextFormat insertTextFormat
/**
* How whitespace and indentation is handled during completion item
* insertion. If not provided, the client's default value is used.
* <p>
* Since 3.16.0
*/
InsertTextMode insertTextMode
/**
* An edit which is applied to a document when selecting this completion.
* When an edit is provided the value of {@link #insertText} is ignored.
* <p>
* <em>Note:</em> The range of the edit must be a single line range and it must
* contain the position at which completion has been requested.
* <p>
* Most editors support two different operations when accepting a completion
* item. One is to insert a completion text and the other is to replace an
* existing text with a completion text. Since this can usually not be
* predetermined by a server it can report both ranges. Clients need to
* signal support for {@link InsertReplaceEdit}s via the
* {@link CompletionItemCapabilities#insertReplaceSupport} client capability
* property.
* <p>
* <em>Note 1:</em> The text edit's range as well as both ranges from an insert
* replace edit must be a [single line] and they must contain the position
* at which completion has been requested.
* <p>
* <em>Note 2:</em> If an {@link InsertReplaceEdit} is returned the edit's insert range
* must be a prefix of the edit's replace range, that means it must be
* contained and starting at the same position.
* <p>
* Since 3.16.0 additional type {@link InsertReplaceEdit}
*/
@JsonAdapter(CompletionItemTextEditTypeAdapter)
Either<TextEdit, InsertReplaceEdit> textEdit
/**
* An optional array of additional text edits that are applied when
* selecting this completion. Edits must not overlap (including the same insert position)
* with the main edit nor with themselves.
* <p>
* Additional text edits should be used to change text unrelated to the current cursor position
* (for example adding an import statement at the top of the file if the completion item will
* insert an unqualified type).
*/
List<TextEdit> additionalTextEdits
/**
* An optional set of characters that when pressed while this completion is active will accept it first and
* then type that character. <em>Note</em> that all commit characters should have {@code length=1} and that superfluous
* characters will be ignored.
*/
List<String> commitCharacters
/**
* An optional command that is executed <em>after</em> inserting this completion. <em>Note</em> that
* additional modifications to the current document should be described with the
* {@link #additionalTextEdits} property.
*/
Command command
/**
* A data entry field that is preserved on a completion item between a completion and a completion resolve request.
*/
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object data
new() {
}
new(@NonNull String label) {
this.label = Preconditions.checkNotNull(label, 'label')
}
}
/**
* Represents a collection of completion items to be presented in the editor.
*/
@JsonRpcData
class CompletionList {
/**
* This list it not complete. Further typing should result in recomputing this list.
*/
boolean isIncomplete
/**
* The completion items.
*/
@NonNull
List<CompletionItem> items
new() {
this(new ArrayList)
}
new(@NonNull List<CompletionItem> items) {
this.items = Preconditions.checkNotNull(items, 'items')
}
new(boolean isIncomplete, @NonNull List<CompletionItem> items) {
this(items)
this.isIncomplete = isIncomplete
}
}
/**
* Completion options.
*/
@JsonRpcData
class CompletionOptions extends AbstractWorkDoneProgressOptions {
/**
* The server provides support to resolve additional information for a completion item.
*/
Boolean resolveProvider
/**
* The characters that trigger completion automatically.
*/
List<String> triggerCharacters
/**
* The list of all possible characters that commit a completion. This field
* can be used if clients don't support individual commit characters per
* completion item. See client capability
* {@link CompletionItemCapabilities#commitCharactersSupport}.
* <p>
* If a server provides both {@code allCommitCharacters} and commit characters on
* an individual completion item the ones on the completion item win.
* <p>
* Since 3.2.0
*/
List<String> allCommitCharacters
new() {
}
new(Boolean resolveProvider, List<String> triggerCharacters) {
this.resolveProvider = resolveProvider
this.triggerCharacters = triggerCharacters
}
}
/**
* Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
*/
@JsonRpcData
class Diagnostic {
/**
* The range at which the message applies
*/
@NonNull
Range range
/**
* The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error,
* warning, info or hint.
*/
DiagnosticSeverity severity
/**
* The diagnostic's code. Can be omitted.
*/
Either<String, Integer> code
/**
* An optional property to describe the error code.
* <p>
* Since 3.16.0
*/
DiagnosticCodeDescription codeDescription
/**
* A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'.
*/
String source
/**
* The diagnostic's message.
*/
@NonNull
String message
/**
* Additional metadata about the diagnostic.
* <p>
* Since 3.15.0
*/
List<DiagnosticTag> tags
/**
* An array of related diagnostic information, e.g. when symbol-names within a scope collide
* all definitions can be marked via this property.
* <p>
* Since 3.7.0
*/
List<DiagnosticRelatedInformation> relatedInformation
/**
* A data entry field that is preserved between a `textDocument/publishDiagnostics`
* notification and `textDocument/codeAction` request.
* <p>
* Since 3.16.0
*/
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object data
new() {
}
new(@NonNull Range range, @NonNull String message) {
this.range = Preconditions.checkNotNull(range, 'range')
this.message = Preconditions.checkNotNull(message, 'message')
}
new(@NonNull Range range, @NonNull String message, DiagnosticSeverity severity, String source) {
this(range, message)
this.severity = severity
this.source = source
}
new(@NonNull Range range, @NonNull String message, DiagnosticSeverity severity, String source, String code) {
this(range, message, severity, source)
this.code = code
}
}
/**
* Represents a related message and source code location for a diagnostic. This should be
* used to point to code locations that cause or related to a diagnostics, e.g when duplicating
* a symbol in a scope.
* <p>
* Since 3.7.0
*/
@JsonRpcData
class DiagnosticRelatedInformation {
/**
* The location of this related diagnostic information.
*/
@NonNull
Location location
/**
* The message of this related diagnostic information.
*/
@NonNull
String message
new() {
}
new(@NonNull Location location, @NonNull String message) {
this.location = Preconditions.checkNotNull(location, 'location')
this.message = Preconditions.checkNotNull(message, 'message')
}
}
/**
* Structure to capture a description for an error code.
* <p>
* Since 3.16.0
*/
@JsonRpcData
class DiagnosticCodeDescription {
/**
* A URI to open with more information about the diagnostic error.
*/
@NonNull
String href
new() {
}
new(@NonNull String href) {
this.href = Preconditions.checkNotNull(href, 'href')
}
}
/**
* A notification sent from the client to the server to signal the change of configuration settings.
*/
@JsonRpcData
class DidChangeConfigurationParams {
/**
* The actual changed settings.
*/
@NonNull
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object settings
new() {
}
new(@NonNull Object settings) {
this.settings = Preconditions.checkNotNull(settings, 'settings')
}
}
/**
* The document change notification is sent from the client to the server to signal changes to a text document.
*/
@JsonRpcData
class DidChangeTextDocumentParams {
/**
* The document that did change. The version number points to the version after all provided content changes have
* been applied.
*/
@NonNull
VersionedTextDocumentIdentifier textDocument
/**
* Legacy property to support protocol version 1.0 requests.
*/
@Deprecated
String uri
/**
* The actual content changes.
*/
@NonNull
List<TextDocumentContentChangeEvent> contentChanges = new ArrayList
new() {
}
new(@NonNull VersionedTextDocumentIdentifier textDocument,
@NonNull List<TextDocumentContentChangeEvent> contentChanges) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
this.contentChanges = Preconditions.checkNotNull(contentChanges, 'contentChanges')
}
@Deprecated
new(@NonNull VersionedTextDocumentIdentifier textDocument, String uri,
@NonNull List<TextDocumentContentChangeEvent> contentChanges) {
this(textDocument, contentChanges)
this.uri = uri
}
}
/**
* The watched files notification is sent from the client to the server when the client detects changes
* to file watched by the language client.
*/
@JsonRpcData
class DidChangeWatchedFilesParams {
/**
* The actual file events.
*/
@NonNull
List<FileEvent> changes
new() {
this(new ArrayList)
}
new(@NonNull List<FileEvent> changes) {
this.changes = Preconditions.checkNotNull(changes, 'changes')
}
}
@JsonRpcData
class DidChangeWatchedFilesRegistrationOptions {
/**
* The watchers to register.
*/
@NonNull
List<FileSystemWatcher> watchers
new() {
}
new(@NonNull List<FileSystemWatcher> watchers) {
this.watchers = Preconditions.checkNotNull(watchers, 'watchers')
}
}
@JsonRpcData
class FileSystemWatcher {
/**
* The glob pattern to watch
*/
@NonNull
String globPattern
/**
* The kind of events of interest. If omitted it defaults
* to WatchKind.Create | WatchKind.Change | WatchKind.Delete
* which is 7.
*/
Integer kind
new() {
}
new(@NonNull String globPattern) {
this.globPattern = Preconditions.checkNotNull(globPattern, 'globPattern')
}
new(@NonNull String globPattern, Integer kind) {
this(globPattern)
this.kind = kind
}
}
/**
* The document close notification is sent from the client to the server when the document got closed in the client.
* The document's truth now exists where the document's uri points to (e.g. if the document's uri is a file uri the
* truth now exists on disk).
*/
@JsonRpcData
class DidCloseTextDocumentParams {
/**
* The document that was closed.
*/
@NonNull
TextDocumentIdentifier textDocument
new() {
}
new(@NonNull TextDocumentIdentifier textDocument) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
}
}
/**
* The document open notification is sent from the client to the server to signal newly opened text documents.
* The document's truth is now managed by the client and the server must not try to read the document's truth using
* the document's uri.
*/
@JsonRpcData
class DidOpenTextDocumentParams {
/**
* The document that was opened.
*/
@NonNull
TextDocumentItem textDocument
/**
* Legacy property to support protocol version 1.0 requests.
*/
@Deprecated
String text
new() {
}
new(@NonNull TextDocumentItem textDocument) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
}
@Deprecated
new(@NonNull TextDocumentItem textDocument, String text) {
this(textDocument)
this.text = text
}
}
/**
* The document save notification is sent from the client to the server when the document was saved in the client.
*/
@JsonRpcData
class DidSaveTextDocumentParams {
/**
* The document that was closed.
*/
@NonNull
TextDocumentIdentifier textDocument
/**
* Optional the content when saved. Depends on the includeText value
* when the save notification was requested.
*/
String text
new() {
}
new(@NonNull TextDocumentIdentifier textDocument) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
}
new(@NonNull TextDocumentIdentifier textDocument, String text) {
this(textDocument)
this.text = text
}
}
@JsonRpcData
class WillSaveTextDocumentParams {
/**
* The document that will be saved.
*/
@NonNull
TextDocumentIdentifier textDocument
/**
* A reason why a text document is saved.
*/
@NonNull
TextDocumentSaveReason reason
new() {
}
new(@NonNull TextDocumentIdentifier textDocument, @NonNull TextDocumentSaveReason reason) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
this.reason = Preconditions.checkNotNull(reason, 'reason')
}
}
/**
* The document formatting request is sent from the server to the client to format a whole document.
*/
@JsonRpcData
class DocumentFormattingParams implements WorkDoneProgressParams {
/**
* An optional token that a server can use to report work done progress.
*/
Either<String, Integer> workDoneToken
/**
* The document to format.
*/
@NonNull
TextDocumentIdentifier textDocument
/**
* The format options
*/
@NonNull
FormattingOptions options
new() {
}
new(@NonNull TextDocumentIdentifier textDocument, @NonNull FormattingOptions options) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
this.options = Preconditions.checkNotNull(options, 'options')
}
}
/**
* Document formatting options.
*/
@JsonRpcData
class DocumentFormattingOptions extends AbstractWorkDoneProgressOptions {
}
/**
* Document formatting registration options.
*/
@JsonRpcData
class DocumentFormattingRegistrationOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
}
/**
* A document highlight is a range inside a text document which deserves special attention. Usually a document highlight
* is visualized by changing the background color of its range.
*/
@JsonRpcData
class DocumentHighlight {
/**
* The range this highlight applies to.
*/
@NonNull
Range range
/**
* The highlight kind, default is {@link DocumentHighlightKind#Text}.
*/
DocumentHighlightKind kind
new() {
}
new(@NonNull Range range) {
this.range = Preconditions.checkNotNull(range, 'range')
}
new(@NonNull Range range, DocumentHighlightKind kind) {
this(range)
this.kind = kind
}
}
/**
* A document link is a range in a text document that links to an internal or external resource, like another
* text document or a web site.
*/
@JsonRpcData
class DocumentLink {
/**
* The range this link applies to.
*/
@NonNull
Range range
/**
* The uri this link points to. If missing a resolve request is sent later.
*/
String target
/**
* The tooltip text when you hover over this link.
* <p>
* If a tooltip is provided, is will be displayed in a string that includes instructions on how to
* trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
* user settings, and localization.
* <p>
* Since 3.15.0
*/
String tooltip
/**
* A data entry field that is preserved on a document link between a
* DocumentLinkRequest and a DocumentLinkResolveRequest.
*/
@JsonAdapter(JsonElementTypeAdapter.Factory)
Object data
new() {
}
new(@NonNull Range range) {
this.range = Preconditions.checkNotNull(range, 'range')
}
new(@NonNull Range range, String target) {
this(range)
this.target = target
}
new(@NonNull Range range, String target, Object data) {
this(range, target)
this.data = data
}
new(@NonNull Range range, String target, Object data, String tooltip) {
this(range, target, data)
this.tooltip = tooltip
}
}
/**
* The document links request is sent from the client to the server to request the location of links in a document.
*/
@JsonRpcData
class DocumentLinkParams extends WorkDoneProgressAndPartialResultParams {
/**
* The document to provide document links for.
*/
@NonNull
TextDocumentIdentifier textDocument
new() {
}
new(@NonNull TextDocumentIdentifier textDocument) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
}
}
/**
* Document link options
*/
@JsonRpcData
class DocumentLinkOptions extends AbstractWorkDoneProgressOptions {
/**
* Document links have a resolve provider as well.
*/
Boolean resolveProvider
new() {
}
new(Boolean resolveProvider) {
this.resolveProvider = resolveProvider
}
}
/**
* Execute command options.
*/
@JsonRpcData
class ExecuteCommandOptions extends AbstractWorkDoneProgressOptions {
/**
* The commands to be executed on the server
*/
@NonNull
List<String> commands
new() {
this(new ArrayList)
}
new(@NonNull List<String> commands) {
this.commands = Preconditions.checkNotNull(commands, 'commands')
}
}
/**
* Save options.
*/
@JsonRpcData
class SaveOptions {
/**
* The client is supposed to include the content on save.
*/
Boolean includeText
new() {
}
new(Boolean includeText) {
this.includeText = includeText
}
}
/**
* Rename options
*/
@JsonRpcData
class RenameOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
/**
* The id used to register the request. The id can be used to deregister
* the request again. See also Registration#id.
*
* @deprecated This options object is not specified for StaticRegistrationOptions
*/
@Deprecated
String id
/**
* Renames should be checked and tested before being executed.
*/
Boolean prepareProvider
new() {
}
@Deprecated
new(String id) {
this.id = id
}
new(Boolean prepareProvider) {
this.prepareProvider = prepareProvider
}
}
/**
* Document color options
*/
@JsonRpcData
class ColorProviderOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
/**
* The id used to register the request. The id can be used to deregister
* the request again. See also Registration#id.
*/
String id
new() {
}
new(String id) {
this.id = id
}
}
/**
* Folding range options.
*/
@JsonRpcData
class FoldingRangeProviderOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
/**
* The id used to register the request. The id can be used to deregister
* the request again. See also Registration#id.
*/
String id
new() {
}
new(String id) {
this.id = id
}
}
@JsonRpcData
class TextDocumentSyncOptions {
/**
* Open and close notifications are sent to the server.
*/
Boolean openClose
/**
* Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
* and TextDocumentSyncKind.Incremental.
*/
TextDocumentSyncKind change
/**
* Will save notifications are sent to the server.
*/
Boolean willSave
/**
* Will save wait until requests are sent to the server.
*/
Boolean willSaveWaitUntil
/**
* Save notifications are sent to the server.
*/
Either<Boolean, SaveOptions> save
}
/**
* Static registration options to be returned in the initialize request.
*/
@JsonRpcData
class StaticRegistrationOptions extends TextDocumentRegistrationOptions {
/**
* The id used to register the request. The id can be used to deregister
* the request again. See also Registration#id.
*/
String id
new() {
}
new(String id) {
this.id = id
}
}
/**
* Format document on type options
*/
@JsonRpcData
class DocumentOnTypeFormattingOptions {
/**
* A character on which formatting should be triggered, like `}`.
*/
@NonNull
String firstTriggerCharacter
/**
* More trigger characters.
*/
List<String> moreTriggerCharacter
new() {
}
new(@NonNull String firstTriggerCharacter) {
this.firstTriggerCharacter = firstTriggerCharacter
}
new(@NonNull String firstTriggerCharacter, List<String> moreTriggerCharacter) {
this.firstTriggerCharacter = Preconditions.checkNotNull(firstTriggerCharacter, 'firstTriggerCharacter')
this.moreTriggerCharacter = moreTriggerCharacter
}
}
/**
* The document on type formatting request is sent from the client to the server to format parts of the document during typing.
*/
@JsonRpcData
class DocumentOnTypeFormattingParams extends TextDocumentPositionParams {
/**
* The format options
*/
@NonNull
FormattingOptions options
/**
* The character that has been typed.
*/
@NonNull
String ch
new() {
}
new(@NonNull TextDocumentIdentifier textDocument, @NonNull FormattingOptions options, @NonNull Position position, @NonNull String ch) {
super(textDocument, position)
this.options = Preconditions.checkNotNull(options, 'options')
this.ch = Preconditions.checkNotNull(ch, 'ch')
}
@Deprecated
new(@NonNull Position position, @NonNull String ch) {
super.setPosition(position)
this.ch = Preconditions.checkNotNull(ch, 'ch')
}
}
/**
* The document range formatting request is sent from the client to the server to format a given range in a document.
*/
@JsonRpcData
class DocumentRangeFormattingParams implements WorkDoneProgressParams {
/**
* An optional token that a server can use to report work done progress.
*/
Either<String, Integer> workDoneToken
/**
* The document to format.
*/
@NonNull
TextDocumentIdentifier textDocument
/**
* The format options
*/
@NonNull
FormattingOptions options
/**
* The range to format
*/
@NonNull
Range range
new() {
}
new(@NonNull TextDocumentIdentifier textDocument, @NonNull FormattingOptions options, @NonNull Range range) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
this.options = Preconditions.checkNotNull(options, 'options')
this.range = Preconditions.checkNotNull(range, 'range')
}
@Deprecated
new(@NonNull Range range) {
this.range = Preconditions.checkNotNull(range, 'range')
}
}
/**
* Document range formatting options.
*/
@JsonRpcData
class DocumentRangeFormattingOptions extends AbstractWorkDoneProgressOptions {
}
/**
* Document range formatting registration options.
*/
@JsonRpcData
class DocumentRangeFormattingRegistrationOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
}
/**
* The type hierarchy request is sent from the client resolve a {@link TypeHierarchyItem type hierarchy item} for
* a give cursor location in the text document. The request would also allow to specify if the item should be resolved
* and whether sub- or supertypes are to be resolved.
*/
@Beta
@JsonRpcData
class TypeHierarchyParams extends TextDocumentPositionParams {
/**
* The number of hierarchy levels to resolve. {@code 0} indicates no hierarchy level. It defaults to {@code 0}.
*/
int resolve
/**
* The direction of the type hierarchy resolution. If not defined, defaults to {@link TypeHierarchyDirection#Children Children}.
*/
TypeHierarchyDirection direction
}
/**
* Request to resolve an unresolved {@link TypeHierarchyItem type hierarchy item} which is indicated if the
* {@link TypeHierarchyItem#getParents parents} or the {@link TypeHierarchyItem#getChildren children} is not
* defined. If resolved and no {@code parents} or {@code children} are available then an empty list is returned.
*/
@Beta
@JsonRpcData
class ResolveTypeHierarchyItemParams {
/**
* The hierarchy item to resolve.
*/
@NonNull
TypeHierarchyItem item
/**
* The number of hierarchy levels to resolve. {@code 0} indicates no hierarchy level.
*/
int resolve
/**
* The direction of the type hierarchy resolution.
*/
@NonNull
TypeHierarchyDirection direction
new() {
}
new(@NonNull TypeHierarchyItem item, int resolve, @NonNull TypeHierarchyDirection direction) {
this.item = Preconditions.checkNotNull(item, 'item')
this.resolve = resolve
this.direction = Preconditions.checkNotNull(direction, 'direction')
}
}
@JsonRpcData
class DocumentSymbolOptions extends AbstractWorkDoneProgressOptions {
/**
* A human-readable string that is shown when multiple outlines trees
* are shown for the same document.
* <p>
* Since 3.16.0
*/
String label
new() {
}
new(String label) {
this.label = label
}
}
@JsonRpcData
class DocumentSymbolRegistrationOptions extends AbstractTextDocumentRegistrationAndWorkDoneProgressOptions {
/**
* A human-readable string that is shown when multiple outlines trees
* are shown for the same document.
* <p>
* Since 3.16.0
*/
String label
new() {
}
new(String label) {
this.label = label
}
}
/**
* The document symbol request is sent from the client to the server to list all symbols found in a given text document.
*/
@JsonRpcData
class DocumentSymbolParams extends WorkDoneProgressAndPartialResultParams {
/**
* The text document.
*/
@NonNull
TextDocumentIdentifier textDocument
new() {
}
new(@NonNull TextDocumentIdentifier textDocument) {
this.textDocument = Preconditions.checkNotNull(textDocument, 'textDocument')
}
}
/**
* An event describing a file change.
*/
@JsonRpcData
class FileEvent {
/**
* The file's uri.
*/
@NonNull
String uri
/**
* The change type.
*/
@NonNull
FileChangeType type
new() {
}
new(@NonNull String uri, @NonNull FileChangeType type) {
this.uri = Preconditions.checkNotNull(uri, 'uri')
this.type = Preconditions.checkNotNull(type, 'type')
}
}
/**
* Value-object describing what options formatting should use.
*/
class FormattingOptions extends LinkedHashMap<String, Either3<String, Number, Boolean>> {
static val TAB_SIZE = 'tabSize'
static val INSERT_SPACES = 'insertSpaces'
static val TRIM_TRAILING_WHITESPACE = 'trimTrailingWhitespace'
static val INSERT_FINAL_NEWLINE = 'insertFinalNewline'
static val TRIM_FINAL_NEWLINES = 'trimFinalNewlines'
new() {
}
new(int tabSize, boolean insertSpaces) {
this.tabSize = tabSize
this.insertSpaces = insertSpaces
}
/**
* @deprecated See https://github.com/eclipse/lsp4j/issues/99
*/
@Deprecated
new(int tabSize, boolean insertSpaces, Map<String, String> properties) {
this(tabSize, insertSpaces)
setProperties(properties)
}
def String getString(String key) {
get(key)?.getFirst
}
def void putString(String key, String value) {
put(key, Either3.forFirst(value))
}
def Number getNumber(String key) {
get(key)?.getSecond
}
def void putNumber(String key, Number value) {
put(key, Either3.forSecond(value))
}
def Boolean getBoolean(String key) {
get(key)?.getThird
}
def void putBoolean(String key, Boolean value) {
put(key, Either3.forThird(value))
}
/**
* Size of a tab in spaces.
*/
def int getTabSize() {
val value = getNumber(TAB_SIZE)
if (value !== null)
return value.intValue
else
return 0
}
def void setTabSize(int tabSize) {
putNumber(TAB_SIZE, tabSize)
}
/**
* Prefer spaces over tabs.
*/
def boolean isInsertSpaces() {
val value = getBoolean(INSERT_SPACES)
if (value !== null)
return value
else
return false
}
def void setInsertSpaces(boolean insertSpaces) {
putBoolean(INSERT_SPACES, insertSpaces)
}
/**
* Trim trailing whitespace on a line.
* <p>
* Since 3.15.0
*/
def boolean isTrimTrailingWhitespace() {
val value = getBoolean(TRIM_TRAILING_WHITESPACE)
if (value !== null)
return value
else
return false
}
def void setTrimTrailingWhitespace(boolean trimTrailingWhitespace) {
putBoolean(TRIM_TRAILING_WHITESPACE, trimTrailingWhitespace)
}
/**
* Insert a newline character at the end of the file if one does not exist.
* <p>
* Since 3.15.0
*/
def boolean isInsertFinalNewline() {
val value = getBoolean(INSERT_FINAL_NEWLINE)
if (value !== null)
return value
else
return false
}
def void setInsertFinalNewline(boolean insertFinalNewline) {
putBoolean(INSERT_FINAL_NEWLINE, insertFinalNewline)
}
/**
* Trim all newlines after the final newline at the end of the file.
* <p>
* Since 3.15.0
*/
def boolean isTrimFinalNewlines() {
val value = getBoolean(TRIM_FINAL_NEWLINES)
if (value !== null)
return value
else
return false
}
def void setTrimFinalNewlines(boolean trimFinalNewlines) {
putBoolean(TRIM_FINAL_NEWLINES, trimFinalNewlines)
}
/**
* @deprecated See https://github.com/eclipse/lsp4j/issues/99
*/
@Deprecated
def Map<String, String> getProperties() {
val properties = newLinkedHashMap
for (entry : entrySet) {
val value = switch it: entry.value {
case isFirst: getFirst
case isSecond: getSecond
case isThird: getThird
}
if (value !== null)
properties.put(entry.key, value.toString)
}
return properties.unmodifiableView
}
/**
* @deprecated See https://github.com/eclipse/lsp4j/issues/99
*/
@Deprecated
def void setProperties(Map<String, String> properties) {
for (entry : properties.entrySet) {
putString(entry.key, entry.value)
}
}
}
/**
* A MarkupContent literal represents a string value which content is interpreted based on its
* kind flag. Currently the protocol supports {@link MarkupKind#PLAINTEXT plaintext} and
* {@link MarkupKind#MARKDOWN markdown} as markup kinds.
* <p>
* If the kind is {@link MarkupKind#MARKDOWN markdown} then the value can contain fenced code blocks like in GitHub issues.
* See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
* <p>
* Please Note that clients might sanitize the return markdown. A client could decide to
* remove HTML from the markdown to avoid script execution.
*/
@JsonRpcData
class MarkupContent {
/**
* The type of the Markup.
*/
@NonNull
String kind
/**
* The content itself.
*/
@NonNull
String value
new() {
}
new(@NonNull String kind, @NonNull String value) {
this.kind = Preconditions.checkNotNull(kind, 'kind')
this.value = Preconditions.checkNotNull(value, 'value')
}
}
/**
* The result of a hover request.
*/
@JsonRpcData
@JsonAdapter(HoverTypeAdapter.Factory)
class Hover {
/**
* The hover's content as markdown
*/
@NonNull
Either<List<Either<String, MarkedString>>, MarkupContent> contents
/**
* An optional range
*/
Range range
new() {
}
new(@NonNull List<Either<String, MarkedString>> contents) {
this.contents = Preconditions.checkNotNull(contents, 'contents')
}
new(@NonNull List<Either<String, MarkedString>> contents, Range range) {
this.contents = Preconditions.checkNotNull(contents, 'contents')
this.range = range
}
new(@NonNull MarkupContent contents) {
this.contents = Preconditions.checkNotNull(contents, 'contents')
}
new(@NonNull MarkupContent contents, Range range) {
this.contents = Preconditions.checkNotNull(contents, 'contents')
this.range = range
}
new(@NonNull Either<String, MarkedString> contents) {
this.contents = Arrays.asList(Preconditions.checkNotNull(contents, 'contents'))
}
}
/**
* MarkedString can be used to render human readable text. It is either a markdown string
* or a code-block that provides a language and a code snippet. The language identifier
* is semantically equal to the optional language identifier in fenced code blocks in GitHub
* issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
* <p>
* The pair of a language and a value is an equivalent to markdown:
* <pre>
* ```${language}
* ${value}
* ```
* </pre>
* <p>
* Note that markdown strings will be sanitized - that means html will be escaped.
*
* @deprecated Use {@link MarkupContent} instead.
*/
@JsonRpcData
@Deprecated
class MarkedString {
@NonNull
String language
@NonNull
String value
new() {
}
new(@NonNull String language, @NonNull String value) {
this.language = Preconditions.checkNotNull(language,