diff --git a/internal/lsp/cmd/cmd.go b/internal/lsp/cmd/cmd.go index 483ec8d7e9..0262c030e2 100644 --- a/internal/lsp/cmd/cmd.go +++ b/internal/lsp/cmd/cmd.go @@ -152,11 +152,7 @@ func (app *Application) connect(ctx context.Context, client cmdClient) (protocol } params := &protocol.InitializeParams{} params.RootURI = string(span.FileURI(app.Config.Dir)) - params.Capabilities = map[string]interface{}{ - "workspace": map[string]interface{}{ - "configuration": true, - }, - } + params.Capabilities.Workspace.Configuration = true client.prepare(app, server) if _, err := server.Initialize(ctx, params); err != nil { return nil, err diff --git a/internal/lsp/protocol/tsprotocol.go b/internal/lsp/protocol/tsprotocol.go index 11962acf34..923cb00564 100644 --- a/internal/lsp/protocol/tsprotocol.go +++ b/internal/lsp/protocol/tsprotocol.go @@ -1,211 +1,65 @@ // Package protocol contains data types for LSP jsonrpcs // generated automatically from vscode-languageserver-node -// version of Mon Feb 25 2019 09:01:22 GMT-0500 (Eastern Standard Time) +// version of Fri Apr 05 2019 10:16:07 GMT-0400 (Eastern Daylight Time) package protocol -// ImplementationClientCapabilities is: -type ImplementationClientCapabilities struct { - - /** TextDocument defined: - * The text document client capabilities - */ - TextDocument *struct { - - /** Implementation defined: - * Capabilities specific to the `textDocument/implementation` - */ - Implementation *struct { - - /** DynamicRegistration defined: - * Whether implementation supports dynamic registration. If this is set to `true` - * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - * return value for the corresponding server capability as well. - */ - DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - - /** LinkSupport defined: - * The client supports additional metadata in the form of definition links. - */ - LinkSupport bool `json:"linkSupport,omitempty"` - } `json:"implementation,omitempty"` - } `json:"textDocument,omitempty"` -} - -// ImplementationServerCapabilities is: -type ImplementationServerCapabilities struct { - - /** ImplementationProvider defined: - * The server provides Goto Implementation support. - */ - ImplementationProvider bool `json:"implementationProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) -} - -// TypeDefinitionClientCapabilities is: -type TypeDefinitionClientCapabilities struct { - - /** TextDocument defined: - * The text document client capabilities - */ - TextDocument *struct { - - /** TypeDefinition defined: - * Capabilities specific to the `textDocument/typeDefinition` - */ - TypeDefinition *struct { - - /** DynamicRegistration defined: - * Whether implementation supports dynamic registration. If this is set to `true` - * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - * return value for the corresponding server capability as well. - */ - DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - - /** LinkSupport defined: - * The client supports additional metadata in the form of definition links. - */ - LinkSupport bool `json:"linkSupport,omitempty"` - } `json:"typeDefinition,omitempty"` - } `json:"textDocument,omitempty"` -} - -// TypeDefinitionServerCapabilities is: -type TypeDefinitionServerCapabilities struct { - - /** TypeDefinitionProvider defined: - * The server provides Goto Type Definition support. - */ - TypeDefinitionProvider bool `json:"typeDefinitionProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) -} - -// WorkspaceFoldersInitializeParams is: -type WorkspaceFoldersInitializeParams struct { - - /** WorkspaceFolders defined: - * The actual configured workspace folders. - */ - WorkspaceFolders []WorkspaceFolder `json:"workspaceFolders"` -} - -// WorkspaceFoldersClientCapabilities is: -type WorkspaceFoldersClientCapabilities struct { - - /** Workspace defined: - * The workspace client capabilities - */ - Workspace *struct { - - /** WorkspaceFolders defined: - * The client has support for workspace folders - */ - WorkspaceFolders bool `json:"workspaceFolders,omitempty"` - } `json:"workspace,omitempty"` -} - -// WorkspaceFoldersServerCapabilities is: -type WorkspaceFoldersServerCapabilities struct { - - /** Workspace defined: - * The workspace server capabilities - */ - Workspace *struct { - - // WorkspaceFolders is - WorkspaceFolders *struct { - - /** Supported defined: - * The Server has support for workspace folders - */ - Supported bool `json:"supported,omitempty"` - - /** ChangeNotifications defined: - * Whether the server wants to receive workspace folder - * change notifications. - * - * If a strings is provided the string is treated as a ID - * under which the notification is registed on the client - * side. The ID can be used to unregister for these events - * using the `client/unregisterCapability` request. - */ - ChangeNotifications string `json:"changeNotifications,omitempty"` // string | boolean - } `json:"workspaceFolders,omitempty"` - } `json:"workspace,omitempty"` -} - -// WorkspaceFolder is: +// WorkspaceFolder is type WorkspaceFolder struct { - /** URI defined: + /*URI defined: * The associated URI for this workspace folder. */ URI string `json:"uri"` - /** Name defined: + /*Name defined: * The name of the workspace folder. Used to refer to this * workspace folder in thge user interface. */ Name string `json:"name"` } -// DidChangeWorkspaceFoldersParams is: -/** +/*DidChangeWorkspaceFoldersParams defined: * The parameters of a `workspace/didChangeWorkspaceFolders` notification. */ type DidChangeWorkspaceFoldersParams struct { - /** Event defined: + /*Event defined: * The actual workspace folder change event. */ Event WorkspaceFoldersChangeEvent `json:"event"` } -// WorkspaceFoldersChangeEvent is: -/** +/*WorkspaceFoldersChangeEvent defined: * The workspace folder change event. */ type WorkspaceFoldersChangeEvent struct { - /** Added defined: + /*Added defined: * The array of added workspace folders */ Added []WorkspaceFolder `json:"added"` - /** Removed defined: + /*Removed defined: * The array of the removed workspace folders */ Removed []WorkspaceFolder `json:"removed"` } -// ConfigurationClientCapabilities is: -type ConfigurationClientCapabilities struct { - - /** Workspace defined: - * The workspace client capabilities - */ - Workspace *struct { - - /** Configuration defined: - * The client supports `workspace/configuration` requests. - */ - Configuration bool `json:"configuration,omitempty"` - } `json:"workspace,omitempty"` -} - -// ConfigurationItem is: +// ConfigurationItem is type ConfigurationItem struct { - /** ScopeURI defined: + /*ScopeURI defined: * The scope to get the configuration section for. */ ScopeURI string `json:"scopeUri,omitempty"` - /** Section defined: + /*Section defined: * The configuration section asked for. */ Section string `json:"section,omitempty"` } -// ConfigurationParams is: -/** +/*ConfigurationParams defined: * The parameters of a configuration request. */ type ConfigurationParams struct { @@ -214,151 +68,72 @@ type ConfigurationParams struct { Items []ConfigurationItem `json:"items"` } -// ColorClientCapabilities is: -type ColorClientCapabilities struct { - - /** TextDocument defined: - * The text document client capabilities - */ - TextDocument *struct { - - /** ColorProvider defined: - * Capabilities specific to the colorProvider - */ - ColorProvider *struct { - - /** DynamicRegistration defined: - * Whether implementation supports dynamic registration. If this is set to `true` - * the client supports the new `(ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` - * return value for the corresponding server capability as well. - */ - DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - } `json:"colorProvider,omitempty"` - } `json:"textDocument,omitempty"` -} - -// ColorProviderOptions is: +// ColorProviderOptions is type ColorProviderOptions struct { } -// ColorServerCapabilities is: -type ColorServerCapabilities struct { - - /** ColorProvider defined: - * The server provides color provider support. - */ - ColorProvider bool `json:"colorProvider,omitempty"` // boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions) -} - -// DocumentColorParams is: -/** +/*DocumentColorParams defined: * Parameters for a [DocumentColorRequest](#DocumentColorRequest). */ type DocumentColorParams struct { - /** TextDocument defined: + /*TextDocument defined: * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -// ColorPresentationParams is: -/** +/*ColorPresentationParams defined: * Parameters for a [ColorPresentationRequest](#ColorPresentationRequest). */ type ColorPresentationParams struct { - /** TextDocument defined: + /*TextDocument defined: * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Color defined: + /*Color defined: * The color to request presentations for. */ Color Color `json:"color"` - /** Range defined: + /*Range defined: * The range where the color would be inserted. Serves as a context. */ Range Range `json:"range"` } -// FoldingRangeClientCapabilities is: -type FoldingRangeClientCapabilities struct { - - /** TextDocument defined: - * The text document client capabilities - */ - TextDocument *struct { - - /** FoldingRange defined: - * Capabilities specific to `textDocument/foldingRange` requests - */ - FoldingRange *struct { - - /** DynamicRegistration defined: - * Whether implementation supports dynamic registration for folding range providers. If this is set to `true` - * the client supports the new `(FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` - * return value for the corresponding server capability as well. - */ - DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - - /** RangeLimit defined: - * 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. - */ - RangeLimit float64 `json:"rangeLimit,omitempty"` - - /** LineFoldingOnly defined: - * If set, the client signals that it only supports folding complete lines. If set, client will - * ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange. - */ - LineFoldingOnly bool `json:"lineFoldingOnly,omitempty"` - } `json:"foldingRange,omitempty"` - } `json:"textDocument,omitempty"` -} - -// FoldingRangeProviderOptions is: +// FoldingRangeProviderOptions is type FoldingRangeProviderOptions struct { } -// FoldingRangeServerCapabilities is: -type FoldingRangeServerCapabilities struct { - - /** FoldingRangeProvider defined: - * The server provides folding provider support. - */ - FoldingRangeProvider bool `json:"foldingRangeProvider,omitempty"` // boolean | FoldingRangeProviderOptions | (FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions) -} - -// FoldingRange is: -/** +/*FoldingRange defined: * Represents a folding range. */ type FoldingRange struct { - /** StartLine defined: + /*StartLine defined: * The zero-based line number from where the folded range starts. */ StartLine float64 `json:"startLine"` - /** StartCharacter defined: + /*StartCharacter defined: * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. */ StartCharacter float64 `json:"startCharacter,omitempty"` - /** EndLine defined: + /*EndLine defined: * The zero-based line number where the folded range ends. */ EndLine float64 `json:"endLine"` - /** EndCharacter defined: + /*EndCharacter defined: * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. */ EndCharacter float64 `json:"endCharacter,omitempty"` - /** Kind defined: + /*Kind defined: * Describes the kind of the folding range such as `comment' or 'region'. The kind * is used to categorize folding ranges and used by commands like 'Fold all comments'. See * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds. @@ -366,235 +141,176 @@ type FoldingRange struct { Kind string `json:"kind,omitempty"` } -// FoldingRangeParams is: -/** +/*FoldingRangeParams defined: * Parameters for a [FoldingRangeRequest](#FoldingRangeRequest). */ type FoldingRangeParams struct { - /** TextDocument defined: + /*TextDocument defined: * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -// DeclarationClientCapabilities is: -type DeclarationClientCapabilities struct { - - /** TextDocument defined: - * The text document client capabilities - */ - TextDocument *struct { - - /** Declaration defined: - * Capabilities specific to the `textDocument/declaration` - */ - Declaration *struct { - - /** DynamicRegistration defined: - * Whether declaration supports dynamic registration. If this is set to `true` - * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` - * return value for the corresponding server capability as well. - */ - DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - - /** LinkSupport defined: - * The client supports additional metadata in the form of declaration links. - */ - LinkSupport bool `json:"linkSupport,omitempty"` - } `json:"declaration,omitempty"` - } `json:"textDocument,omitempty"` -} - -// DeclarationServerCapabilities is: -type DeclarationServerCapabilities struct { - - /** DeclarationProvider defined: - * The server provides Goto Type Definition support. - */ - DeclarationProvider bool `json:"declarationProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) -} - -// SelectionRangeClientCapabilities is: -type SelectionRangeClientCapabilities struct { - - /** TextDocument defined: - * The text document client capabilities - */ - TextDocument *struct { - - /** SelectionRange defined: - * Capabilities specific to `textDocument/selectionRange` requests - */ - SelectionRange *struct { - - /** DynamicRegistration defined: - * Whether implementation supports dynamic registration for selection range providers. If this is set to `true` - * the client supports the new `(SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` - * return value for the corresponding server capability as well. - */ - DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - } `json:"selectionRange,omitempty"` - } `json:"textDocument,omitempty"` -} - -// SelectionRangeProviderOptions is: +// SelectionRangeProviderOptions is type SelectionRangeProviderOptions struct { } -// SelectionRangeServerCapabilities is: -type SelectionRangeServerCapabilities struct { - - /** SelectionRangeProvider defined: - * The server provides selection range support. - */ - SelectionRangeProvider bool `json:"selectionRangeProvider,omitempty"` // boolean | SelectionRangeProviderOptions | (SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions) -} - -// SelectionRange is: -/** +/*SelectionRange defined: * Represents a selection range */ type SelectionRange struct { - /** Range defined: + /*Range defined: * Range of the selection. */ Range Range `json:"range"` - /** Kind defined: + /*Kind defined: * Describes the kind of the selection range such as `statemet' or 'declaration'. See * [SelectionRangeKind](#SelectionRangeKind) for an enumeration of standardized kinds. */ Kind string `json:"kind"` } -// Registration is: -/** +/*SelectionRangeParams defined: + * A parameter literal used in selection range requests. + */ +type SelectionRangeParams struct { + + /*TextDocument defined: + * The text document. + */ + TextDocument TextDocumentIdentifier `json:"textDocument"` + + /*Positions defined: + * The positions inside the text document. + */ + Positions []Position `json:"positions"` +} + +/*Registration defined: * General parameters to to register for an notification or to register a provider. */ type Registration struct { - /** ID defined: + /*ID defined: * The id used to register the request. The id can be used to deregister * the request again. */ ID string `json:"id"` - /** Method defined: + /*Method defined: * The method to register for. */ Method string `json:"method"` - /** RegisterOptions defined: + /*RegisterOptions defined: * Options necessary for the registration. */ RegisterOptions interface{} `json:"registerOptions,omitempty"` } -// RegistrationParams is: +// RegistrationParams is type RegistrationParams struct { // Registrations is Registrations []Registration `json:"registrations"` } -// Unregistration is: -/** +/*Unregistration defined: * General parameters to unregister a request or notification. */ type Unregistration struct { - /** ID defined: + /*ID defined: * The id used to unregister the request or notification. Usually an id * provided during the register request. */ ID string `json:"id"` - /** Method defined: + /*Method defined: * The method to unregister for. */ Method string `json:"method"` } -// UnregistrationParams is: +// UnregistrationParams is type UnregistrationParams struct { // Unregisterations is Unregisterations []Unregistration `json:"unregisterations"` } -// TextDocumentPositionParams is: -/** +/*TextDocumentPositionParams defined: * A parameter literal used in requests to pass a text document and a position inside that * document. */ type TextDocumentPositionParams struct { - /** TextDocument defined: + /*TextDocument defined: * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Position defined: + /*Position defined: * The position inside the text document. */ Position Position `json:"position"` } -// WorkspaceClientCapabilities is: -/** +/*WorkspaceClientCapabilities defined: * Workspace specific client capabilities. */ type WorkspaceClientCapabilities struct { - /** ApplyEdit defined: + /*ApplyEdit defined: * The client supports applying batch edits * to the workspace by supporting the request * 'workspace/applyEdit' */ ApplyEdit bool `json:"applyEdit,omitempty"` - /** WorkspaceEdit defined: + /*WorkspaceEdit defined: * Capabilities specific to `WorkspaceEdit`s */ WorkspaceEdit *struct { - /** DocumentChanges defined: + /*DocumentChanges defined: * The client supports versioned document changes in `WorkspaceEdit`s */ DocumentChanges bool `json:"documentChanges,omitempty"` - /** ResourceOperations defined: + /*ResourceOperations defined: * The resource operations the client supports. Clients should at least * support 'create', 'rename' and 'delete' files and folders. */ ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"` - /** FailureHandling defined: + /*FailureHandling defined: * The failure handling strategy of a client if applying the workspace edit * failes. */ - FailureHandling *FailureHandlingKind `json:"failureHandling,omitempty"` + FailureHandling FailureHandlingKind `json:"failureHandling,omitempty"` } `json:"workspaceEdit,omitempty"` - /** DidChangeConfiguration defined: + /*DidChangeConfiguration defined: * Capabilities specific to the `workspace/didChangeConfiguration` notification. */ DidChangeConfiguration *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Did change configuration notification supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"didChangeConfiguration,omitempty"` - /** DidChangeWatchedFiles defined: + /*DidChangeWatchedFiles defined: * Capabilities specific to the `workspace/didChangeWatchedFiles` notification. */ DidChangeWatchedFiles *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Did change watched files notification supports dynamic registration. Please note * that the current protocol doesn't support static configuration for file changes * from the server side. @@ -602,22 +318,22 @@ type WorkspaceClientCapabilities struct { DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"didChangeWatchedFiles,omitempty"` - /** Symbol defined: + /*Symbol defined: * Capabilities specific to the `workspace/symbol` request. */ Symbol *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Symbol request supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** SymbolKind defined: + /*SymbolKind defined: * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. */ SymbolKind *struct { - /** ValueSet defined: + /*ValueSet defined: * 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 @@ -631,69 +347,68 @@ type WorkspaceClientCapabilities struct { } `json:"symbolKind,omitempty"` } `json:"symbol,omitempty"` - /** ExecuteCommand defined: + /*ExecuteCommand defined: * Capabilities specific to the `workspace/executeCommand` request. */ ExecuteCommand *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Execute command supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"executeCommand,omitempty"` } -// TextDocumentClientCapabilities is: -/** +/*TextDocumentClientCapabilities defined: * Text document specific client capabilities. */ type TextDocumentClientCapabilities struct { - /** Synchronization defined: + /*Synchronization defined: * Defines which synchronization capabilities the client supports. */ Synchronization *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether text document synchronization supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** WillSave defined: + /*WillSave defined: * The client supports sending will save notifications. */ WillSave bool `json:"willSave,omitempty"` - /** WillSaveWaitUntil defined: + /*WillSaveWaitUntil defined: * 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. */ WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"` - /** DidSave defined: + /*DidSave defined: * The client supports did save notifications. */ DidSave bool `json:"didSave,omitempty"` } `json:"synchronization,omitempty"` - /** Completion defined: + /*Completion defined: * Capabilities specific to the `textDocument/completion` */ Completion *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether completion supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** CompletionItem defined: + /*CompletionItem defined: * The client supports the following `CompletionItem` specific * capabilities. */ CompletionItem *struct { - /** SnippetSupport defined: + /*SnippetSupport defined: * Client supports snippets as insert text. * * A snippet can define tab stops and placeholders with `$1`, `$2` @@ -703,23 +418,23 @@ type TextDocumentClientCapabilities struct { */ SnippetSupport bool `json:"snippetSupport,omitempty"` - /** CommitCharactersSupport defined: + /*CommitCharactersSupport defined: * Client supports commit characters on a completion item. */ CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"` - /** DocumentationFormat defined: + /*DocumentationFormat defined: * Client supports the follow content formats for the documentation * property. The order describes the preferred format of the client. */ DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"` - /** DeprecatedSupport defined: + /*DeprecatedSupport defined: * Client supports the deprecated property on a completion item. */ DeprecatedSupport bool `json:"deprecatedSupport,omitempty"` - /** PreselectSupport defined: + /*PreselectSupport defined: * Client supports the preselect property on a completion item. */ PreselectSupport bool `json:"preselectSupport,omitempty"` @@ -728,7 +443,7 @@ type TextDocumentClientCapabilities struct { // CompletionItemKind is CompletionItemKind *struct { - /** ValueSet defined: + /*ValueSet defined: * 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 @@ -741,58 +456,58 @@ type TextDocumentClientCapabilities struct { ValueSet []CompletionItemKind `json:"valueSet,omitempty"` } `json:"completionItemKind,omitempty"` - /** ContextSupport defined: + /*ContextSupport defined: * The client supports to send additional context information for a * `textDocument/completion` requestion. */ ContextSupport bool `json:"contextSupport,omitempty"` } `json:"completion,omitempty"` - /** Hover defined: + /*Hover defined: * Capabilities specific to the `textDocument/hover` */ Hover *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether hover supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** ContentFormat defined: + /*ContentFormat defined: * Client supports the follow content formats for the content * property. The order describes the preferred format of the client. */ ContentFormat []MarkupKind `json:"contentFormat,omitempty"` } `json:"hover,omitempty"` - /** SignatureHelp defined: + /*SignatureHelp defined: * Capabilities specific to the `textDocument/signatureHelp` */ SignatureHelp *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether signature help supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** SignatureInformation defined: + /*SignatureInformation defined: * The client supports the following `SignatureInformation` * specific properties. */ SignatureInformation *struct { - /** DocumentationFormat defined: + /*DocumentationFormat defined: * Client supports the follow content formats for the documentation * property. The order describes the preferred format of the client. */ DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"` - /** ParameterInformation defined: + /*ParameterInformation defined: * Client capabilities specific to parameter information. */ ParameterInformation *struct { - /** LabelOffsetSupport defined: + /*LabelOffsetSupport defined: * The client supports processing label offsets instead of a * simple label string. */ @@ -801,44 +516,44 @@ type TextDocumentClientCapabilities struct { } `json:"signatureInformation,omitempty"` } `json:"signatureHelp,omitempty"` - /** References defined: + /*References defined: * Capabilities specific to the `textDocument/references` */ References *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether references supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"references,omitempty"` - /** DocumentHighlight defined: + /*DocumentHighlight defined: * Capabilities specific to the `textDocument/documentHighlight` */ DocumentHighlight *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether document highlight supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"documentHighlight,omitempty"` - /** DocumentSymbol defined: + /*DocumentSymbol defined: * Capabilities specific to the `textDocument/documentSymbol` */ DocumentSymbol *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether document symbol supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** SymbolKind defined: + /*SymbolKind defined: * Specific capabilities for the `SymbolKind`. */ SymbolKind *struct { - /** ValueSet defined: + /*ValueSet defined: * 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 @@ -851,84 +566,84 @@ type TextDocumentClientCapabilities struct { ValueSet []SymbolKind `json:"valueSet,omitempty"` } `json:"symbolKind,omitempty"` - /** HierarchicalDocumentSymbolSupport defined: + /*HierarchicalDocumentSymbolSupport defined: * The client support hierarchical document symbols. */ HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"` } `json:"documentSymbol,omitempty"` - /** Formatting defined: + /*Formatting defined: * Capabilities specific to the `textDocument/formatting` */ Formatting *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether formatting supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"formatting,omitempty"` - /** RangeFormatting defined: + /*RangeFormatting defined: * Capabilities specific to the `textDocument/rangeFormatting` */ RangeFormatting *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether range formatting supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"rangeFormatting,omitempty"` - /** OnTypeFormatting defined: + /*OnTypeFormatting defined: * Capabilities specific to the `textDocument/onTypeFormatting` */ OnTypeFormatting *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether on type formatting supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"onTypeFormatting,omitempty"` - /** Definition defined: + /*Definition defined: * Capabilities specific to the `textDocument/definition` */ Definition *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether definition supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** LinkSupport defined: + /*LinkSupport defined: * The client supports additional metadata in the form of definition links. */ LinkSupport bool `json:"linkSupport,omitempty"` } `json:"definition,omitempty"` - /** CodeAction defined: + /*CodeAction defined: * Capabilities specific to the `textDocument/codeAction` */ CodeAction *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether code action supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** CodeActionLiteralSupport defined: + /*CodeActionLiteralSupport defined: * The client support code action literals as a valid * response of the `textDocument/codeAction` request. */ CodeActionLiteralSupport *struct { - /** CodeActionKind defined: + /*CodeActionKind defined: * The code action kind is support with the following value * set. */ CodeActionKind struct { - /** ValueSet defined: + /*ValueSet defined: * 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 @@ -939,134 +654,668 @@ type TextDocumentClientCapabilities struct { } `json:"codeActionLiteralSupport,omitempty"` } `json:"codeAction,omitempty"` - /** CodeLens defined: + /*CodeLens defined: * Capabilities specific to the `textDocument/codeLens` */ CodeLens *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether code lens supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"codeLens,omitempty"` - /** DocumentLink defined: + /*DocumentLink defined: * Capabilities specific to the `textDocument/documentLink` */ DocumentLink *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether document link supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } `json:"documentLink,omitempty"` - /** Rename defined: + /*Rename defined: * Capabilities specific to the `textDocument/rename` */ Rename *struct { - /** DynamicRegistration defined: + /*DynamicRegistration defined: * Whether rename supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - /** PrepareSupport defined: + /*PrepareSupport defined: * Client supports testing for validity of rename operations * before execution. */ PrepareSupport bool `json:"prepareSupport,omitempty"` } `json:"rename,omitempty"` - /** PublishDiagnostics defined: + /*PublishDiagnostics defined: * Capabilities specific to `textDocument/publishDiagnostics`. */ PublishDiagnostics *struct { - /** RelatedInformation defined: + /*RelatedInformation defined: * Whether the clients accepts diagnostics with related information. */ RelatedInformation bool `json:"relatedInformation,omitempty"` - /** TagSupport defined: + /*TagSupport defined: * Client supports the tag property to provide meta data about a diagnostic. */ TagSupport bool `json:"tagSupport,omitempty"` } `json:"publishDiagnostics,omitempty"` } -// InnerClientCapabilities is: -/** - * Defines the capabilities provided by the client. - */ -type InnerClientCapabilities struct { +// ClientCapabilities is +type ClientCapabilities struct { - /** Workspace defined: + /*Workspace defined: * Workspace specific client capabilities. */ - Workspace *WorkspaceClientCapabilities `json:"workspace,omitempty"` + Workspace struct { - /** TextDocument defined: + /*ApplyEdit defined: + * The client supports applying batch edits + * to the workspace by supporting the request + * 'workspace/applyEdit' + */ + ApplyEdit bool `json:"applyEdit,omitempty"` + + /*WorkspaceEdit defined: + * Capabilities specific to `WorkspaceEdit`s + */ + WorkspaceEdit struct { + + /*DocumentChanges defined: + * The client supports versioned document changes in `WorkspaceEdit`s + */ + DocumentChanges bool `json:"documentChanges,omitempty"` + + /*ResourceOperations defined: + * The resource operations the client supports. Clients should at least + * support 'create', 'rename' and 'delete' files and folders. + */ + ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"` + + /*FailureHandling defined: + * The failure handling strategy of a client if applying the workspace edit + * failes. + */ + FailureHandling FailureHandlingKind `json:"failureHandling,omitempty"` + } `json:"workspaceEdit,omitempty"` + + /*DidChangeConfiguration defined: + * Capabilities specific to the `workspace/didChangeConfiguration` notification. + */ + DidChangeConfiguration struct { + + /*DynamicRegistration defined: + * Did change configuration notification supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"didChangeConfiguration,omitempty"` + + /*DidChangeWatchedFiles defined: + * Capabilities specific to the `workspace/didChangeWatchedFiles` notification. + */ + DidChangeWatchedFiles struct { + + /*DynamicRegistration defined: + * Did change watched files notification supports dynamic registration. Please note + * that the current protocol doesn't support static configuration for file changes + * from the server side. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"didChangeWatchedFiles,omitempty"` + + /*Symbol defined: + * Capabilities specific to the `workspace/symbol` request. + */ + Symbol struct { + + /*DynamicRegistration defined: + * Symbol request supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*SymbolKind defined: + * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request. + */ + SymbolKind struct { + + /*ValueSet defined: + * 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. + * + * If this property is not present the client only supports + * the symbol kinds from `File` to `Array` as defined in + * the initial version of the protocol. + */ + ValueSet []SymbolKind `json:"valueSet,omitempty"` + } `json:"symbolKind,omitempty"` + } `json:"symbol,omitempty"` + + /*ExecuteCommand defined: + * Capabilities specific to the `workspace/executeCommand` request. + */ + ExecuteCommand struct { + + /*DynamicRegistration defined: + * Execute command supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"executeCommand,omitempty"` + + /*WorkspaceFolders defined: + * The client has support for workspace folders + */ + WorkspaceFolders bool `json:"workspaceFolders,omitempty"` + + /*Configuration defined: + * The client supports `workspace/configuration` requests. + */ + Configuration bool `json:"configuration,omitempty"` + } `json:"workspace,omitempty"` + + /*TextDocument defined: * Text document specific client capabilities. */ - TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitempty"` + TextDocument struct { - /** Experimental defined: + /*Synchronization defined: + * Defines which synchronization capabilities the client supports. + */ + Synchronization struct { + + /*DynamicRegistration defined: + * Whether text document synchronization supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*WillSave defined: + * The client supports sending will save notifications. + */ + WillSave bool `json:"willSave,omitempty"` + + /*WillSaveWaitUntil defined: + * 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. + */ + WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"` + + /*DidSave defined: + * The client supports did save notifications. + */ + DidSave bool `json:"didSave,omitempty"` + } `json:"synchronization,omitempty"` + + /*Completion defined: + * Capabilities specific to the `textDocument/completion` + */ + Completion struct { + + /*DynamicRegistration defined: + * Whether completion supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*CompletionItem defined: + * The client supports the following `CompletionItem` specific + * capabilities. + */ + CompletionItem struct { + + /*SnippetSupport defined: + * Client supports snippets as insert text. + * + * 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. + */ + SnippetSupport bool `json:"snippetSupport,omitempty"` + + /*CommitCharactersSupport defined: + * Client supports commit characters on a completion item. + */ + CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"` + + /*DocumentationFormat defined: + * Client supports the follow content formats for the documentation + * property. The order describes the preferred format of the client. + */ + DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"` + + /*DeprecatedSupport defined: + * Client supports the deprecated property on a completion item. + */ + DeprecatedSupport bool `json:"deprecatedSupport,omitempty"` + + /*PreselectSupport defined: + * Client supports the preselect property on a completion item. + */ + PreselectSupport bool `json:"preselectSupport,omitempty"` + } `json:"completionItem,omitempty"` + + // CompletionItemKind is + CompletionItemKind struct { + + /*ValueSet defined: + * 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. + * + * If this property is not present the client only supports + * the completion items kinds from `Text` to `Reference` as defined in + * the initial version of the protocol. + */ + ValueSet []CompletionItemKind `json:"valueSet,omitempty"` + } `json:"completionItemKind,omitempty"` + + /*ContextSupport defined: + * The client supports to send additional context information for a + * `textDocument/completion` requestion. + */ + ContextSupport bool `json:"contextSupport,omitempty"` + } `json:"completion,omitempty"` + + /*Hover defined: + * Capabilities specific to the `textDocument/hover` + */ + Hover struct { + + /*DynamicRegistration defined: + * Whether hover supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*ContentFormat defined: + * Client supports the follow content formats for the content + * property. The order describes the preferred format of the client. + */ + ContentFormat []MarkupKind `json:"contentFormat,omitempty"` + } `json:"hover,omitempty"` + + /*SignatureHelp defined: + * Capabilities specific to the `textDocument/signatureHelp` + */ + SignatureHelp struct { + + /*DynamicRegistration defined: + * Whether signature help supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*SignatureInformation defined: + * The client supports the following `SignatureInformation` + * specific properties. + */ + SignatureInformation struct { + + /*DocumentationFormat defined: + * Client supports the follow content formats for the documentation + * property. The order describes the preferred format of the client. + */ + DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"` + + /*ParameterInformation defined: + * Client capabilities specific to parameter information. + */ + ParameterInformation struct { + + /*LabelOffsetSupport defined: + * The client supports processing label offsets instead of a + * simple label string. + */ + LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"` + } `json:"parameterInformation,omitempty"` + } `json:"signatureInformation,omitempty"` + } `json:"signatureHelp,omitempty"` + + /*References defined: + * Capabilities specific to the `textDocument/references` + */ + References struct { + + /*DynamicRegistration defined: + * Whether references supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"references,omitempty"` + + /*DocumentHighlight defined: + * Capabilities specific to the `textDocument/documentHighlight` + */ + DocumentHighlight struct { + + /*DynamicRegistration defined: + * Whether document highlight supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"documentHighlight,omitempty"` + + /*DocumentSymbol defined: + * Capabilities specific to the `textDocument/documentSymbol` + */ + DocumentSymbol struct { + + /*DynamicRegistration defined: + * Whether document symbol supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*SymbolKind defined: + * Specific capabilities for the `SymbolKind`. + */ + SymbolKind struct { + + /*ValueSet defined: + * 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. + * + * If this property is not present the client only supports + * the symbol kinds from `File` to `Array` as defined in + * the initial version of the protocol. + */ + ValueSet []SymbolKind `json:"valueSet,omitempty"` + } `json:"symbolKind,omitempty"` + + /*HierarchicalDocumentSymbolSupport defined: + * The client support hierarchical document symbols. + */ + HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"` + } `json:"documentSymbol,omitempty"` + + /*Formatting defined: + * Capabilities specific to the `textDocument/formatting` + */ + Formatting struct { + + /*DynamicRegistration defined: + * Whether formatting supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"formatting,omitempty"` + + /*RangeFormatting defined: + * Capabilities specific to the `textDocument/rangeFormatting` + */ + RangeFormatting struct { + + /*DynamicRegistration defined: + * Whether range formatting supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"rangeFormatting,omitempty"` + + /*OnTypeFormatting defined: + * Capabilities specific to the `textDocument/onTypeFormatting` + */ + OnTypeFormatting struct { + + /*DynamicRegistration defined: + * Whether on type formatting supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"onTypeFormatting,omitempty"` + + /*Definition defined: + * Capabilities specific to the `textDocument/definition` + */ + Definition struct { + + /*DynamicRegistration defined: + * Whether definition supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*LinkSupport defined: + * The client supports additional metadata in the form of definition links. + */ + LinkSupport bool `json:"linkSupport,omitempty"` + } `json:"definition,omitempty"` + + /*CodeAction defined: + * Capabilities specific to the `textDocument/codeAction` + */ + CodeAction struct { + + /*DynamicRegistration defined: + * Whether code action supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*CodeActionLiteralSupport defined: + * The client support code action literals as a valid + * response of the `textDocument/codeAction` request. + */ + CodeActionLiteralSupport struct { + + /*CodeActionKind defined: + * The code action kind is support with the following value + * set. + */ + CodeActionKind struct { + + /*ValueSet defined: + * 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. + */ + ValueSet []CodeActionKind `json:"valueSet"` + } `json:"codeActionKind"` + } `json:"codeActionLiteralSupport,omitempty"` + } `json:"codeAction,omitempty"` + + /*CodeLens defined: + * Capabilities specific to the `textDocument/codeLens` + */ + CodeLens struct { + + /*DynamicRegistration defined: + * Whether code lens supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"codeLens,omitempty"` + + /*DocumentLink defined: + * Capabilities specific to the `textDocument/documentLink` + */ + DocumentLink struct { + + /*DynamicRegistration defined: + * Whether document link supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"documentLink,omitempty"` + + /*Rename defined: + * Capabilities specific to the `textDocument/rename` + */ + Rename struct { + + /*DynamicRegistration defined: + * Whether rename supports dynamic registration. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*PrepareSupport defined: + * Client supports testing for validity of rename operations + * before execution. + */ + PrepareSupport bool `json:"prepareSupport,omitempty"` + } `json:"rename,omitempty"` + + /*PublishDiagnostics defined: + * Capabilities specific to `textDocument/publishDiagnostics`. + */ + PublishDiagnostics struct { + + /*RelatedInformation defined: + * Whether the clients accepts diagnostics with related information. + */ + RelatedInformation bool `json:"relatedInformation,omitempty"` + + /*TagSupport defined: + * Client supports the tag property to provide meta data about a diagnostic. + */ + TagSupport bool `json:"tagSupport,omitempty"` + } `json:"publishDiagnostics,omitempty"` + + /*Implementation defined: + * Capabilities specific to the `textDocument/implementation` + */ + Implementation struct { + + /*DynamicRegistration defined: + * Whether implementation supports dynamic registration. If this is set to `true` + * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + * return value for the corresponding server capability as well. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*LinkSupport defined: + * The client supports additional metadata in the form of definition links. + */ + LinkSupport bool `json:"linkSupport,omitempty"` + } `json:"implementation,omitempty"` + + /*TypeDefinition defined: + * Capabilities specific to the `textDocument/typeDefinition` + */ + TypeDefinition struct { + + /*DynamicRegistration defined: + * Whether implementation supports dynamic registration. If this is set to `true` + * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + * return value for the corresponding server capability as well. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*LinkSupport defined: + * The client supports additional metadata in the form of definition links. + */ + LinkSupport bool `json:"linkSupport,omitempty"` + } `json:"typeDefinition,omitempty"` + + /*ColorProvider defined: + * Capabilities specific to the colorProvider + */ + ColorProvider struct { + + /*DynamicRegistration defined: + * Whether implementation supports dynamic registration. If this is set to `true` + * the client supports the new `(ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` + * return value for the corresponding server capability as well. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"colorProvider,omitempty"` + + /*FoldingRange defined: + * Capabilities specific to `textDocument/foldingRange` requests + */ + FoldingRange struct { + + /*DynamicRegistration defined: + * Whether implementation supports dynamic registration for folding range providers. If this is set to `true` + * the client supports the new `(FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` + * return value for the corresponding server capability as well. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*RangeLimit defined: + * 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. + */ + RangeLimit float64 `json:"rangeLimit,omitempty"` + + /*LineFoldingOnly defined: + * If set, the client signals that it only supports folding complete lines. If set, client will + * ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange. + */ + LineFoldingOnly bool `json:"lineFoldingOnly,omitempty"` + } `json:"foldingRange,omitempty"` + + /*Declaration defined: + * Capabilities specific to the `textDocument/declaration` + */ + Declaration struct { + + /*DynamicRegistration defined: + * Whether declaration supports dynamic registration. If this is set to `true` + * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` + * return value for the corresponding server capability as well. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + + /*LinkSupport defined: + * The client supports additional metadata in the form of declaration links. + */ + LinkSupport bool `json:"linkSupport,omitempty"` + } `json:"declaration,omitempty"` + + /*SelectionRange defined: + * Capabilities specific to `textDocument/selectionRange` requests + */ + SelectionRange struct { + + /*DynamicRegistration defined: + * Whether implementation supports dynamic registration for selection range providers. If this is set to `true` + * the client supports the new `(SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)` + * return value for the corresponding server capability as well. + */ + DynamicRegistration bool `json:"dynamicRegistration,omitempty"` + } `json:"selectionRange,omitempty"` + } `json:"textDocument,omitempty"` + + /*Experimental defined: * Experimental client capabilities. */ Experimental interface{} `json:"experimental,omitempty"` } -// TODO(rstambler): Remove this when golang.org/issue/31090 is resolved. -type ClientCapabilities map[string]interface{} - -// clientCapabilities is: -type clientCapabilities struct { - InnerClientCapabilities - ImplementationClientCapabilities - TypeDefinitionClientCapabilities - WorkspaceFoldersClientCapabilities - ConfigurationClientCapabilities - ColorClientCapabilities - FoldingRangeClientCapabilities - DeclarationClientCapabilities - SelectionRangeClientCapabilities -} - -// StaticRegistrationOptions is: -/** +/*StaticRegistrationOptions defined: * Static registration options to be returned in the initialize * request. */ type StaticRegistrationOptions struct { - /** ID defined: + /*ID defined: * The id used to register the request. The id can be used to deregister * the request again. See also Registration#id. */ ID string `json:"id,omitempty"` } -// TextDocumentRegistrationOptions is: -/** +/*TextDocumentRegistrationOptions defined: * General text document registration options. */ type TextDocumentRegistrationOptions struct { - /** DocumentSelector defined: + /*DocumentSelector defined: * A document selector to identify the scope of the registration. If set to null * the document selector provided on the client side will be used. */ DocumentSelector DocumentSelector `json:"documentSelector"` } -// CompletionOptions is: -/** +/*CompletionOptions defined: * Completion options. */ type CompletionOptions struct { - /** TriggerCharacters defined: + /*TriggerCharacters defined: * Most tools trigger completion request automatically without explicitly requesting * it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user * starts to type an identifier. For example if the user types `c` in a JavaScript file @@ -1078,40 +1327,38 @@ type CompletionOptions struct { */ TriggerCharacters []string `json:"triggerCharacters,omitempty"` - /** AllCommitCharacters defined: + /*AllCommitCharacters defined: * The list of all possible characters that commit a completion. This field can be used * if clients don't support individual commmit characters per completion item. See * `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport` */ AllCommitCharacters []string `json:"allCommitCharacters,omitempty"` - /** ResolveProvider defined: + /*ResolveProvider defined: * The server provides support to resolve additional * information for a completion item. */ ResolveProvider bool `json:"resolveProvider,omitempty"` } -// SignatureHelpOptions is: -/** +/*SignatureHelpOptions defined: * Signature help options. */ type SignatureHelpOptions struct { - /** TriggerCharacters defined: + /*TriggerCharacters defined: * The characters that trigger signature help * automatically. */ TriggerCharacters []string `json:"triggerCharacters,omitempty"` } -// CodeActionOptions is: -/** +/*CodeActionOptions defined: * Code Action options. */ type CodeActionOptions struct { - /** CodeActionKinds defined: + /*CodeActionKinds defined: * CodeActionKinds that this server may return. * * The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server @@ -1120,252 +1367,283 @@ type CodeActionOptions struct { CodeActionKinds []CodeActionKind `json:"codeActionKinds,omitempty"` } -// CodeLensOptions is: -/** +/*CodeLensOptions defined: * Code Lens options. */ type CodeLensOptions struct { - /** ResolveProvider defined: + /*ResolveProvider defined: * Code lens has a resolve provider as well. */ ResolveProvider bool `json:"resolveProvider,omitempty"` } -// DocumentOnTypeFormattingOptions is: -/** +/*DocumentOnTypeFormattingOptions defined: * Format document on type options */ type DocumentOnTypeFormattingOptions struct { - /** FirstTriggerCharacter defined: + /*FirstTriggerCharacter defined: * A character on which formatting should be triggered, like `}`. */ FirstTriggerCharacter string `json:"firstTriggerCharacter"` - /** MoreTriggerCharacter defined: + /*MoreTriggerCharacter defined: * More trigger characters. */ MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"` } -// RenameOptions is: -/** +/*RenameOptions defined: * Rename options */ type RenameOptions struct { - /** PrepareProvider defined: + /*PrepareProvider defined: * Renames should be checked and tested before being executed. */ PrepareProvider bool `json:"prepareProvider,omitempty"` } -// DocumentLinkOptions is: -/** +/*DocumentLinkOptions defined: * Document link options */ type DocumentLinkOptions struct { - /** ResolveProvider defined: + /*ResolveProvider defined: * Document links have a resolve provider as well. */ ResolveProvider bool `json:"resolveProvider,omitempty"` } -// ExecuteCommandOptions is: -/** +/*ExecuteCommandOptions defined: * Execute command options. */ type ExecuteCommandOptions struct { - /** Commands defined: + /*Commands defined: * The commands to be executed on the server */ Commands []string `json:"commands"` } -// SaveOptions is: -/** +/*SaveOptions defined: * Save options. */ type SaveOptions struct { - /** IncludeText defined: + /*IncludeText defined: * The client is supposed to include the content on save. */ IncludeText bool `json:"includeText,omitempty"` } -// TextDocumentSyncOptions is: +// TextDocumentSyncOptions is type TextDocumentSyncOptions struct { - /** OpenClose defined: + /*OpenClose defined: * Open and close notifications are sent to the server. */ OpenClose bool `json:"openClose,omitempty"` - /** Change defined: + /*Change defined: * Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full * and TextDocumentSyncKind.Incremental. */ Change TextDocumentSyncKind `json:"change,omitempty"` - /** WillSave defined: + /*WillSave defined: * Will save notifications are sent to the server. */ WillSave bool `json:"willSave,omitempty"` - /** WillSaveWaitUntil defined: + /*WillSaveWaitUntil defined: * Will save wait until requests are sent to the server. */ WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"` - /** Save defined: + /*Save defined: * Save notifications are sent to the server. */ Save *SaveOptions `json:"save,omitempty"` } -// InnerServerCapabilities is: -/** - * Defines the capabilities provided by a language - * server. - */ -type InnerServerCapabilities struct { +// ServerCapabilities is +type ServerCapabilities struct { - /** TextDocumentSync defined: + /*TextDocumentSync defined: * Defines how text documents are synced. Is either a detailed structure defining each notification or * for backwards compatibility the TextDocumentSyncKind number. */ TextDocumentSync interface{} `json:"textDocumentSync,omitempty"` // TextDocumentSyncOptions | TextDocumentSyncKind - /** HoverProvider defined: + /*HoverProvider defined: * The server provides hover support. */ HoverProvider bool `json:"hoverProvider,omitempty"` - /** CompletionProvider defined: + /*CompletionProvider defined: * The server provides completion support. */ CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"` - /** SignatureHelpProvider defined: + /*SignatureHelpProvider defined: * The server provides signature help support. */ SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"` - /** DefinitionProvider defined: + /*DefinitionProvider defined: * The server provides goto definition support. */ DefinitionProvider bool `json:"definitionProvider,omitempty"` - /** ReferencesProvider defined: + /*ReferencesProvider defined: * The server provides find references support. */ ReferencesProvider bool `json:"referencesProvider,omitempty"` - /** DocumentHighlightProvider defined: + /*DocumentHighlightProvider defined: * The server provides document highlight support. */ DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"` - /** DocumentSymbolProvider defined: + /*DocumentSymbolProvider defined: * The server provides document symbol support. */ DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"` - /** WorkspaceSymbolProvider defined: + /*WorkspaceSymbolProvider defined: * The server provides workspace symbol support. */ WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"` - /** CodeActionProvider defined: + /*CodeActionProvider defined: * The server provides code actions. CodeActionOptions may only be * specified if the client states that it supports * `codeActionLiteralSupport` in its initial `initialize` request. */ CodeActionProvider bool `json:"codeActionProvider,omitempty"` // boolean | CodeActionOptions - /** CodeLensProvider defined: + /*CodeLensProvider defined: * The server provides code lens. */ CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"` - /** DocumentFormattingProvider defined: + /*DocumentFormattingProvider defined: * The server provides document formatting. */ DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"` - /** DocumentRangeFormattingProvider defined: + /*DocumentRangeFormattingProvider defined: * The server provides document range formatting. */ DocumentRangeFormattingProvider bool `json:"documentRangeFormattingProvider,omitempty"` - /** DocumentOnTypeFormattingProvider defined: + /*DocumentOnTypeFormattingProvider defined: * The server provides document formatting on typing. */ DocumentOnTypeFormattingProvider *struct { - /** FirstTriggerCharacter defined: + /*FirstTriggerCharacter defined: * A character on which formatting should be triggered, like `}`. */ FirstTriggerCharacter string `json:"firstTriggerCharacter"` - /** MoreTriggerCharacter defined: + /*MoreTriggerCharacter defined: * More trigger characters. */ MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"` } `json:"documentOnTypeFormattingProvider,omitempty"` - /** RenameProvider defined: + /*RenameProvider defined: * The server provides rename support. RenameOptions may only be * specified if the client states that it supports * `prepareSupport` in its initial `initialize` request. */ - RenameProvider bool `json:"renameProvider,omitempty"` // boolean | RenameOptions + RenameProvider *RenameOptions `json:"renameProvider,omitempty"` // boolean | RenameOptions - /** DocumentLinkProvider defined: + /*DocumentLinkProvider defined: * The server provides document link support. */ DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"` - /** ExecuteCommandProvider defined: + /*ExecuteCommandProvider defined: * The server provides execute command support. */ ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"` - /** Experimental defined: + /*Experimental defined: * Experimental server capabilities. */ Experimental interface{} `json:"experimental,omitempty"` + + /*ImplementationProvider defined: + * The server provides Goto Implementation support. + */ + ImplementationProvider bool `json:"implementationProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) + + /*TypeDefinitionProvider defined: + * The server provides Goto Type Definition support. + */ + TypeDefinitionProvider bool `json:"typeDefinitionProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) + + /*Workspace defined: + * The workspace server capabilities + */ + Workspace *struct { + + // WorkspaceFolders is + WorkspaceFolders *struct { + + /*Supported defined: + * The Server has support for workspace folders + */ + Supported bool `json:"supported,omitempty"` + + /*ChangeNotifications defined: + * Whether the server wants to receive workspace folder + * change notifications. + * + * If a strings is provided the string is treated as a ID + * under which the notification is registed on the client + * side. The ID can be used to unregister for these events + * using the `client/unregisterCapability` request. + */ + ChangeNotifications string `json:"changeNotifications,omitempty"` // string | boolean + } `json:"workspaceFolders,omitempty"` + } `json:"workspace,omitempty"` + + /*ColorProvider defined: + * The server provides color provider support. + */ + ColorProvider bool `json:"colorProvider,omitempty"` // boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions) + + /*FoldingRangeProvider defined: + * The server provides folding provider support. + */ + FoldingRangeProvider bool `json:"foldingRangeProvider,omitempty"` // boolean | FoldingRangeProviderOptions | (FoldingRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions) + + /*DeclarationProvider defined: + * The server provides Goto Type Definition support. + */ + DeclarationProvider bool `json:"declarationProvider,omitempty"` // boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions) + + /*SelectionRangeProvider defined: + * The server provides selection range support. + */ + SelectionRangeProvider bool `json:"selectionRangeProvider,omitempty"` // boolean | SelectionRangeProviderOptions | (SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions) } -// ServerCapabilities is: -type ServerCapabilities struct { - InnerServerCapabilities - ImplementationServerCapabilities - TypeDefinitionServerCapabilities - WorkspaceFoldersServerCapabilities - ColorServerCapabilities - FoldingRangeServerCapabilities - DeclarationServerCapabilities - SelectionRangeServerCapabilities -} +// InitializeParams is +type InitializeParams struct { -// InnerInitializeParams is: -/** - * The initialize parameters - */ -type InnerInitializeParams struct { - - /** ProcessID defined: + /*ProcessID defined: * The process Id of the parent process that started * the server. */ ProcessID float64 `json:"processId"` - /** RootPath defined: + /*RootPath defined: * The rootPath of the workspace. Is null * if no folder is open. * @@ -1373,7 +1651,7 @@ type InnerInitializeParams struct { */ RootPath string `json:"rootPath,omitempty"` - /** RootURI defined: + /*RootURI defined: * The rootUri of the workspace. Is null if no * folder is open. If both `rootPath` and `rootUri` are set * `rootUri` wins. @@ -1382,156 +1660,149 @@ type InnerInitializeParams struct { */ RootURI string `json:"rootUri"` - /** Capabilities defined: + /*Capabilities defined: * The capabilities provided by the client (editor or tool) */ Capabilities ClientCapabilities `json:"capabilities"` - /** InitializationOptions defined: + /*InitializationOptions defined: * User provided initialization options. */ InitializationOptions interface{} `json:"initializationOptions,omitempty"` - /** Trace defined: + /*Trace defined: * The initial trace setting. If omitted trace is disabled ('off'). */ Trace string `json:"trace,omitempty"` // 'off' | 'messages' | 'verbose' + + /*WorkspaceFolders defined: + * The actual configured workspace folders. + */ + WorkspaceFolders []WorkspaceFolder `json:"workspaceFolders"` } -// InitializeParams is: -type InitializeParams struct { - InnerInitializeParams - WorkspaceFoldersInitializeParams -} - -// InitializeResult is: -/** +/*InitializeResult defined: * The result returned from an initialize request. */ type InitializeResult struct { - /** Capabilities defined: + /*Capabilities defined: * The capabilities the language server provides. */ Capabilities ServerCapabilities `json:"capabilities"` - /** Custom defined: + /*Custom defined: * Custom initialization results. */ Custom map[string]interface{} `json:"custom"` // [custom: string]: any; } -// InitializedParams is: +// InitializedParams is type InitializedParams struct { } -// DidChangeConfigurationRegistrationOptions is: +// DidChangeConfigurationRegistrationOptions is type DidChangeConfigurationRegistrationOptions struct { // Section is Section string `json:"section,omitempty"` // string | string[] } -// DidChangeConfigurationParams is: -/** +/*DidChangeConfigurationParams defined: * The parameters of a change configuration notification. */ type DidChangeConfigurationParams struct { - /** Settings defined: + /*Settings defined: * The actual changed settings */ Settings interface{} `json:"settings"` } -// ShowMessageParams is: -/** +/*ShowMessageParams defined: * The parameters of a notification message. */ type ShowMessageParams struct { - /** Type defined: + /*Type defined: * The message type. See {@link MessageType} */ Type MessageType `json:"type"` - /** Message defined: + /*Message defined: * The actual message */ Message string `json:"message"` } -// MessageActionItem is: +// MessageActionItem is type MessageActionItem struct { - /** Title defined: + /*Title defined: * A short title like 'Retry', 'Open Log' etc. */ Title string `json:"title"` } -// ShowMessageRequestParams is: +// ShowMessageRequestParams is type ShowMessageRequestParams struct { - /** Type defined: + /*Type defined: * The message type. See {@link MessageType} */ Type MessageType `json:"type"` - /** Message defined: + /*Message defined: * The actual message */ Message string `json:"message"` - /** Actions defined: + /*Actions defined: * The message action items to present. */ Actions []MessageActionItem `json:"actions,omitempty"` } -// LogMessageParams is: -/** +/*LogMessageParams defined: * The log message parameters. */ type LogMessageParams struct { - /** Type defined: + /*Type defined: * The message type. See {@link MessageType} */ Type MessageType `json:"type"` - /** Message defined: + /*Message defined: * The actual message */ Message string `json:"message"` } -// DidOpenTextDocumentParams is: -/** +/*DidOpenTextDocumentParams defined: * The parameters send in a open text document notification */ type DidOpenTextDocumentParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document that was opened. */ TextDocument TextDocumentItem `json:"textDocument"` } -// DidChangeTextDocumentParams is: -/** +/*DidChangeTextDocumentParams defined: * The change text document notification's parameters. */ type DidChangeTextDocumentParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document that did change. The version number points * to the version after all provided content changes have * been applied. */ TextDocument VersionedTextDocumentIdentifier `json:"textDocument"` - /** ContentChanges defined: + /*ContentChanges defined: * The actual content changes. The content changes describe single state changes * to the document. So if there are two content changes c1 and c2 for a document * in state S then c1 move the document to S' and c2 to S''. @@ -1539,51 +1810,47 @@ type DidChangeTextDocumentParams struct { ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"` } -// TextDocumentChangeRegistrationOptions is: -/** +/*TextDocumentChangeRegistrationOptions defined: * Describe options to be used when registered for text document change events. */ type TextDocumentChangeRegistrationOptions struct { - TextDocumentRegistrationOptions - /** SyncKind defined: + /*SyncKind defined: * How documents are synced to the server. */ SyncKind TextDocumentSyncKind `json:"syncKind"` + TextDocumentRegistrationOptions } -// DidCloseTextDocumentParams is: -/** +/*DidCloseTextDocumentParams defined: * The parameters send in a close text document notification */ type DidCloseTextDocumentParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document that was closed. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -// DidSaveTextDocumentParams is: -/** +/*DidSaveTextDocumentParams defined: * The parameters send in a save text document notification */ type DidSaveTextDocumentParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document that was closed. */ TextDocument VersionedTextDocumentIdentifier `json:"textDocument"` - /** Text defined: + /*Text defined: * Optional the content when saved. Depends on the includeText value * when the save notification was requested. */ Text string `json:"text,omitempty"` } -// TextDocumentSaveRegistrationOptions is: -/** +/*TextDocumentSaveRegistrationOptions defined: * Save registration options. */ type TextDocumentSaveRegistrationOptions struct { @@ -1591,68 +1858,64 @@ type TextDocumentSaveRegistrationOptions struct { SaveOptions } -// WillSaveTextDocumentParams is: -/** +/*WillSaveTextDocumentParams defined: * The parameters send in a will save text document notification. */ type WillSaveTextDocumentParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document that will be saved. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Reason defined: + /*Reason defined: * The 'TextDocumentSaveReason'. */ Reason TextDocumentSaveReason `json:"reason"` } -// DidChangeWatchedFilesParams is: -/** +/*DidChangeWatchedFilesParams defined: * The watched files change notification's parameters. */ type DidChangeWatchedFilesParams struct { - /** Changes defined: + /*Changes defined: * The actual file events. */ Changes []FileEvent `json:"changes"` } -// FileEvent is: -/** +/*FileEvent defined: * An event describing a file change. */ type FileEvent struct { - /** URI defined: + /*URI defined: * The file's uri. */ URI string `json:"uri"` - /** Type defined: + /*Type defined: * The change type. */ Type FileChangeType `json:"type"` } -// DidChangeWatchedFilesRegistrationOptions is: -/** +/*DidChangeWatchedFilesRegistrationOptions defined: * Describe options to be used when registered for text document change events. */ type DidChangeWatchedFilesRegistrationOptions struct { - /** Watchers defined: + /*Watchers defined: * The watchers to register. */ Watchers []FileSystemWatcher `json:"watchers"` } -// FileSystemWatcher is: +// FileSystemWatcher is type FileSystemWatcher struct { - /** GlobPattern defined: + /*GlobPattern defined: * The glob pattern to watch. Glob patterns can have the following syntax: * - `*` to match one or more characters in a path segment * - `?` to match on one character in a path segment @@ -1663,7 +1926,7 @@ type FileSystemWatcher struct { */ GlobPattern string `json:"globPattern"` - /** Kind defined: + /*Kind defined: * The kind of events of interest. If omitted it defaults * to WatchKind.Create | WatchKind.Change | WatchKind.Delete * which is 7. @@ -1671,30 +1934,28 @@ type FileSystemWatcher struct { Kind float64 `json:"kind,omitempty"` } -// PublishDiagnosticsParams is: -/** +/*PublishDiagnosticsParams defined: * The publish diagnostic notification's parameters. */ type PublishDiagnosticsParams struct { - /** URI defined: + /*URI defined: * The URI for which diagnostic information is reported. */ URI string `json:"uri"` - /** Version defined: + /*Version defined: * Optional the version number of the document the diagnostics are published for. */ Version float64 `json:"version,omitempty"` - /** Diagnostics defined: + /*Diagnostics defined: * An array of diagnostic information items. */ Diagnostics []Diagnostic `json:"diagnostics"` } -// CompletionRegistrationOptions is: -/** +/*CompletionRegistrationOptions defined: * Completion registration options. */ type CompletionRegistrationOptions struct { @@ -1702,40 +1963,37 @@ type CompletionRegistrationOptions struct { CompletionOptions } -// CompletionContext is: -/** +/*CompletionContext defined: * Contains additional information about the context in which a completion request is triggered. */ type CompletionContext struct { - /** TriggerKind defined: + /*TriggerKind defined: * How the completion was triggered. */ TriggerKind CompletionTriggerKind `json:"triggerKind"` - /** TriggerCharacter defined: + /*TriggerCharacter defined: * The trigger character (a single character) that has trigger code complete. * Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` */ TriggerCharacter string `json:"triggerCharacter,omitempty"` } -// CompletionParams is: -/** +/*CompletionParams defined: * Completion parameters */ type CompletionParams struct { - TextDocumentPositionParams - /** Context defined: + /*Context defined: * The completion context. This is only available it the client specifies * to send this using `ClientCapabilities.textDocument.completion.contextSupport === true` */ Context *CompletionContext `json:"context,omitempty"` + TextDocumentPositionParams } -// SignatureHelpRegistrationOptions is: -/** +/*SignatureHelpRegistrationOptions defined: * Signature help registration options. */ type SignatureHelpRegistrationOptions struct { @@ -1743,59 +2001,55 @@ type SignatureHelpRegistrationOptions struct { SignatureHelpOptions } -// ReferenceParams is: -/** +/*ReferenceParams defined: * Parameters for a [ReferencesRequest](#ReferencesRequest). */ type ReferenceParams struct { - TextDocumentPositionParams // Context is Context ReferenceContext `json:"context"` + TextDocumentPositionParams } -// CodeActionParams is: -/** +/*CodeActionParams defined: * Params for the CodeActionRequest */ type CodeActionParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document in which the command was invoked. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Range defined: + /*Range defined: * The range for which the command was invoked. */ Range Range `json:"range"` - /** Context defined: + /*Context defined: * Context carrying additional information. */ Context CodeActionContext `json:"context"` } -// CodeActionRegistrationOptions is: +// CodeActionRegistrationOptions is type CodeActionRegistrationOptions struct { TextDocumentRegistrationOptions CodeActionOptions } -// CodeLensParams is: -/** +/*CodeLensParams defined: * Params for the Code Lens request. */ type CodeLensParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document to request code lens for. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -// CodeLensRegistrationOptions is: -/** +/*CodeLensRegistrationOptions defined: * Code Lens registration options. */ type CodeLensRegistrationOptions struct { @@ -1803,65 +2057,64 @@ type CodeLensRegistrationOptions struct { CodeLensOptions } -// DocumentFormattingParams is: +// DocumentFormattingParams is type DocumentFormattingParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document to format. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Options defined: + /*Options defined: * The format options */ Options FormattingOptions `json:"options"` } -// DocumentRangeFormattingParams is: +// DocumentRangeFormattingParams is type DocumentRangeFormattingParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document to format. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Range defined: + /*Range defined: * The range to format */ Range Range `json:"range"` - /** Options defined: + /*Options defined: * The format options */ Options FormattingOptions `json:"options"` } -// DocumentOnTypeFormattingParams is: +// DocumentOnTypeFormattingParams is type DocumentOnTypeFormattingParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document to format. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Position defined: + /*Position defined: * The position at which this request was send. */ Position Position `json:"position"` - /** Ch defined: + /*Ch defined: * The character that has been typed. */ Ch string `json:"ch"` - /** Options defined: + /*Options defined: * The format options. */ Options FormattingOptions `json:"options"` } -// DocumentOnTypeFormattingRegistrationOptions is: -/** +/*DocumentOnTypeFormattingRegistrationOptions defined: * Format document on type options */ type DocumentOnTypeFormattingRegistrationOptions struct { @@ -1869,20 +2122,20 @@ type DocumentOnTypeFormattingRegistrationOptions struct { DocumentOnTypeFormattingOptions } -// RenameParams is: +// RenameParams is type RenameParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document to rename. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - /** Position defined: + /*Position defined: * The position at which this request was sent. */ Position Position `json:"position"` - /** NewName defined: + /*NewName defined: * The new name of the symbol. If the given name is not valid the * request must return a [ResponseError](#ResponseError) with an * appropriate message set. @@ -1890,8 +2143,7 @@ type RenameParams struct { NewName string `json:"newName"` } -// RenameRegistrationOptions is: -/** +/*RenameRegistrationOptions defined: * Rename registration options. */ type RenameRegistrationOptions struct { @@ -1899,17 +2151,16 @@ type RenameRegistrationOptions struct { RenameOptions } -// DocumentLinkParams is: +// DocumentLinkParams is type DocumentLinkParams struct { - /** TextDocument defined: + /*TextDocument defined: * The document to provide document links for. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -// DocumentLinkRegistrationOptions is: -/** +/*DocumentLinkRegistrationOptions defined: * Document link registration options */ type DocumentLinkRegistrationOptions struct { @@ -1917,66 +2168,63 @@ type DocumentLinkRegistrationOptions struct { DocumentLinkOptions } -// ExecuteCommandParams is: +// ExecuteCommandParams is type ExecuteCommandParams struct { - /** Command defined: + /*Command defined: * The identifier of the actual command handler. */ Command string `json:"command"` - /** Arguments defined: + /*Arguments defined: * Arguments that the command should be invoked with. */ Arguments []interface{} `json:"arguments,omitempty"` } -// ExecuteCommandRegistrationOptions is: -/** +/*ExecuteCommandRegistrationOptions defined: * Execute command registration options. */ type ExecuteCommandRegistrationOptions struct { ExecuteCommandOptions } -// ApplyWorkspaceEditParams is: -/** +/*ApplyWorkspaceEditParams defined: * The parameters passed via a apply workspace edit request. */ type ApplyWorkspaceEditParams struct { - /** Label defined: + /*Label defined: * An optional label of the workspace edit. This label is * presented in the user interface for example on an undo * stack to undo the workspace edit. */ Label string `json:"label,omitempty"` - /** Edit defined: + /*Edit defined: * The edits to apply. */ Edit WorkspaceEdit `json:"edit"` } -// ApplyWorkspaceEditResponse is: -/** +/*ApplyWorkspaceEditResponse defined: * A response returned from the apply workspace edit request. */ type ApplyWorkspaceEditResponse struct { - /** Applied defined: + /*Applied defined: * Indicates whether the edit was applied or not. */ Applied bool `json:"applied"` - /** FailureReason defined: + /*FailureReason defined: * An optional textual description for why the edit was not applied. * This may be used by the server for diagnostic logging or to provide * a suitable error for a request that triggered the edit. */ FailureReason string `json:"failureReason,omitempty"` - /** FailedChange defined: + /*FailedChange defined: * Depending on the client's failure handling strategy `failedChange` might * contain the index of the change that failed. This property is only available * if the client signals a `failureHandlingStrategy` in its client capabilities. @@ -1984,8 +2232,7 @@ type ApplyWorkspaceEditResponse struct { FailedChange float64 `json:"failedChange,omitempty"` } -// Position is: -/** +/*Position defined: * Position in a text document expressed as zero-based line and character offset. * The offsets are based on a UTF-16 string representation. So a string of the form * `a𐐀b` the character offset of the character `a` is 0, the character offset of `𐐀` @@ -1997,14 +2244,14 @@ type ApplyWorkspaceEditResponse struct { */ type Position struct { - /** Line defined: + /*Line defined: * Line position in a document (zero-based). * If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. * If a line number is negative, it defaults to 0. */ Line float64 `json:"line"` - /** Character defined: + /*Character defined: * Character offset on a line in a document (zero-based). Assuming that the line is * represented as a string, the `character` value represents the gap between the * `character` and `character + 1`. @@ -2016,8 +2263,7 @@ type Position struct { Character float64 `json:"character"` } -// Range is: -/** +/*Range defined: * A range in a text document expressed as (zero-based) start and end positions. * * If you want to specify a range that contains a line including the line ending @@ -2032,19 +2278,18 @@ type Position struct { */ type Range struct { - /** Start defined: + /*Start defined: * The range's start position */ Start Position `json:"start"` - /** End defined: + /*End defined: * The range's end position. */ End Position `json:"end"` } -// Location is: -/** +/*Location defined: * Represents a location inside a resource, such as a line * inside a text file. */ @@ -2057,14 +2302,13 @@ type Location struct { Range Range `json:"range"` } -// LocationLink is: -/** +/*LocationLink defined: * Represents the connection of two locations. Provides additional metadata over normal [locations](#Location), * including an origin range. */ type LocationLink struct { - /** OriginSelectionRange defined: + /*OriginSelectionRange defined: * Span of the origin of this link. * * Used as the underlined span for mouse definition hover. Defaults to the word range at @@ -2072,161 +2316,156 @@ type LocationLink struct { */ OriginSelectionRange *Range `json:"originSelectionRange,omitempty"` - /** TargetURI defined: + /*TargetURI defined: * The target resource identifier of this link. */ TargetURI string `json:"targetUri"` - /** TargetRange defined: + /*TargetRange defined: * The full target range of this link. If the target for example is a symbol then target range is the * range enclosing this symbol not including leading/trailing whitespace but everything else * like comments. This information is typically used to highlight the range in the editor. */ TargetRange Range `json:"targetRange"` - /** TargetSelectionRange defined: + /*TargetSelectionRange defined: * The range that should be selected and revealed when this link is being followed, e.g the name of a function. * Must be contained by the the `targetRange`. See also `DocumentSymbol#range` */ TargetSelectionRange Range `json:"targetSelectionRange"` } -// Color is: -/** +/*Color defined: * Represents a color in RGBA space. */ type Color struct { - /** Red defined: + /*Red defined: * The red component of this color in the range [0-1]. */ Red float64 `json:"red"` - /** Green defined: + /*Green defined: * The green component of this color in the range [0-1]. */ Green float64 `json:"green"` - /** Blue defined: + /*Blue defined: * The blue component of this color in the range [0-1]. */ Blue float64 `json:"blue"` - /** Alpha defined: + /*Alpha defined: * The alpha component of this color in the range [0-1]. */ Alpha float64 `json:"alpha"` } -// ColorInformation is: -/** +/*ColorInformation defined: * Represents a color range from a document. */ type ColorInformation struct { - /** Range defined: + /*Range defined: * The range in the document where this color appers. */ Range Range `json:"range"` - /** Color defined: + /*Color defined: * The actual color value for this color range. */ Color Color `json:"color"` } -// ColorPresentation is: +// ColorPresentation is type ColorPresentation struct { - /** Label defined: + /*Label defined: * The label of this color presentation. It will be shown on the color * picker header. By default this is also the text that is inserted when selecting * this color presentation. */ Label string `json:"label"` - /** TextEdit defined: + /*TextEdit defined: * An [edit](#TextEdit) which is applied to a document when selecting * this presentation for the color. When `falsy` the [label](#ColorPresentation.label) * is used. */ TextEdit *TextEdit `json:"textEdit,omitempty"` - /** AdditionalTextEdits defined: + /*AdditionalTextEdits defined: * An optional array of additional [text edits](#TextEdit) that are applied when * selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves. */ AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"` } -// DiagnosticRelatedInformation is: -/** +/*DiagnosticRelatedInformation defined: * 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. */ type DiagnosticRelatedInformation struct { - /** Location defined: + /*Location defined: * The location of this related diagnostic information. */ Location Location `json:"location"` - /** Message defined: + /*Message defined: * The message of this related diagnostic information. */ Message string `json:"message"` } -// Diagnostic is: -/** +/*Diagnostic defined: * Represents a diagnostic, such as a compiler error or warning. Diagnostic objects * are only valid in the scope of a resource. */ type Diagnostic struct { - /** Range defined: + /*Range defined: * The range at which the message applies */ Range Range `json:"range"` - /** Severity defined: + /*Severity defined: * The diagnostic's severity. Can be omitted. If omitted it is up to the * client to interpret diagnostics as error, warning, info or hint. */ Severity DiagnosticSeverity `json:"severity,omitempty"` - /** Code defined: + /*Code defined: * The diagnostic's code, which usually appear in the user interface. */ Code interface{} `json:"code,omitempty"` // number | string - /** Source defined: + /*Source defined: * A human-readable string describing the source of this * diagnostic, e.g. 'typescript' or 'super lint'. It usually * appears in the user interface. */ Source string `json:"source,omitempty"` - /** Message defined: + /*Message defined: * The diagnostic's message. It usually appears in the user interface */ Message string `json:"message"` - /** Tags defined: + /*Tags defined: * Additional metadata about the diagnostic. */ Tags []DiagnosticTag `json:"tags,omitempty"` - /** RelatedInformation defined: + /*RelatedInformation defined: * An array of related diagnostic information, e.g. when symbol-names within * a scope collide all definitions can be marked via this property. */ RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitempty"` } -// Command is: -/** +/*Command defined: * 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 @@ -2234,205 +2473,193 @@ type Diagnostic struct { */ type Command struct { - /** Title defined: + /*Title defined: * Title of the command, like `save`. */ Title string `json:"title"` - /** Command defined: + /*Command defined: * The identifier of the actual command handler. */ Command string `json:"command"` - /** Arguments defined: + /*Arguments defined: * Arguments that the command handler should be * invoked with. */ Arguments []interface{} `json:"arguments,omitempty"` } -// TextEdit is: -/** +/*TextEdit defined: * A text edit applicable to a text document. */ type TextEdit struct { - /** Range defined: + /*Range defined: * The range of the text document to be manipulated. To insert * text into a document create a range where start === end. */ Range Range `json:"range"` - /** NewText defined: + /*NewText defined: * The string to be inserted. For delete operations use an * empty string. */ NewText string `json:"newText"` } -// TextDocumentEdit is: -/** +/*TextDocumentEdit defined: * Describes textual changes on a text document. */ type TextDocumentEdit struct { - /** TextDocument defined: + /*TextDocument defined: * The text document to change. */ TextDocument VersionedTextDocumentIdentifier `json:"textDocument"` - /** Edits defined: + /*Edits defined: * The edits to be applied. */ Edits []TextEdit `json:"edits"` } -// ResourceOperation is: +// ResourceOperation is type ResourceOperation struct { // Kind is Kind string `json:"kind"` } -// CreateFileOptions is: -/** +/*CreateFileOptions defined: * Options to create a file. */ type CreateFileOptions struct { - /** Overwrite defined: + /*Overwrite defined: * Overwrite existing file. Overwrite wins over `ignoreIfExists` */ Overwrite bool `json:"overwrite,omitempty"` - /** IgnoreIfExists defined: + /*IgnoreIfExists defined: * Ignore if exists. */ IgnoreIfExists bool `json:"ignoreIfExists,omitempty"` } -// CreateFile is: -/** +/*CreateFile defined: * Create file operation. */ type CreateFile struct { - ResourceOperation - /** Kind defined: + /*Kind defined: * A create */ Kind string `json:"kind"` // 'create' - /** URI defined: + /*URI defined: * The resource to create. */ URI string `json:"uri"` - /** Options defined: + /*Options defined: * Additional options */ Options *CreateFileOptions `json:"options,omitempty"` } -// RenameFileOptions is: -/** +/*RenameFileOptions defined: * Rename file options */ type RenameFileOptions struct { - /** Overwrite defined: + /*Overwrite defined: * Overwrite target if existing. Overwrite wins over `ignoreIfExists` */ Overwrite bool `json:"overwrite,omitempty"` - /** IgnoreIfExists defined: + /*IgnoreIfExists defined: * Ignores if target exists. */ IgnoreIfExists bool `json:"ignoreIfExists,omitempty"` } -// RenameFile is: -/** +/*RenameFile defined: * Rename file operation */ type RenameFile struct { - ResourceOperation - /** Kind defined: + /*Kind defined: * A rename */ Kind string `json:"kind"` // 'rename' - /** OldURI defined: + /*OldURI defined: * The old (existing) location. */ OldURI string `json:"oldUri"` - /** NewURI defined: + /*NewURI defined: * The new location. */ NewURI string `json:"newUri"` - /** Options defined: + /*Options defined: * Rename options. */ Options *RenameFileOptions `json:"options,omitempty"` } -// DeleteFileOptions is: -/** +/*DeleteFileOptions defined: * Delete file options */ type DeleteFileOptions struct { - /** Recursive defined: + /*Recursive defined: * Delete the content recursively if a folder is denoted. */ Recursive bool `json:"recursive,omitempty"` - /** IgnoreIfNotExists defined: + /*IgnoreIfNotExists defined: * Ignore the operation if the file doesn't exist. */ IgnoreIfNotExists bool `json:"ignoreIfNotExists,omitempty"` } -// DeleteFile is: -/** +/*DeleteFile defined: * Delete file operation */ type DeleteFile struct { - ResourceOperation - /** Kind defined: + /*Kind defined: * A delete */ Kind string `json:"kind"` // 'delete' - /** URI defined: + /*URI defined: * The file to delete. */ URI string `json:"uri"` - /** Options defined: + /*Options defined: * Delete options. */ Options *DeleteFileOptions `json:"options,omitempty"` } -// WorkspaceEdit is: -/** +/*WorkspaceEdit defined: * A workspace edit represents changes to many resources managed in the workspace. The edit * should either provide `changes` or `documentChanges`. If documentChanges are present * they are preferred over `changes` if the client can handle versioned document edits. */ type WorkspaceEdit struct { - /** Changes defined: + /*Changes defined: * Holds changes to existing resources. */ Changes *map[string][]TextEdit `json:"changes,omitempty"` // [uri: string]: TextEdit[]; - /** DocumentChanges defined: + /*DocumentChanges defined: * Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes * are either an array of `TextDocumentEdit`s to express changes to n different text documents * where each text document edit addresses a specific version of a text document. Or it can contain @@ -2447,33 +2674,29 @@ type WorkspaceEdit struct { DocumentChanges []TextDocumentEdit `json:"documentChanges,omitempty"` // (TextDocumentEdit | CreateFile | RenameFile | DeleteFile) } -// TextEditChange is: -/** +/*TextEditChange defined: * A change to capture text edits for existing resources. */ type TextEditChange struct { } -// TextDocumentIdentifier is: -/** +/*TextDocumentIdentifier defined: * A literal to identify a text document in the client. */ type TextDocumentIdentifier struct { - /** URI defined: + /*URI defined: * The text document's uri. */ URI string `json:"uri"` } -// VersionedTextDocumentIdentifier is: -/** +/*VersionedTextDocumentIdentifier defined: * An identifier to denote a specific version of a text document. */ type VersionedTextDocumentIdentifier struct { - TextDocumentIdentifier - /** Version defined: + /*Version defined: * The version number of this document. If a versioned text document identifier * is sent from the server to the client and the file is not open in the editor * (the server has not received an open notification before) the server can send @@ -2481,39 +2704,38 @@ type VersionedTextDocumentIdentifier struct { * truth (as speced with document content ownership). */ Version float64 `json:"version"` + TextDocumentIdentifier } -// TextDocumentItem is: -/** +/*TextDocumentItem defined: * An item to transfer a text document from the client to the * server. */ type TextDocumentItem struct { - /** URI defined: + /*URI defined: * The text document's uri. */ URI string `json:"uri"` - /** LanguageID defined: + /*LanguageID defined: * The text document's language identifier */ LanguageID string `json:"languageId"` - /** Version defined: + /*Version defined: * The version number of this document (it will increase after each * change, including undo/redo). */ Version float64 `json:"version"` - /** Text defined: + /*Text defined: * The content of the opened text document. */ Text string `json:"text"` } -// MarkupContent is: -/** +/*MarkupContent defined: * A `MarkupContent` literal represents a string value which content is interpreted base on its * kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds. * @@ -2539,54 +2761,53 @@ type TextDocumentItem struct { */ type MarkupContent struct { - /** Kind defined: + /*Kind defined: * The type of the Markup */ Kind MarkupKind `json:"kind"` - /** Value defined: + /*Value defined: * The content itself */ Value string `json:"value"` } -// CompletionItem is: -/** +/*CompletionItem defined: * A completion item represents a text snippet that is * proposed to complete text that is being typed. */ type CompletionItem struct { - /** Label defined: + /*Label defined: * The label of this completion item. By default * also the text that is inserted when selecting * this completion. */ Label string `json:"label"` - /** Kind defined: + /*Kind defined: * The kind of this completion item. Based of the kind * an icon is chosen by the editor. */ Kind CompletionItemKind `json:"kind,omitempty"` - /** Detail defined: + /*Detail defined: * A human-readable string with additional information * about this item, like type or symbol information. */ Detail string `json:"detail,omitempty"` - /** Documentation defined: + /*Documentation defined: * A human-readable string that represents a doc-comment. */ Documentation string `json:"documentation,omitempty"` // string | MarkupContent - /** Deprecated defined: + /*Deprecated defined: * Indicates if this item is deprecated. */ Deprecated bool `json:"deprecated,omitempty"` - /** Preselect defined: + /*Preselect defined: * Select this item when showing. * * *Note* that only one completion item can be selected and that the @@ -2595,21 +2816,21 @@ type CompletionItem struct { */ Preselect bool `json:"preselect,omitempty"` - /** SortText defined: + /*SortText defined: * A string that should be used when comparing this item * with other items. When `falsy` the [label](#CompletionItem.label) * is used. */ SortText string `json:"sortText,omitempty"` - /** FilterText defined: + /*FilterText defined: * A string that should be used when filtering a set of * completion items. When `falsy` the [label](#CompletionItem.label) * is used. */ FilterText string `json:"filterText,omitempty"` - /** InsertText defined: + /*InsertText defined: * A string that should be inserted into a document when selecting * this completion. When `falsy` the [label](#CompletionItem.label) * is used. @@ -2625,13 +2846,13 @@ type CompletionItem struct { */ InsertText string `json:"insertText,omitempty"` - /** InsertTextFormat defined: + /*InsertTextFormat defined: * The format of the insert text. The format applies to both the `insertText` property * and the `newText` property of a provided `textEdit`. */ InsertTextFormat InsertTextFormat `json:"insertTextFormat,omitempty"` - /** TextEdit defined: + /*TextEdit defined: * An [edit](#TextEdit) which is applied to a document when selecting * this completion. When an edit is provided the value of * [insertText](#CompletionItem.insertText) is ignored. @@ -2641,7 +2862,7 @@ type CompletionItem struct { */ TextEdit *TextEdit `json:"textEdit,omitempty"` - /** AdditionalTextEdits defined: + /*AdditionalTextEdits defined: * An optional array of additional [text edits](#TextEdit) that are applied when * selecting this completion. Edits must not overlap (including the same insert position) * with the main [edit](#CompletionItem.textEdit) nor with themselves. @@ -2652,21 +2873,21 @@ type CompletionItem struct { */ AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"` - /** CommitCharacters defined: + /*CommitCharacters defined: * An optional set of characters that when pressed while this completion is active will accept it first and * then type that character. *Note* that all commit characters should have `length=1` and that superfluous * characters will be ignored. */ CommitCharacters []string `json:"commitCharacters,omitempty"` - /** Command defined: + /*Command defined: * An optional [command](#Command) that is executed *after* inserting this completion. *Note* that * additional modifications to the current document should be described with the * [additionalTextEdits](#CompletionItem.additionalTextEdits)-property. */ Command *Command `json:"command,omitempty"` - /** Data defined: + /*Data defined: * An data entry field that is preserved on a completion item between * a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest] * (#CompletionResolveRequest) @@ -2674,49 +2895,46 @@ type CompletionItem struct { Data interface{} `json:"data,omitempty"` } -// CompletionList is: -/** +/*CompletionList defined: * Represents a collection of [completion items](#CompletionItem) to be presented * in the editor. */ type CompletionList struct { - /** IsIncomplete defined: + /*IsIncomplete defined: * This list it not complete. Further typing results in recomputing this list. */ IsIncomplete bool `json:"isIncomplete"` - /** Items defined: + /*Items defined: * The completion items. */ Items []CompletionItem `json:"items"` } -// Hover is: -/** +/*Hover defined: * The result of a hover request. */ type Hover struct { - /** Contents defined: + /*Contents defined: * The hover's content */ Contents MarkupContent `json:"contents"` // MarkupContent | MarkedString | MarkedString[] - /** Range defined: + /*Range defined: * An optional range */ Range *Range `json:"range,omitempty"` } -// ParameterInformation is: -/** +/*ParameterInformation defined: * Represents a parameter of a callable-signature. A parameter can * have a label and a doc-comment. */ type ParameterInformation struct { - /** Label defined: + /*Label defined: * The label of this parameter information. * * Either a string or an inclusive start and exclusive end offsets within its containing @@ -2728,120 +2946,115 @@ type ParameterInformation struct { */ Label string `json:"label"` // string | [number, number] - /** Documentation defined: + /*Documentation defined: * The human-readable doc-comment of this signature. Will be shown * in the UI but can be omitted. */ Documentation string `json:"documentation,omitempty"` // string | MarkupContent } -// SignatureInformation is: -/** +/*SignatureInformation defined: * Represents the signature of something callable. A signature * can have a label, like a function-name, a doc-comment, and * a set of parameters. */ type SignatureInformation struct { - /** Label defined: + /*Label defined: * The label of this signature. Will be shown in * the UI. */ Label string `json:"label"` - /** Documentation defined: + /*Documentation defined: * The human-readable doc-comment of this signature. Will be shown * in the UI but can be omitted. */ Documentation string `json:"documentation,omitempty"` // string | MarkupContent - /** Parameters defined: + /*Parameters defined: * The parameters of this signature. */ Parameters []ParameterInformation `json:"parameters,omitempty"` } -// SignatureHelp is: -/** +/*SignatureHelp defined: * Signature help represents the signature of something * callable. There can be multiple signature but only one * active and only one active parameter. */ type SignatureHelp struct { - /** Signatures defined: + /*Signatures defined: * One or more signatures. */ Signatures []SignatureInformation `json:"signatures"` - /** ActiveSignature defined: + /*ActiveSignature defined: * The active signature. Set to `null` if no * signatures exist. */ ActiveSignature float64 `json:"activeSignature"` - /** ActiveParameter defined: + /*ActiveParameter defined: * The active parameter of the active signature. Set to `null` * if the active signature has no parameters. */ ActiveParameter float64 `json:"activeParameter"` } -// ReferenceContext is: -/** +/*ReferenceContext defined: * Value-object that contains additional information when * requesting references. */ type ReferenceContext struct { - /** IncludeDeclaration defined: + /*IncludeDeclaration defined: * Include the declaration of the current symbol. */ IncludeDeclaration bool `json:"includeDeclaration"` } -// DocumentHighlight is: -/** +/*DocumentHighlight defined: * 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. */ type DocumentHighlight struct { - /** Range defined: + /*Range defined: * The range this highlight applies to. */ Range Range `json:"range"` - /** Kind defined: + /*Kind defined: * The highlight kind, default is [text](#DocumentHighlightKind.Text). */ Kind *DocumentHighlightKind `json:"kind,omitempty"` } -// SymbolInformation is: -/** +/*SymbolInformation defined: * Represents information about programming constructs like variables, classes, * interfaces etc. */ type SymbolInformation struct { - /** Name defined: + /*Name defined: * The name of this symbol. */ Name string `json:"name"` - /** Kind defined: + /*Kind defined: * The kind of this symbol. */ Kind SymbolKind `json:"kind"` - /** Deprecated defined: + /*Deprecated defined: * Indicates if this symbol is deprecated. */ Deprecated bool `json:"deprecated,omitempty"` - /** Location defined: + /*Location defined: * The location of this symbol. The location's range is used by a tool * to reveal the location in the editor. If the symbol is selected in the * tool the range's start information is used to position the cursor. So @@ -2854,7 +3067,7 @@ type SymbolInformation struct { */ Location Location `json:"location"` - /** ContainerName defined: + /*ContainerName defined: * The name of the symbol containing this symbol. This information is for * user interface purposes (e.g. to render a qualifier in the user interface * if necessary). It can't be used to re-infer a hierarchy for the document @@ -2863,8 +3076,7 @@ type SymbolInformation struct { ContainerName string `json:"containerName,omitempty"` } -// DocumentSymbol is: -/** +/*DocumentSymbol defined: * Represents programming constructs like variables, classes, interfaces etc. * that appear in a document. Document symbols can be hierarchical and they * have two ranges: one that encloses its definition and one that points to @@ -2872,78 +3084,75 @@ type SymbolInformation struct { */ type DocumentSymbol struct { - /** Name defined: + /*Name defined: * The name of this symbol. Will be displayed in the user interface and therefore must not be * an empty string or a string only consisting of white spaces. */ Name string `json:"name"` - /** Detail defined: + /*Detail defined: * More detail for this symbol, e.g the signature of a function. */ Detail string `json:"detail,omitempty"` - /** Kind defined: + /*Kind defined: * The kind of this symbol. */ Kind SymbolKind `json:"kind"` - /** Deprecated defined: + /*Deprecated defined: * Indicates if this symbol is deprecated. */ Deprecated bool `json:"deprecated,omitempty"` - /** Range defined: + /*Range defined: * The range enclosing this symbol not including leading/trailing whitespace but everything else * like comments. This information is typically used to determine if the the clients cursor is * inside the symbol to reveal in the symbol in the UI. */ Range Range `json:"range"` - /** SelectionRange defined: + /*SelectionRange defined: * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. * Must be contained by the the `range`. */ SelectionRange Range `json:"selectionRange"` - /** Children defined: + /*Children defined: * Children of this symbol, e.g. properties of a class. */ Children []DocumentSymbol `json:"children,omitempty"` } -// DocumentSymbolParams is: -/** +/*DocumentSymbolParams defined: * Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest). */ type DocumentSymbolParams struct { - /** TextDocument defined: + /*TextDocument defined: * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -// WorkspaceSymbolParams is: -/** +/*WorkspaceSymbolParams defined: * The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). */ type WorkspaceSymbolParams struct { - /** Query defined: + /*Query defined: * A non-empty query string */ Query string `json:"query"` } -// CodeActionContext is: -/** +/*CodeActionContext defined: * Contains additional diagnostic information about the context in which * a [code action](#CodeActionProvider.provideCodeActions) is run. */ type CodeActionContext struct { - /** Diagnostics defined: + /*Diagnostics defined: * An array of diagnostics known on the client side overlapping the range provided to the * `textDocument/codeAction` request. They are provied so that the server knows which * errors are currently presented to the user for the given range. There is no guarantee @@ -2952,7 +3161,7 @@ type CodeActionContext struct { */ Diagnostics []Diagnostic `json:"diagnostics"` - /** Only defined: + /*Only defined: * Requested kind of actions to return. * * Actions not of this kind are filtered out by the client before being shown. So servers @@ -2961,8 +3170,7 @@ type CodeActionContext struct { Only []CodeActionKind `json:"only,omitempty"` } -// CodeAction is: -/** +/*CodeAction defined: * A code action represents a change that can be performed in code, e.g. to fix a problem or * to refactor code. * @@ -2970,29 +3178,29 @@ type CodeActionContext struct { */ type CodeAction struct { - /** Title defined: + /*Title defined: * A short, human-readable, title for this code action. */ Title string `json:"title"` - /** Kind defined: + /*Kind defined: * The kind of the code action. * * Used to filter code actions. */ Kind CodeActionKind `json:"kind,omitempty"` - /** Diagnostics defined: + /*Diagnostics defined: * The diagnostics that this code action resolves. */ Diagnostics []Diagnostic `json:"diagnostics,omitempty"` - /** Edit defined: + /*Edit defined: * The workspace edit this code action performs. */ Edit *WorkspaceEdit `json:"edit,omitempty"` - /** Command defined: + /*Command defined: * 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. @@ -3000,8 +3208,7 @@ type CodeAction struct { Command *Command `json:"command,omitempty"` } -// CodeLens is: -/** +/*CodeLens defined: * A code lens represents a [command](#Command) that should be shown along with * source text, like the number of references, a way to run tests, etc. * @@ -3010,17 +3217,17 @@ type CodeAction struct { */ type CodeLens struct { - /** Range defined: + /*Range defined: * The range in which this code lens is valid. Should only span a single line. */ Range Range `json:"range"` - /** Command defined: + /*Command defined: * The command this code lens represents. */ Command *Command `json:"command,omitempty"` - /** Data defined: + /*Data defined: * An data entry field that is preserved on a code lens item between * a [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest] * (#CodeLensResolveRequest) @@ -3028,74 +3235,71 @@ type CodeLens struct { Data interface{} `json:"data,omitempty"` } -// FormattingOptions is: -/** +/*FormattingOptions defined: * Value-object describing what options formatting should use. */ type FormattingOptions struct { - /** TabSize defined: + /*TabSize defined: * Size of a tab in spaces. */ TabSize float64 `json:"tabSize"` - /** InsertSpaces defined: + /*InsertSpaces defined: * Prefer spaces over tabs. */ InsertSpaces bool `json:"insertSpaces"` - /** TrimTrailingWhitespace defined: + /*TrimTrailingWhitespace defined: * Trim trailing whitespaces on a line. */ TrimTrailingWhitespace bool `json:"trimTrailingWhitespace,omitempty"` - /** InsertFinalNewline defined: + /*InsertFinalNewline defined: * Insert a newline character at the end of the file if one does not exist. */ InsertFinalNewline bool `json:"insertFinalNewline,omitempty"` - /** TrimFinalNewlines defined: + /*TrimFinalNewlines defined: * Trim all newlines after the final newline at the end of the file. */ TrimFinalNewlines bool `json:"trimFinalNewlines,omitempty"` - /** Key defined: + /*Key defined: * Signature for further properties. */ Key map[string]bool `json:"key"` // [key: string]: boolean | number | string | undefined; } -// DocumentLink is: -/** +/*DocumentLink defined: * 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. */ type DocumentLink struct { - /** Range defined: + /*Range defined: * The range this link applies to. */ Range Range `json:"range"` - /** Target defined: + /*Target defined: * The uri this link points to. */ Target string `json:"target,omitempty"` - /** Data defined: + /*Data defined: * A data entry field that is preserved on a document link between a * DocumentLinkRequest and a DocumentLinkResolveRequest. */ Data interface{} `json:"data,omitempty"` } -// TextDocument is: -/** +/*TextDocument defined: * A simple text document. Not to be implemented. */ type TextDocument struct { - /** URI defined: + /*URI defined: * The associated URI for this document. Most documents have the __file__-scheme, indicating that they * represent files on disk. However, some documents may have other schemes indicating that they are not * available on disk. @@ -3104,14 +3308,14 @@ type TextDocument struct { */ URI string `json:"uri"` - /** LanguageID defined: + /*LanguageID defined: * The identifier of the language associated with this document. * * @readonly */ LanguageID string `json:"languageId"` - /** Version defined: + /*Version defined: * The version number of this document (it will increase after each * change, including undo/redo). * @@ -3119,7 +3323,7 @@ type TextDocument struct { */ Version float64 `json:"version"` - /** LineCount defined: + /*LineCount defined: * The number of lines in this document. * * @readonly @@ -3127,50 +3331,48 @@ type TextDocument struct { LineCount float64 `json:"lineCount"` } -// TextDocumentChangeEvent is: -/** +/*TextDocumentChangeEvent defined: * Event to signal changes to a simple text document. */ type TextDocumentChangeEvent struct { - /** Document defined: + /*Document defined: * The document that has changed. */ Document TextDocument `json:"document"` } -// TextDocumentWillSaveEvent is: +// TextDocumentWillSaveEvent is type TextDocumentWillSaveEvent struct { - /** Document defined: + /*Document defined: * The document that will be saved */ Document TextDocument `json:"document"` - /** Reason defined: + /*Reason defined: * The reason why save was triggered. */ Reason TextDocumentSaveReason `json:"reason"` } -// TextDocumentContentChangeEvent is: -/** +/*TextDocumentContentChangeEvent defined: * An event describing a change to a text document. If range and rangeLength are omitted * the new text is considered to be the full content of the document. */ type TextDocumentContentChangeEvent struct { - /** Range defined: + /*Range defined: * The range of the document that changed. */ Range *Range `json:"range,omitempty"` - /** RangeLength defined: + /*RangeLength defined: * The length of the range that got replaced. */ RangeLength float64 `json:"rangeLength,omitempty"` - /** Text defined: + /*Text defined: * The new text of the document. */ Text string `json:"text"` @@ -3235,214 +3437,181 @@ type TextDocumentSaveReason float64 const ( - // Comment is: - /** + /*Comment defined: * Folding range for a comment */ Comment FoldingRangeKind = "comment" - // Imports is: - /** + /*Imports defined: * Folding range for a imports or includes */ Imports FoldingRangeKind = "imports" - // Region is: - /** + /*Region defined: * Folding range for a region (e.g. `#region`) */ Region FoldingRangeKind = "region" - // Empty is: - /** + /*Empty defined: * Empty Kind. */ Empty SelectionRangeKind = "" - // Statement is: - /** + /*Statement defined: * The statment kind, its value is `statement`, possible extensions can be * `statement.if` etc */ Statement SelectionRangeKind = "statement" - // Declaration is: - /** + /*Declaration defined: * The declaration kind, its value is `declaration`, possible extensions can be * `declaration.function`, `declaration.class` etc. */ Declaration SelectionRangeKind = "declaration" - // Create is: - /** + /*Create defined: * Supports creating new files and folders. */ Create ResourceOperationKind = "create" - // Rename is: - /** + /*Rename defined: * Supports renaming existing files and folders. */ Rename ResourceOperationKind = "rename" - // Delete is: - /** + /*Delete defined: * Supports deleting existing files and folders. */ Delete ResourceOperationKind = "delete" - // Abort is: - /** + /*Abort defined: * Applying the workspace change is simply aborted if one of the changes provided * fails. All operations executed before the failing operation stay executed. */ Abort FailureHandlingKind = "abort" - // Transactional is: - /** + /*Transactional defined: * All operations are executed transactional. That means they either all * succeed or no changes at all are applied to the workspace. */ Transactional FailureHandlingKind = "transactional" - // TextOnlyTransactional is: - /** + /*TextOnlyTransactional defined: * If the workspace edit contains only textual file changes they are executed transactional. * If resource changes (create, rename or delete file) are part of the change the failure * handling startegy is abort. */ TextOnlyTransactional FailureHandlingKind = "textOnlyTransactional" - // Undo is: - /** + /*Undo defined: * The client tries to undo the operations already executed. But there is no * guaruntee that this is succeeding. */ Undo FailureHandlingKind = "undo" - // None is: - /** + /*None defined: * Documents should not be synced at all. */ None TextDocumentSyncKind = 0 - // Full is: - /** + /*Full defined: * Documents are synced by always sending the full content * of the document. */ Full TextDocumentSyncKind = 1 - // Incremental is: - /** + /*Incremental defined: * Documents are synced by sending the full content on open. * After that only incremental updates to the document are * send. */ Incremental TextDocumentSyncKind = 2 - // UnknownProtocolVersion is: - /** + /*UnknownProtocolVersion defined: * If the protocol version provided by the client can't be handled by the server. * @deprecated This initialize error got replaced by client capabilities. There is * no version handshake in version 3.0x */ UnknownProtocolVersion InitializeError = 1 - // Error is: - /** + /*Error defined: * An error message. */ Error MessageType = 1 - // Warning is: - /** + /*Warning defined: * A warning message. */ Warning MessageType = 2 - // Info is: - /** + /*Info defined: * An information message. */ Info MessageType = 3 - // Log is: - /** + /*Log defined: * A log message. */ Log MessageType = 4 - // Created is: - /** + /*Created defined: * The file got created. */ Created FileChangeType = 1 - // Changed is: - /** + /*Changed defined: * The file got changed. */ Changed FileChangeType = 2 - // Deleted is: - /** + /*Deleted defined: * The file got deleted. */ Deleted FileChangeType = 3 - // Change is: - /** + /*Change defined: * Interested in change events */ Change WatchKind = 2 - // Invoked is: - /** + /*Invoked defined: * Completion was triggered by typing an identifier (24x7 code * complete), manual invocation (e.g Ctrl+Space) or via API. */ Invoked CompletionTriggerKind = 1 - // TriggerCharacter is: - /** + /*TriggerCharacter defined: * Completion was triggered by a trigger character specified by * the `triggerCharacters` properties of the `CompletionRegistrationOptions`. */ TriggerCharacter CompletionTriggerKind = 2 - // TriggerForIncompleteCompletions is: - /** + /*TriggerForIncompleteCompletions defined: * Completion was re-triggered as current completion list is incomplete */ TriggerForIncompleteCompletions CompletionTriggerKind = 3 - // SeverityError is: - /** + /*SeverityError defined: * Reports an error. */ SeverityError DiagnosticSeverity = 1 - // SeverityWarning is: - /** + /*SeverityWarning defined: * Reports a warning. */ SeverityWarning DiagnosticSeverity = 2 - // SeverityInformation is: - /** + /*SeverityInformation defined: * Reports an information. */ SeverityInformation DiagnosticSeverity = 3 - // SeverityHint is: - /** + /*SeverityHint defined: * Reports a hint. */ SeverityHint DiagnosticSeverity = 4 - // Unnecessary is: - /** + /*Unnecessary defined: * Unused or unnecessary code. * * Clients are allowed to render diagnostics with this tag faded out instead of having @@ -3450,101 +3619,97 @@ const ( */ Unnecessary DiagnosticTag = 1 - // PlainText is: - /** + /*PlainText defined: * Plain text is supported as a content format */ PlainText MarkupKind = "plaintext" - // Markdown is: - /** + /*Markdown defined: * Markdown is supported as a content format */ Markdown MarkupKind = "markdown" - // TextCompletion is: + // TextCompletion is TextCompletion CompletionItemKind = 1 - // MethodCompletion is: + // MethodCompletion is MethodCompletion CompletionItemKind = 2 - // FunctionCompletion is: + // FunctionCompletion is FunctionCompletion CompletionItemKind = 3 - // ConstructorCompletion is: + // ConstructorCompletion is ConstructorCompletion CompletionItemKind = 4 - // FieldCompletion is: + // FieldCompletion is FieldCompletion CompletionItemKind = 5 - // VariableCompletion is: + // VariableCompletion is VariableCompletion CompletionItemKind = 6 - // ClassCompletion is: + // ClassCompletion is ClassCompletion CompletionItemKind = 7 - // InterfaceCompletion is: + // InterfaceCompletion is InterfaceCompletion CompletionItemKind = 8 - // ModuleCompletion is: + // ModuleCompletion is ModuleCompletion CompletionItemKind = 9 - // PropertyCompletion is: + // PropertyCompletion is PropertyCompletion CompletionItemKind = 10 - // UnitCompletion is: + // UnitCompletion is UnitCompletion CompletionItemKind = 11 - // ValueCompletion is: + // ValueCompletion is ValueCompletion CompletionItemKind = 12 - // EnumCompletion is: + // EnumCompletion is EnumCompletion CompletionItemKind = 13 - // KeywordCompletion is: + // KeywordCompletion is KeywordCompletion CompletionItemKind = 14 - // SnippetCompletion is: + // SnippetCompletion is SnippetCompletion CompletionItemKind = 15 - // ColorCompletion is: + // ColorCompletion is ColorCompletion CompletionItemKind = 16 - // FileCompletion is: + // FileCompletion is FileCompletion CompletionItemKind = 17 - // ReferenceCompletion is: + // ReferenceCompletion is ReferenceCompletion CompletionItemKind = 18 - // FolderCompletion is: + // FolderCompletion is FolderCompletion CompletionItemKind = 19 - // EnumMemberCompletion is: + // EnumMemberCompletion is EnumMemberCompletion CompletionItemKind = 20 - // ConstantCompletion is: + // ConstantCompletion is ConstantCompletion CompletionItemKind = 21 - // StructCompletion is: + // StructCompletion is StructCompletion CompletionItemKind = 22 - // EventCompletion is: + // EventCompletion is EventCompletion CompletionItemKind = 23 - // OperatorCompletion is: + // OperatorCompletion is OperatorCompletion CompletionItemKind = 24 - // TypeParameterCompletion is: + // TypeParameterCompletion is TypeParameterCompletion CompletionItemKind = 25 - // PlainTextTextFormat is: - /** + /*PlainTextTextFormat defined: * The primary text to be inserted is treated as a plain string. */ PlainTextTextFormat InsertTextFormat = 1 - // SnippetTextFormat is: - /** + /*SnippetTextFormat defined: * The primary text to be inserted is treated as a snippet. * * A snippet can define tab stops and placeholders with `$1`, `$2` @@ -3556,116 +3721,110 @@ const ( */ SnippetTextFormat InsertTextFormat = 2 - // Text is: - /** + /*Text defined: * A textual occurrence. */ Text DocumentHighlightKind = 1 - // Read is: - /** + /*Read defined: * Read-access of a symbol, like reading a variable. */ Read DocumentHighlightKind = 2 - // Write is: - /** + /*Write defined: * Write-access of a symbol, like writing to a variable. */ Write DocumentHighlightKind = 3 - // File is: + // File is File SymbolKind = 1 - // Module is: + // Module is Module SymbolKind = 2 - // Namespace is: + // Namespace is Namespace SymbolKind = 3 - // Package is: + // Package is Package SymbolKind = 4 - // Class is: + // Class is Class SymbolKind = 5 - // Method is: + // Method is Method SymbolKind = 6 - // Property is: + // Property is Property SymbolKind = 7 - // Field is: + // Field is Field SymbolKind = 8 - // Constructor is: + // Constructor is Constructor SymbolKind = 9 - // Enum is: + // Enum is Enum SymbolKind = 10 - // Interface is: + // Interface is Interface SymbolKind = 11 - // Function is: + // Function is Function SymbolKind = 12 - // Variable is: + // Variable is Variable SymbolKind = 13 - // Constant is: + // Constant is Constant SymbolKind = 14 - // String is: + // String is String SymbolKind = 15 - // Number is: + // Number is Number SymbolKind = 16 - // Boolean is: + // Boolean is Boolean SymbolKind = 17 - // Array is: + // Array is Array SymbolKind = 18 - // Object is: + // Object is Object SymbolKind = 19 - // Key is: + // Key is Key SymbolKind = 20 - // Null is: + // Null is Null SymbolKind = 21 - // EnumMember is: + // EnumMember is EnumMember SymbolKind = 22 - // Struct is: + // Struct is Struct SymbolKind = 23 - // Event is: + // Event is Event SymbolKind = 24 - // Operator is: + // Operator is Operator SymbolKind = 25 - // TypeParameter is: + // TypeParameter is TypeParameter SymbolKind = 26 - // QuickFix is: - /** + /*QuickFix defined: * Base kind for quickfix actions: 'quickfix' */ QuickFix CodeActionKind = "quickfix" - // Refactor is: - /** + /*Refactor defined: * Base kind for refactoring actions: 'refactor' */ Refactor CodeActionKind = "refactor" - // RefactorExtract is: - /** + /*RefactorExtract defined: * Base kind for refactoring extraction actions: 'refactor.extract' * * Example extract actions: @@ -3678,8 +3837,7 @@ const ( */ RefactorExtract CodeActionKind = "refactor.extract" - // RefactorInline is: - /** + /*RefactorInline defined: * Base kind for refactoring inline actions: 'refactor.inline' * * Example inline actions: @@ -3691,8 +3849,7 @@ const ( */ RefactorInline CodeActionKind = "refactor.inline" - // RefactorRewrite is: - /** + /*RefactorRewrite defined: * Base kind for refactoring rewrite actions: 'refactor.rewrite' * * Example rewrite actions: @@ -3706,35 +3863,30 @@ const ( */ RefactorRewrite CodeActionKind = "refactor.rewrite" - // Source is: - /** + /*Source defined: * Base kind for source actions: `source` * * Source code actions apply to the entire file. */ Source CodeActionKind = "source" - // SourceOrganizeImports is: - /** + /*SourceOrganizeImports defined: * Base kind for an organize imports source action: `source.organizeImports` */ SourceOrganizeImports CodeActionKind = "source.organizeImports" - // Manual is: - /** + /*Manual defined: * Manually triggered, e.g. by the user pressing save, by starting debugging, * or by an API call. */ Manual TextDocumentSaveReason = 1 - // AfterDelay is: - /** + /*AfterDelay defined: * Automatic after a delay. */ AfterDelay TextDocumentSaveReason = 2 - // FocusOut is: - /** + /*FocusOut defined: * When the editor lost focus. */ FocusOut TextDocumentSaveReason = 3 @@ -3759,13 +3911,13 @@ const ( */ type DocumentFilter struct { - /** Language defined: A language id, like `typescript`. */ + /*Language defined: A language id, like `typescript`. */ Language string `json:"language,omitempty"` - /** Scheme defined: A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ + /*Scheme defined: A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ Scheme string `json:"scheme,omitempty"` - /** Pattern defined: A glob pattern, like `*.{ts,js}`. */ + /*Pattern defined: A glob pattern, like `*.{ts,js}`. */ Pattern string `json:"pattern,omitempty"` } diff --git a/internal/lsp/server.go b/internal/lsp/server.go index 4e32b16c20..b26a971e66 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -149,54 +149,34 @@ func (s *Server) Initialize(ctx context.Context, params *protocol.InitializePara return &protocol.InitializeResult{ Capabilities: protocol.ServerCapabilities{ - InnerServerCapabilities: protocol.InnerServerCapabilities{ - CodeActionProvider: true, - CompletionProvider: &protocol.CompletionOptions{ - TriggerCharacters: []string{"."}, - }, - DefinitionProvider: true, - DocumentFormattingProvider: true, - DocumentRangeFormattingProvider: true, - DocumentSymbolProvider: true, - HoverProvider: true, - DocumentHighlightProvider: true, - SignatureHelpProvider: &protocol.SignatureHelpOptions{ - TriggerCharacters: []string{"(", ","}, - }, - TextDocumentSync: &protocol.TextDocumentSyncOptions{ - Change: s.textDocumentSyncKind, - OpenClose: true, - }, + CodeActionProvider: true, + CompletionProvider: &protocol.CompletionOptions{ + TriggerCharacters: []string{"."}, }, - TypeDefinitionServerCapabilities: protocol.TypeDefinitionServerCapabilities{ - TypeDefinitionProvider: true, + DefinitionProvider: true, + DocumentFormattingProvider: true, + DocumentRangeFormattingProvider: true, + DocumentSymbolProvider: true, + HoverProvider: true, + DocumentHighlightProvider: true, + SignatureHelpProvider: &protocol.SignatureHelpOptions{ + TriggerCharacters: []string{"(", ","}, }, + TextDocumentSync: &protocol.TextDocumentSyncOptions{ + Change: s.textDocumentSyncKind, + OpenClose: true, + }, + TypeDefinitionProvider: true, }, }, nil } func (s *Server) setClientCapabilities(caps protocol.ClientCapabilities) { // Check if the client supports snippets in completion items. - if x, ok := caps["textDocument"].(map[string]interface{}); ok { - if x, ok := x["completion"].(map[string]interface{}); ok { - if x, ok := x["completionItem"].(map[string]interface{}); ok { - if x, ok := x["snippetSupport"].(bool); ok { - s.snippetsSupported = x - } - } - } - } + s.snippetsSupported = caps.TextDocument.Completion.CompletionItem.SnippetSupport // Check if the client supports configuration messages. - if x, ok := caps["workspace"].(map[string]interface{}); ok { - if x, ok := x["configuration"].(bool); ok { - s.configurationSupported = x - } - if x, ok := x["didChangeConfiguration"].(map[string]interface{}); ok { - if x, ok := x["dynamicRegistration"].(bool); ok { - s.dynamicConfigurationSupported = x - } - } - } + s.configurationSupported = caps.Workspace.Configuration + s.dynamicConfigurationSupported = caps.Workspace.DidChangeConfiguration.DynamicRegistration } func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) error {