diff --git a/internal/lsp/cmd/cmd.go b/internal/lsp/cmd/cmd.go index ac7f037fba..8bc2128096 100644 --- a/internal/lsp/cmd/cmd.go +++ b/internal/lsp/cmd/cmd.go @@ -204,10 +204,10 @@ func (app *Application) connect(ctx context.Context) (*connection, error) { } func (c *connection) initialize(ctx context.Context) error { - params := &protocol.ParamInitia{} + params := &protocol.ParamInitialize{} params.RootURI = string(span.FileURI(c.Client.app.wd)) params.Capabilities.Workspace.Configuration = true - params.Capabilities.TextDocument.Hover = &protocol.HoverClientCapabilities{ + params.Capabilities.TextDocument.Hover = protocol.HoverClientCapabilities{ ContentFormat: []protocol.MarkupKind{protocol.PlainText}, } if _, err := c.Server.Initialize(ctx, params); err != nil { @@ -295,7 +295,7 @@ func (c *cmdClient) WorkspaceFolders(ctx context.Context) ([]protocol.WorkspaceF return nil, nil } -func (c *cmdClient) Configuration(ctx context.Context, p *protocol.ParamConfig) ([]interface{}, error) { +func (c *cmdClient) Configuration(ctx context.Context, p *protocol.ParamConfiguration) ([]interface{}, error) { results := make([]interface{}, len(p.Items)) for i, item := range p.Items { if item.Section != "gopls" { diff --git a/internal/lsp/cmd/imports.go b/internal/lsp/cmd/imports.go index 2127e25ab8..2b8b13e947 100644 --- a/internal/lsp/cmd/imports.go +++ b/internal/lsp/cmd/imports.go @@ -69,7 +69,11 @@ func (t *imports) Run(ctx context.Context, args ...string) error { return errors.Errorf("%v: %v", from, err) } var edits []protocol.TextEdit - for _, a := range actions { + v, ok := actions.([]protocol.CodeAction) + if !ok { + return errors.Errorf("expected CodeAction, got %T", actions) + } + for _, a := range v { if a.Title != "Organize Imports" { continue } diff --git a/internal/lsp/cmd/suggested_fix.go b/internal/lsp/cmd/suggested_fix.go index 15c6bc9983..2687821f08 100644 --- a/internal/lsp/cmd/suggested_fix.go +++ b/internal/lsp/cmd/suggested_fix.go @@ -87,7 +87,11 @@ func (s *suggestedfix) Run(ctx context.Context, args ...string) error { return errors.Errorf("%v: %v", from, err) } var edits []protocol.TextEdit - for _, a := range actions { + v, ok := actions.([]protocol.CodeAction) + if !ok { + return errors.Errorf("expected CodeAction, got %T", actions) + } + for _, a := range v { if !a.IsPreferred && !s.All { continue } diff --git a/internal/lsp/cmd/symbols.go b/internal/lsp/cmd/symbols.go index 6c2b34d518..4198772160 100644 --- a/internal/lsp/cmd/symbols.go +++ b/internal/lsp/cmd/symbols.go @@ -52,7 +52,6 @@ func (r *symbols) Run(ctx context.Context, args ...string) error { if err != nil { return err } - for _, s := range symbols { fmt.Println(symbolToString(s)) // Sort children for consistency diff --git a/internal/lsp/code_action.go b/internal/lsp/code_action.go index 8db4b93827..6d182ac9f5 100644 --- a/internal/lsp/code_action.go +++ b/internal/lsp/code_action.go @@ -63,7 +63,7 @@ func (s *Server) codeAction(ctx context.Context, params *protocol.CodeActionPara codeActions = append(codeActions, protocol.CodeAction{ Title: "Tidy", Kind: protocol.SourceOrganizeImports, - Command: &protocol.Command{ + Command: protocol.Command{ Title: "Tidy", Command: "tidy", Arguments: []interface{}{ @@ -94,7 +94,7 @@ func (s *Server) codeAction(ctx context.Context, params *protocol.CodeActionPara codeActions = append(codeActions, protocol.CodeAction{ Title: importFixTitle(importFix.Fix), Kind: protocol.QuickFix, - Edit: &protocol.WorkspaceEdit{ + Edit: protocol.WorkspaceEdit{ DocumentChanges: documentChanges(fh, importFix.Edits), }, Diagnostics: fixDiagnostics, @@ -107,7 +107,7 @@ func (s *Server) codeAction(ctx context.Context, params *protocol.CodeActionPara codeActions = append(codeActions, protocol.CodeAction{ Title: "Organize Imports", Kind: protocol.SourceOrganizeImports, - Edit: &protocol.WorkspaceEdit{ + Edit: protocol.WorkspaceEdit{ DocumentChanges: documentChanges(fh, edits), }, }) @@ -226,7 +226,7 @@ func quickFixes(ctx context.Context, s source.Snapshot, f source.File, diagnosti Title: fix.Title, Kind: protocol.QuickFix, Diagnostics: []protocol.Diagnostic{diag}, - Edit: &protocol.WorkspaceEdit{}, + Edit: protocol.WorkspaceEdit{}, } for uri, edits := range fix.Edits { f, err := s.View().GetFile(ctx, uri) diff --git a/internal/lsp/completion.go b/internal/lsp/completion.go index 4b1e390e83..3bdc123084 100644 --- a/internal/lsp/completion.go +++ b/internal/lsp/completion.go @@ -104,7 +104,7 @@ func toProtocolCompletionItems(candidates []source.CompletionItem, rng protocol. Label: candidate.Label, Detail: candidate.Detail, Kind: candidate.Kind, - TextEdit: &protocol.TextEdit{ + TextEdit: protocol.TextEdit{ NewText: insertText, Range: rng, }, @@ -123,7 +123,7 @@ func toProtocolCompletionItems(candidates []source.CompletionItem, rng protocol. // since we show return types as well. switch item.Kind { case protocol.FunctionCompletion, protocol.MethodCompletion: - item.Command = &protocol.Command{ + item.Command = protocol.Command{ Command: "editor.action.triggerParameterHints", } } diff --git a/internal/lsp/general.go b/internal/lsp/general.go index caab70bac2..8e9922b25c 100644 --- a/internal/lsp/general.go +++ b/internal/lsp/general.go @@ -20,7 +20,7 @@ import ( errors "golang.org/x/xerrors" ) -func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitia) (*protocol.InitializeResult, error) { +func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) { s.stateMu.Lock() state := s.state s.stateMu.Unlock() @@ -53,8 +53,7 @@ func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitia) ( } var codeActionProvider interface{} - if ca := params.Capabilities.TextDocument.CodeAction; ca != nil && ca.CodeActionLiteralSupport != nil && - len(ca.CodeActionLiteralSupport.CodeActionKind.ValueSet) > 0 { + if ca := params.Capabilities.TextDocument.CodeAction; len(ca.CodeActionLiteralSupport.CodeActionKind.ValueSet) > 0 { // If the client has specified CodeActionLiteralSupport, // send the code actions we support. // @@ -65,18 +64,16 @@ func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitia) ( } else { codeActionProvider = true } - var renameOpts interface{} - if r := params.Capabilities.TextDocument.Rename; r != nil { - renameOpts = &protocol.RenameOptions{ - PrepareProvider: r.PrepareSupport, - } - } else { - renameOpts = true + // This used to be interface{}, when r could be nil + var renameOpts protocol.RenameOptions + r := params.Capabilities.TextDocument.Rename + renameOpts = protocol.RenameOptions{ + PrepareProvider: r.PrepareSupport, } return &protocol.InitializeResult{ Capabilities: protocol.ServerCapabilities{ CodeActionProvider: codeActionProvider, - CompletionProvider: &protocol.CompletionOptions{ + CompletionProvider: protocol.CompletionOptions{ TriggerCharacters: []string{"."}, }, DefinitionProvider: true, @@ -84,35 +81,27 @@ func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitia) ( ImplementationProvider: true, DocumentFormattingProvider: true, DocumentSymbolProvider: true, - ExecuteCommandProvider: &protocol.ExecuteCommandOptions{ + ExecuteCommandProvider: protocol.ExecuteCommandOptions{ Commands: options.SupportedCommands, }, FoldingRangeProvider: true, HoverProvider: true, DocumentHighlightProvider: true, - DocumentLinkProvider: &protocol.DocumentLinkOptions{}, + DocumentLinkProvider: protocol.DocumentLinkOptions{}, ReferencesProvider: true, RenameProvider: renameOpts, - SignatureHelpProvider: &protocol.SignatureHelpOptions{ + SignatureHelpProvider: protocol.SignatureHelpOptions{ TriggerCharacters: []string{"(", ","}, }, TextDocumentSync: &protocol.TextDocumentSyncOptions{ Change: options.TextDocumentSyncKind, OpenClose: true, - Save: &protocol.SaveOptions{ + Save: protocol.SaveOptions{ IncludeText: false, }, }, - Workspace: &struct { - WorkspaceFolders *struct { - Supported bool "json:\"supported,omitempty\"" - ChangeNotifications string "json:\"changeNotifications,omitempty\"" - } "json:\"workspaceFolders,omitempty\"" - }{ - WorkspaceFolders: &struct { - Supported bool "json:\"supported,omitempty\"" - ChangeNotifications string "json:\"changeNotifications,omitempty\"" - }{ + Workspace: protocol.WorkspaceGn{ + protocol.WorkspaceFoldersGn{ Supported: true, ChangeNotifications: "workspace/didChangeWorkspaceFolders", }, @@ -192,7 +181,7 @@ func (s *Server) fetchConfig(ctx context.Context, name string, folder span.URI, if !s.session.Options().ConfigurationSupported { return nil } - v := protocol.ParamConfig{ + v := protocol.ParamConfiguration{ ConfigurationParams: protocol.ConfigurationParams{ Items: []protocol.ConfigurationItem{{ ScopeURI: protocol.NewURI(folder), diff --git a/internal/lsp/highlight.go b/internal/lsp/highlight.go index c873127b58..48f99923f3 100644 --- a/internal/lsp/highlight.go +++ b/internal/lsp/highlight.go @@ -32,7 +32,7 @@ func toProtocolHighlight(rngs []protocol.Range) []protocol.DocumentHighlight { kind := protocol.Text for _, rng := range rngs { result = append(result, protocol.DocumentHighlight{ - Kind: &kind, + Kind: kind, Range: rng, }) } diff --git a/internal/lsp/hover.go b/internal/lsp/hover.go index 4377e67dc8..5c68aec296 100644 --- a/internal/lsp/hover.go +++ b/internal/lsp/hover.go @@ -40,7 +40,7 @@ func (s *Server) hover(ctx context.Context, params *protocol.HoverParams) (*prot contents := s.toProtocolHoverContents(ctx, hover, view.Options()) return &protocol.Hover{ Contents: contents, - Range: &rng, + Range: rng, }, nil } diff --git a/internal/lsp/lsp_test.go b/internal/lsp/lsp_test.go index e2ee9afffc..4ddc5abd4b 100644 --- a/internal/lsp/lsp_test.go +++ b/internal/lsp/lsp_test.go @@ -314,8 +314,9 @@ func (r *runner) Import(t *testing.T, spn span.Span) { t.Fatal(err) } got := string(m.Content) - if len(actions) > 0 { - res, err := applyWorkspaceEdits(r, actions[0].Edit) + xact := actions.([]protocol.CodeAction) + if len(xact) > 0 { + res, err := applyWorkspaceEdits(r, xact[0].Edit) if err != nil { t.Fatal(err) } @@ -354,10 +355,11 @@ func (r *runner) SuggestedFix(t *testing.T, spn span.Span) { t.Fatal(err) } // TODO: This test should probably be able to handle multiple code actions. - if len(actions) > 1 { + xact := actions.([]protocol.CodeAction) + if len(xact) > 1 { t.Fatal("expected only 1 code action") } - res, err := applyWorkspaceEdits(r, actions[0].Edit) + res, err := applyWorkspaceEdits(r, xact[0].Edit) if err != nil { t.Fatal(err) } @@ -575,7 +577,7 @@ func (r *runner) Rename(t *testing.T, spn span.Span, newText string) { } return } - res, err := applyWorkspaceEdits(r, wedit) + res, err := applyWorkspaceEdits(r, *wedit) if err != nil { t.Fatal(err) } @@ -628,18 +630,23 @@ func (r *runner) PrepareRename(t *testing.T, src span.Span, want *source.Prepare t.Errorf("prepare rename failed for %v: got error: %v", src, err) return } - if got == nil { + // we all love typed nils + if got == nil || got.(*protocol.Range) == nil { if want.Text != "" { // expected an ident. t.Errorf("prepare rename failed for %v: got nil", src) } return } - if protocol.CompareRange(*got, want.Range) != 0 { - t.Errorf("prepare rename failed: incorrect range got %v want %v", *got, want.Range) + xx, ok := got.(*protocol.Range) + if !ok { + t.Fatalf("got %T, wanted Range", got) + } + if protocol.CompareRange(*xx, want.Range) != 0 { + t.Errorf("prepare rename failed: incorrect range got %v want %v", *xx, want.Range) } } -func applyWorkspaceEdits(r *runner, wedit *protocol.WorkspaceEdit) (map[span.URI]string, error) { +func applyWorkspaceEdits(r *runner, wedit protocol.WorkspaceEdit) (map[span.URI]string, error) { res := map[span.URI]string{} for _, docEdits := range wedit.DocumentChanges { uri := span.URI(docEdits.TextDocument.URI) @@ -682,7 +689,6 @@ func (r *runner) Symbols(t *testing.T, uri span.URI, expectedSymbols []protocol. if err != nil { t.Fatal(err) } - if len(symbols) != len(expectedSymbols) { t.Errorf("want %d top-level symbols in %v, got %d", len(expectedSymbols), uri, len(symbols)) return diff --git a/internal/lsp/protocol/protocol.go b/internal/lsp/protocol/protocol.go index 8aaa3ef2f2..8a7df29763 100644 --- a/internal/lsp/protocol/protocol.go +++ b/internal/lsp/protocol/protocol.go @@ -7,6 +7,7 @@ package protocol import ( "context" "encoding/json" + "fmt" "golang.org/x/tools/internal/jsonrpc2" "golang.org/x/tools/internal/telemetry/log" @@ -39,7 +40,16 @@ func (canceller) Request(ctx context.Context, conn *jsonrpc2.Conn, direction jso if err := json.Unmarshal(*r.Params, ¶ms); err != nil { log.Error(ctx, "", err) } else { - conn.Cancel(params.ID) + v := jsonrpc2.ID{} + if n, ok := params.ID.(float64); ok { + v.Number = int64(n) + } else if s, ok := params.ID.(string); ok { + v.Name = s + } else { + log.Error(ctx, fmt.Sprintf("Request ID %v malformed", params.ID), nil) + return ctx + } + conn.Cancel(v) } } return ctx diff --git a/internal/lsp/protocol/tsclient.go b/internal/lsp/protocol/tsclient.go index 969e05507f..692ae3ebf6 100644 --- a/internal/lsp/protocol/tsclient.go +++ b/internal/lsp/protocol/tsclient.go @@ -1,5 +1,10 @@ package protocol +// Package protocol contains data types and code for LSP jsonrpcs +// generated automatically from vscode-languageserver-node +// commit: 635ab1fe6f8c57ce9402e573d007f24d6d290fd3 +// last fetched Sun Oct 13 2019 10:14:32 GMT-0400 (Eastern Daylight Time) + // Code generated (see typescript/README.md) DO NOT EDIT. import ( @@ -16,11 +21,11 @@ type Client interface { LogMessage(context.Context, *LogMessageParams) error Event(context.Context, *interface{}) error PublishDiagnostics(context.Context, *PublishDiagnosticsParams) error - WorkspaceFolders(context.Context) ([]WorkspaceFolder, error) - Configuration(context.Context, *ParamConfig) ([]interface{}, error) + WorkspaceFolders(context.Context) ([]WorkspaceFolder /*WorkspaceFolder[] | null*/, error) + Configuration(context.Context, *ParamConfiguration) ([]interface{}, error) RegisterCapability(context.Context, *RegistrationParams) error UnregisterCapability(context.Context, *UnregistrationParams) error - ShowMessageRequest(context.Context, *ShowMessageRequestParams) (*MessageActionItem, error) + ShowMessageRequest(context.Context, *ShowMessageRequestParams) (*MessageActionItem /*MessageActionItem | null*/, error) ApplyEdit(context.Context, *ApplyWorkspaceEditParams) (*ApplyWorkspaceEditResponse, error) } @@ -85,7 +90,7 @@ func (h clientHandler) Deliver(ctx context.Context, r *jsonrpc2.Request, deliver } return true case "workspace/configuration": // req - var params ParamConfig + var params ParamConfiguration if err := json.Unmarshal(*r.Params, ¶ms); err != nil { sendParseError(ctx, r, err) return true @@ -164,15 +169,15 @@ func (s *clientDispatcher) Event(ctx context.Context, params *interface{}) error func (s *clientDispatcher) PublishDiagnostics(ctx context.Context, params *PublishDiagnosticsParams) error { return s.Conn.Notify(ctx, "textDocument/publishDiagnostics", params) } -func (s *clientDispatcher) WorkspaceFolders(ctx context.Context) ([]WorkspaceFolder, error) { - var result []WorkspaceFolder +func (s *clientDispatcher) WorkspaceFolders(ctx context.Context) ([]WorkspaceFolder /*WorkspaceFolder[] | null*/, error) { + var result []WorkspaceFolder /*WorkspaceFolder[] | null*/ if err := s.Conn.Call(ctx, "workspace/workspaceFolders", nil, &result); err != nil { return nil, err } return result, nil } -func (s *clientDispatcher) Configuration(ctx context.Context, params *ParamConfig) ([]interface{}, error) { +func (s *clientDispatcher) Configuration(ctx context.Context, params *ParamConfiguration) ([]interface{}, error) { var result []interface{} if err := s.Conn.Call(ctx, "workspace/configuration", params, &result); err != nil { return nil, err @@ -188,8 +193,8 @@ func (s *clientDispatcher) UnregisterCapability(ctx context.Context, params *Unr return s.Conn.Call(ctx, "client/unregisterCapability", params, nil) // Call, not Notify } -func (s *clientDispatcher) ShowMessageRequest(ctx context.Context, params *ShowMessageRequestParams) (*MessageActionItem, error) { - var result MessageActionItem +func (s *clientDispatcher) ShowMessageRequest(ctx context.Context, params *ShowMessageRequestParams) (*MessageActionItem /*MessageActionItem | null*/, error) { + var result MessageActionItem /*MessageActionItem | null*/ if err := s.Conn.Call(ctx, "window/showMessageRequest", params, &result); err != nil { return nil, err } @@ -203,9 +208,3 @@ func (s *clientDispatcher) ApplyEdit(ctx context.Context, params *ApplyWorkspace } return &result, nil } - -// Types constructed to avoid structs as formal argument types -type ParamConfig struct { - ConfigurationParams - PartialResultParams -} diff --git a/internal/lsp/protocol/tsprotocol.go b/internal/lsp/protocol/tsprotocol.go index 9821046aa1..81153dff27 100644 --- a/internal/lsp/protocol/tsprotocol.go +++ b/internal/lsp/protocol/tsprotocol.go @@ -1,47 +1,42 @@ // Package protocol contains data types and code for LSP jsonrpcs // generated automatically from vscode-languageserver-node // commit: 635ab1fe6f8c57ce9402e573d007f24d6d290fd3 -// last fetched Mon Oct 14 2019 09:09:30 GMT-0400 (Eastern Daylight Time) +// last fetched Sun Oct 13 2019 10:14:32 GMT-0400 (Eastern Daylight Time) package protocol // Code generated (see typescript/README.md) DO NOT EDIT. -/*ApplyWorkspaceEditParams defined: +/** * The parameters passed via a apply workspace edit request. */ type ApplyWorkspaceEditParams struct { - - /*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: + /** * The edits to apply. */ Edit WorkspaceEdit `json:"edit"` } -/*ApplyWorkspaceEditResponse defined: +/** * A response returned from the apply workspace edit request. */ type ApplyWorkspaceEditResponse struct { - - /*Applied defined: + /** * Indicates whether the edit was applied or not. */ Applied bool `json:"applied"` - - /*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: + /** * 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. @@ -49,73 +44,41 @@ type ApplyWorkspaceEditResponse struct { FailedChange float64 `json:"failedChange,omitempty"` } -// ClientCapabilities is -type ClientCapabilities struct { - - /*Workspace defined: - * Workspace specific client capabilities. +type CancelParams struct { + /** + * The request id to cancel. */ + ID interface{} /*number | string*/ `json:"id"` +} + +type ClientCapabilities = struct { Workspace struct { - - /*ApplyEdit defined: - * The client supports applying batch edits - * to the workspace by supporting the request - * 'workspace/applyEdit' + /** + * Workspace specific client capabilities. */ - ApplyEdit bool `json:"applyEdit,omitempty"` - - /*WorkspaceEdit defined: - * Capabilities specific to `WorkspaceEdit`s - */ - WorkspaceEdit WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"` - - /*DidChangeConfiguration defined: - * Capabilities specific to the `workspace/didChangeConfiguration` notification. - */ - DidChangeConfiguration DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"` - - /*DidChangeWatchedFiles defined: - * Capabilities specific to the `workspace/didChangeWatchedFiles` notification. - */ - DidChangeWatchedFiles DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"` - - /*Symbol defined: - * Capabilities specific to the `workspace/symbol` request. - */ - Symbol WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"` - - /*ExecuteCommand defined: - * Capabilities specific to the `workspace/executeCommand` request. - */ - ExecuteCommand ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"` - - /*WorkspaceFolders defined: + WorkspaceClientCapabilities + /** * 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"` - - /*Window defined: + /** * Window specific client capabilities. */ Window interface{} `json:"window,omitempty"` - - /*Experimental defined: + /** * Experimental client capabilities. */ Experimental interface{} `json:"experimental,omitempty"` - - /*DynamicRegistration defined: + /** * Whether implementation supports dynamic registration for selection range providers. If this is set to `true` * the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server * capability as well. @@ -123,32 +86,28 @@ type ClientCapabilities struct { DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*CodeAction defined: +/** * A code action represents a change that can be performed in code, e.g. to fix a problem or * to refactor code. * * A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed. */ type CodeAction struct { - - /*Title defined: + /** * A short, human-readable, title for this code action. */ Title string `json:"title"` - - /*Kind defined: + /** * The kind of the code action. * * Used to filter code actions. */ Kind CodeActionKind `json:"kind,omitempty"` - - /*Diagnostics defined: + /** * The diagnostics that this code action resolves. */ Diagnostics []Diagnostic `json:"diagnostics,omitempty"` - - /*IsPreferred defined: + /** * Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted * by keybindings. * @@ -158,45 +117,39 @@ type CodeAction struct { * @since 3.15.0 */ IsPreferred bool `json:"isPreferred,omitempty"` - - /*Edit defined: + /** * The workspace edit this code action performs. */ - Edit *WorkspaceEdit `json:"edit,omitempty"` - - /*Command defined: + Edit WorkspaceEdit `json:"edit,omitempty"` + /** * A command this code action executes. If a code action * provides a edit and a command, first the edit is * executed and then the command. */ - Command *Command `json:"command,omitempty"` + Command Command `json:"command,omitempty"` } -/*CodeActionClientCapabilities defined: +/** * The Client Capabilities of a [CodeActionRequest](#CodeActionRequest). */ type CodeActionClientCapabilities 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. * * @since 3.8.0 */ - CodeActionLiteralSupport *struct { - - /*CodeActionKind defined: + CodeActionLiteralSupport struct { + /** * 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 @@ -205,21 +158,19 @@ type CodeActionClientCapabilities struct { ValueSet []CodeActionKind `json:"valueSet"` } `json:"codeActionKind"` } `json:"codeActionLiteralSupport,omitempty"` - - /*IsPreferredSupport defined: + /** * Whether code action supports the `isPreferred` property. * @since 3.15.0 */ IsPreferredSupport bool `json:"isPreferredSupport,omitempty"` } -/*CodeActionContext defined: +/** * Contains additional diagnostic information about the context in which * a [code action](#CodeActionProvider.provideCodeActions) is run. */ type CodeActionContext struct { - - /*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 @@ -227,8 +178,7 @@ type CodeActionContext struct { * to compute code actions is the provided range. */ Diagnostics []Diagnostic `json:"diagnostics"` - - /*Only defined: + /** * Requested kind of actions to return. * * Actions not of this kind are filtered out by the client before being shown. So servers @@ -237,12 +187,16 @@ type CodeActionContext struct { Only []CodeActionKind `json:"only,omitempty"` } -/*CodeActionOptions defined: +/** + * A set of predefined code action kinds + */ +type CodeActionKind string + +/** * Provider options for a [CodeActionRequest](#CodeActionRequest). */ type CodeActionOptions struct { - - /*CodeActionKinds defined: + /** * CodeActionKinds that this server may return. * * The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server @@ -252,22 +206,19 @@ type CodeActionOptions struct { WorkDoneProgressOptions } -/*CodeActionParams defined: +/** * The parameters of a [CodeActionRequest](#CodeActionRequest). */ type CodeActionParams struct { - - /*TextDocument defined: + /** * The document in which the command was invoked. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Range defined: + /** * The range for which the command was invoked. */ Range Range `json:"range"` - - /*Context defined: + /** * Context carrying additional information. */ Context CodeActionContext `json:"context"` @@ -275,15 +226,7 @@ type CodeActionParams struct { PartialResultParams } -/*CodeActionRegistrationOptions defined: - * Registration options for a [CodeActionRequest](#CodeActionRequest). - */ -type CodeActionRegistrationOptions struct { - TextDocumentRegistrationOptions - CodeActionOptions -} - -/*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. * @@ -291,18 +234,15 @@ type CodeActionRegistrationOptions struct { * reasons the creation of a code lens and resolving should be done to two stages. */ type CodeLens struct { - - /*Range defined: + /** * The range in which this code lens is valid. Should only span a single line. */ Range Range `json:"range"` - - /*Command defined: + /** * The command this code lens represents. */ - Command *Command `json:"command,omitempty"` - - /*Data defined: + Command Command `json:"command,omitempty"` + /** * An data entry field that is preserved on a code lens item between * a [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest] * (#CodeLensResolveRequest) @@ -310,35 +250,32 @@ type CodeLens struct { Data interface{} `json:"data,omitempty"` } -/*CodeLensClientCapabilities defined: +/** * The client capabilities of a [CodeLensRequest](#CodeLensRequest). */ type CodeLensClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether code lens supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*CodeLensOptions defined: +/** * Code Lens provider options of a [CodeLensRequest](#CodeLensRequest). */ type CodeLensOptions struct { - - /*ResolveProvider defined: + /** * Code lens has a resolve provider as well. */ ResolveProvider bool `json:"resolveProvider,omitempty"` WorkDoneProgressOptions } -/*CodeLensParams defined: +/** * The parameters of a [CodeLensRequest](#CodeLensRequest). */ type CodeLensParams struct { - - /*TextDocument defined: + /** * The document to request code lens for. */ TextDocument TextDocumentIdentifier `json:"textDocument"` @@ -346,96 +283,75 @@ type CodeLensParams struct { PartialResultParams } -/*CodeLensRegistrationOptions defined: - * Registration options for a [CodeLensRequest](#CodeLensRequest). - */ -type CodeLensRegistrationOptions struct { - TextDocumentRegistrationOptions - CodeLensOptions -} - -/*Color defined: +/** * Represents a color in RGBA space. */ type Color struct { - - /*Red defined: + /** * The red component of this color in the range [0-1]. */ Red float64 `json:"red"` - - /*Green defined: + /** * The green component of this color in the range [0-1]. */ Green float64 `json:"green"` - - /*Blue defined: + /** * The blue component of this color in the range [0-1]. */ Blue float64 `json:"blue"` - - /*Alpha defined: + /** * The alpha component of this color in the range [0-1]. */ Alpha float64 `json:"alpha"` } -/*ColorInformation defined: +/** * Represents a color range from a document. */ type ColorInformation struct { - - /*Range defined: + /** * The range in the document where this color appers. */ Range Range `json:"range"` - - /*Color defined: + /** * The actual color value for this color range. */ Color Color `json:"color"` } -// ColorPresentation is type ColorPresentation struct { - - /*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: + /** * 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: + TextEdit TextEdit `json:"textEdit,omitempty"` + /** * 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"` } -/*ColorPresentationParams defined: +/** * Parameters for a [ColorPresentationRequest](#ColorPresentationRequest). */ type ColorPresentationParams struct { - - /*TextDocument defined: + /** * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Color defined: + /** * The color to request presentations for. */ Color Color `json:"color"` - - /*Range defined: + /** * The range where the color would be inserted. Serves as a context. */ Range Range `json:"range"` @@ -443,48 +359,42 @@ type ColorPresentationParams struct { PartialResultParams } -/*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 * function when invoked. */ type Command struct { - - /*Title defined: + /** * Title of the command, like `save`. */ Title string `json:"title"` - - /*Command defined: + /** * The identifier of the actual command handler. */ Command string `json:"command"` - - /*Arguments defined: + /** * Arguments that the command handler should be * invoked with. */ Arguments []interface{} `json:"arguments,omitempty"` } -/*CompletionClientCapabilities defined: +/** * Completion client capabilities */ type CompletionClientCapabilities 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: + CompletionItem struct { + /** * Client supports snippets as insert text. * * A snippet can define tab stops and placeholders with `$1`, `$2` @@ -493,29 +403,24 @@ type CompletionClientCapabilities struct { * 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"` - - /*TagSupport defined: + /** * Client supports the tag property on a completion item. Clients supporting * tags have to handle unknown tags gracefully. Clients especially need to * preserve unknown tags when sending a completion item back to the server in @@ -523,19 +428,15 @@ type CompletionClientCapabilities struct { * * @since 3.15.0 */ - TagSupport *struct { - - /*ValueSet defined: + TagSupport struct { + /** * The tags supported by the client. */ ValueSet []CompletionItemTag `json:"valueSet"` } `json:"tagSupport,omitempty"` } `json:"completionItem,omitempty"` - - // CompletionItemKind is - CompletionItemKind *struct { - - /*ValueSet defined: + CompletionItemKind struct { + /** * 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 @@ -547,75 +448,65 @@ type CompletionClientCapabilities struct { */ 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"` } -/*CompletionContext defined: +/** * Contains additional information about the context in which a completion request is triggered. */ type CompletionContext struct { - - /*TriggerKind defined: + /** * How the completion was triggered. */ TriggerKind CompletionTriggerKind `json:"triggerKind"` - - /*TriggerCharacter defined: + /** * The trigger character (a single character) that has trigger code complete. * Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` */ TriggerCharacter string `json:"triggerCharacter,omitempty"` } -/*CompletionItem defined: +/** * A completion item represents a text snippet that is * proposed to complete text that is being typed. */ type CompletionItem struct { - - /*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: + /** * The kind of this completion item. Based of the kind * an icon is chosen by the editor. */ Kind CompletionItemKind `json:"kind,omitempty"` - - /*Tags defined: + /** * Tags for this completion item. * * @since 3.15.0 */ Tags []CompletionItemTag `json:"tags,omitempty"` - - /*Detail defined: + /** * A human-readable string with additional information * about this item, like type or symbol information. */ Detail string `json:"detail,omitempty"` - - /*Documentation defined: + /** * A human-readable string that represents a doc-comment. */ - Documentation string `json:"documentation,omitempty"` // string | MarkupContent - - /*Deprecated defined: + Documentation string/*string | MarkupContent*/ `json:"documentation,omitempty"` + /** * Indicates if this item is deprecated. * @deprecated Use `tags` instead. */ Deprecated bool `json:"deprecated,omitempty"` - - /*Preselect defined: + /** * Select this item when showing. * * *Note* that only one completion item can be selected and that the @@ -623,22 +514,19 @@ type CompletionItem struct { * item of those that match best is selected. */ Preselect bool `json:"preselect,omitempty"` - - /*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: + /** * 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: + /** * A string that should be inserted into a document when selecting * this completion. When `falsy` the [label](#CompletionItem.label) * is used. @@ -651,14 +539,12 @@ type CompletionItem struct { * since it avoids additional client side interpretation. */ InsertText string `json:"insertText,omitempty"` - - /*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: + /** * 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. @@ -666,9 +552,8 @@ type CompletionItem struct { * *Note:* The text edit's range must be a [single line] and it must contain the position * at which completion has been requested. */ - TextEdit *TextEdit `json:"textEdit,omitempty"` - - /*AdditionalTextEdits defined: + TextEdit TextEdit `json:"textEdit,omitempty"` + /** * 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. @@ -678,22 +563,19 @@ type CompletionItem struct { * insert an unqualified type). */ AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"` - - /*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: + /** * 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: + Command Command `json:"command,omitempty"` + /** * An data entry field that is preserved on a completion item between * a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest] * (#CompletionResolveRequest) @@ -701,29 +583,39 @@ type CompletionItem struct { Data interface{} `json:"data,omitempty"` } -/*CompletionList defined: +/** + * The kind of a completion entry. + */ +type CompletionItemKind float64 + +/** + * Completion item tags are extra annotations that tweak the rendering of a completion + * item. + * + * @since 3.15.0 + */ +type CompletionItemTag float64 + +/** * Represents a collection of [completion items](#CompletionItem) to be presented * in the editor. */ type CompletionList struct { - - /*IsIncomplete defined: + /** * This list it not complete. Further typing results in recomputing this list. */ IsIncomplete bool `json:"isIncomplete"` - - /*Items defined: + /** * The completion items. */ Items []CompletionItem `json:"items"` } -/*CompletionOptions defined: +/** * Completion options. */ type CompletionOptions struct { - - /*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 @@ -734,8 +626,7 @@ type CompletionOptions struct { * an identifier (for example `.` in JavaScript) list them in `triggerCharacters`. */ TriggerCharacters []string `json:"triggerCharacters,omitempty"` - - /*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` @@ -743,8 +634,7 @@ type CompletionOptions struct { * @since 3.2.0 */ AllCommitCharacters []string `json:"allCommitCharacters,omitempty"` - - /*ResolveProvider defined: + /** * The server provides support to resolve additional * information for a completion item. */ @@ -752,152 +642,150 @@ type CompletionOptions struct { WorkDoneProgressOptions } -/*CompletionParams defined: +/** * Completion parameters */ type CompletionParams struct { - - /*Context defined: + /** * The completion context. This is only available it the client specifies * to send this using the client capability `textDocument.completion.contextSupport === true` */ - Context *CompletionContext `json:"context,omitempty"` + Context CompletionContext `json:"context,omitempty"` TextDocumentPositionParams WorkDoneProgressParams PartialResultParams } -/*CompletionRegistrationOptions defined: - * Registration options for a [CompletionRequest](#CompletionRequest). +/** + * How a completion was triggered */ -type CompletionRegistrationOptions struct { - TextDocumentRegistrationOptions - CompletionOptions -} +type CompletionTriggerKind float64 -// 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"` + Workspace WorkspaceGn `json:"workspace,omitempty"` } -// ConfigurationItem is type ConfigurationItem struct { - - /*ScopeURI defined: + /** * The scope to get the configuration section for. */ ScopeURI string `json:"scopeUri,omitempty"` - - /*Section defined: + /** * The configuration section asked for. */ Section string `json:"section,omitempty"` } -/*ConfigurationParams defined: +/** * The parameters of a configuration request. */ type ConfigurationParams struct { - - // Items is Items []ConfigurationItem `json:"items"` } -/*CreateFile defined: +/** * Create file operation. */ type CreateFile struct { - - /*Kind defined: + /** * A create */ - Kind string `json:"kind"` // 'create' - - /*URI defined: + Kind string `json:"kind"` + /** * The resource to create. */ URI DocumentURI `json:"uri"` - - /*Options defined: + /** * Additional options */ - Options *CreateFileOptions `json:"options,omitempty"` + Options CreateFileOptions `json:"options,omitempty"` + ResourceOperation } -/*CreateFileOptions defined: +/** * Options to create a file. */ type CreateFileOptions struct { - - /*Overwrite defined: + /** * Overwrite existing file. Overwrite wins over `ignoreIfExists` */ Overwrite bool `json:"overwrite,omitempty"` - - /*IgnoreIfExists defined: + /** * Ignore if exists. */ IgnoreIfExists bool `json:"ignoreIfExists,omitempty"` } -/*DeclarationClientCapabilities defined: +/** + * The declaration of a symbol representation as one or many [locations](#Location). + */ +type Declaration = []Location /*Location | Location[]*/ + +/** * Since 3.14.0 */ type DeclarationClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether declaration supports dynamic registration. If this is set to `true` * the client supports the new `DeclarationRegistrationOptions` 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"` } -// DeclarationOptions is +/** + * Information about where a symbol is declared. + * + * Provides additional metadata over normal [location](#Location) declarations, including the range of + * the declaring symbol. + * + * Servers should prefer returning `DeclarationLink` over `Declaration` if supported + * by the client. + */ +type DeclarationLink = LocationLink + type DeclarationOptions struct { WorkDoneProgressOptions } -// DeclarationParams is type DeclarationParams struct { TextDocumentPositionParams WorkDoneProgressParams PartialResultParams } -// DeclarationRegistrationOptions is type DeclarationRegistrationOptions struct { DeclarationOptions TextDocumentRegistrationOptions StaticRegistrationOptions } -/*DefinitionClientCapabilities defined: +/** + * The definition of a symbol represented as one or many [locations](#Location). + * For most programming languages there is only one location at which a symbol is + * defined. + * + * Servers should prefer returning `DefinitionLink` over `Definition` if supported + * by the client. + */ +type Definition = []Location /*Location | Location[]*/ + +/** * Client Capabilities for a [DefinitionRequest](#DefinitionRequest). */ type DefinitionClientCapabilities 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. * * @since 3.14.0 @@ -905,14 +793,22 @@ type DefinitionClientCapabilities struct { LinkSupport bool `json:"linkSupport,omitempty"` } -/*DefinitionOptions defined: +/** + * Information about where a symbol is defined. + * + * Provides additional metadata over normal [location](#Location) definitions, including the range of + * the defining symbol + */ +type DefinitionLink = LocationLink + +/** * Server Capabilities for a [DefinitionRequest](#DefinitionRequest). */ type DefinitionOptions struct { WorkDoneProgressOptions } -/*DefinitionParams defined: +/** * Parameters for a [DefinitionRequest](#DefinitionRequest). */ type DefinitionParams struct { @@ -921,155 +817,138 @@ type DefinitionParams struct { PartialResultParams } -/*DefinitionRegistrationOptions defined: - * Registration options for a [DefinitionRequest](#DefinitionRequest). - */ -type DefinitionRegistrationOptions struct { - TextDocumentRegistrationOptions - DefinitionOptions -} - -/*DeleteFile defined: +/** * Delete file operation */ type DeleteFile struct { - - /*Kind defined: + /** * A delete */ - Kind string `json:"kind"` // 'delete' - - /*URI defined: + Kind string `json:"kind"` + /** * The file to delete. */ URI DocumentURI `json:"uri"` - - /*Options defined: + /** * Delete options. */ - Options *DeleteFileOptions `json:"options,omitempty"` + Options DeleteFileOptions `json:"options,omitempty"` + ResourceOperation } -/*DeleteFileOptions defined: +/** * Delete file options */ type DeleteFileOptions struct { - - /*Recursive defined: + /** * Delete the content recursively if a folder is denoted. */ Recursive bool `json:"recursive,omitempty"` - - /*IgnoreIfNotExists defined: + /** * Ignore the operation if the file doesn't exist. */ IgnoreIfNotExists bool `json:"ignoreIfNotExists,omitempty"` } -/*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: + /** * The range at which the message applies */ Range Range `json:"range"` - - /*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: + /** * The diagnostic's code, which usually appear in the user interface. */ - Code interface{} `json:"code,omitempty"` // number | string - - /*Source defined: + Code interface{}/*number | string*/ `json:"code,omitempty"` + /** * 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: + /** * The diagnostic's message. It usually appears in the user interface */ Message string `json:"message"` - - /*Tags defined: + /** * Additional metadata about the diagnostic. */ Tags []DiagnosticTag `json:"tags,omitempty"` - - /*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"` } -/*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: + /** * The location of this related diagnostic information. */ Location Location `json:"location"` - - /*Message defined: + /** * The message of this related diagnostic information. */ Message string `json:"message"` } -// DidChangeConfigurationClientCapabilities is -type DidChangeConfigurationClientCapabilities struct { +/** + * The diagnostic's severity. + */ +type DiagnosticSeverity float64 - /*DynamicRegistration defined: +/** + * The diagnostic tags. + * + * @since 3.15.0 + */ +type DiagnosticTag float64 + +type DidChangeConfigurationClientCapabilities struct { + /** * Did change configuration notification supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*DidChangeConfigurationParams defined: +/** * The parameters of a change configuration notification. */ type DidChangeConfigurationParams struct { - - /*Settings defined: + /** * The actual changed settings */ Settings interface{} `json:"settings"` } -// DidChangeConfigurationRegistrationOptions is type DidChangeConfigurationRegistrationOptions struct { - - // Section is - Section string `json:"section,omitempty"` // string | string[] + Section []string /*string | string[]*/ `json:"section,omitempty"` } -/*DidChangeTextDocumentParams defined: +/** * The change text document notification's parameters. */ type DidChangeTextDocumentParams struct { - - /*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: + /** * 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''. @@ -1077,10 +956,8 @@ type DidChangeTextDocumentParams struct { ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"` } -// DidChangeWatchedFilesClientCapabilities is type DidChangeWatchedFilesClientCapabilities 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. @@ -1088,82 +965,73 @@ type DidChangeWatchedFilesClientCapabilities struct { DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*DidChangeWatchedFilesParams defined: +/** * The watched files change notification's parameters. */ type DidChangeWatchedFilesParams struct { - - /*Changes defined: + /** * The actual file events. */ Changes []FileEvent `json:"changes"` } -/*DidChangeWatchedFilesRegistrationOptions defined: +/** * Describe options to be used when registered for text document change events. */ type DidChangeWatchedFilesRegistrationOptions struct { - - /*Watchers defined: + /** * The watchers to register. */ Watchers []FileSystemWatcher `json:"watchers"` } -/*DidChangeWorkspaceFoldersParams defined: +/** * The parameters of a `workspace/didChangeWorkspaceFolders` notification. */ type DidChangeWorkspaceFoldersParams struct { - - /*Event defined: + /** * The actual workspace folder change event. */ Event WorkspaceFoldersChangeEvent `json:"event"` } -/*DidCloseTextDocumentParams defined: +/** * The parameters send in a close text document notification */ type DidCloseTextDocumentParams struct { - - /*TextDocument defined: + /** * The document that was closed. */ TextDocument TextDocumentIdentifier `json:"textDocument"` } -/*DidOpenTextDocumentParams defined: +/** * The parameters send in a open text document notification */ type DidOpenTextDocumentParams struct { - - /*TextDocument defined: + /** * The document that was opened. */ TextDocument TextDocumentItem `json:"textDocument"` } -/*DidSaveTextDocumentParams defined: +/** * The parameters send in a save text document notification */ type DidSaveTextDocumentParams struct { - - /*TextDocument defined: + /** * The document that was closed. */ TextDocument VersionedTextDocumentIdentifier `json:"textDocument"` - - /*Text defined: + /** * Optional the content when saved. Depends on the includeText value * when the save notification was requested. */ Text string `json:"text,omitempty"` } -// DocumentColorClientCapabilities is type DocumentColorClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether implementation supports dynamic registration. If this is set to `true` * the client supports the new `DocumentColorRegistrationOptions` return value * for the corresponding server capability as well. @@ -1171,22 +1039,19 @@ type DocumentColorClientCapabilities struct { DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -// DocumentColorOptions is type DocumentColorOptions struct { - - /*ResolveProvider defined: + /** * Code lens has a resolve provider as well. */ ResolveProvider bool `json:"resolveProvider,omitempty"` WorkDoneProgressOptions } -/*DocumentColorParams defined: +/** * Parameters for a [DocumentColorRequest](#DocumentColorRequest). */ type DocumentColorParams struct { - - /*TextDocument defined: + /** * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` @@ -1194,93 +1059,108 @@ type DocumentColorParams struct { PartialResultParams } -// DocumentColorRegistrationOptions is type DocumentColorRegistrationOptions struct { TextDocumentRegistrationOptions StaticRegistrationOptions DocumentColorOptions } -/*DocumentFormattingClientCapabilities defined: +/** + * A document filter denotes a document by different properties like + * the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of + * its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName). + * + * 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 + * - `**` to match any number of path segments, including none + * - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) + * - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) + * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) + * + * @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` + * @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` + */ +type DocumentFilter = struct { + /** A language id, like `typescript`. */ + Language string `json:"language"` + /** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */ + Scheme string `json:"scheme,omitempty"` + /** A glob pattern, like `*.{ts,js}`. */ + Pattern string `json:"pattern,omitempty"` +} + +/** * Client capabilities of a [DocumentFormattingRequest](#DocumentFormattingRequest). */ type DocumentFormattingClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether formatting supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*DocumentFormattingOptions defined: +/** * Provider options for a [DocumentFormattingRequest](#DocumentFormattingRequest). */ type DocumentFormattingOptions struct { WorkDoneProgressOptions } -/*DocumentFormattingParams defined: +/** * The parameters of a [DocumentFormattingRequest](#DocumentFormattingRequest). */ type DocumentFormattingParams struct { - - /*TextDocument defined: + /** * The document to format. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Options defined: + /** * The format options */ Options FormattingOptions `json:"options"` WorkDoneProgressParams } -/*DocumentFormattingRegistrationOptions defined: - * Registration options for a [DocumentFormattingRequest](#DocumentFormattingRequest). - */ -type DocumentFormattingRegistrationOptions struct { - TextDocumentRegistrationOptions - DocumentFormattingOptions -} - -/*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: + /** * The range this highlight applies to. */ Range Range `json:"range"` - - /*Kind defined: + /** * The highlight kind, default is [text](#DocumentHighlightKind.Text). */ - Kind *DocumentHighlightKind `json:"kind,omitempty"` + Kind DocumentHighlightKind `json:"kind,omitempty"` } -/*DocumentHighlightClientCapabilities defined: +/** * Client Capabilities for a [DocumentHighlightRequest](#DocumentHighlightRequest). */ type DocumentHighlightClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether document highlight supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*DocumentHighlightOptions defined: +/** + * A document highlight kind. + */ +type DocumentHighlightKind float64 + +/** * Provider options for a [DocumentHighlightRequest](#DocumentHighlightRequest). */ type DocumentHighlightOptions struct { WorkDoneProgressOptions } -/*DocumentHighlightParams defined: +/** * Parameters for a [DocumentHighlightRequest](#DocumentHighlightRequest). */ type DocumentHighlightParams struct { @@ -1289,31 +1169,20 @@ type DocumentHighlightParams struct { PartialResultParams } -/*DocumentHighlightRegistrationOptions defined: - * Registration options for a [DocumentHighlightRequest](#DocumentHighlightRequest). - */ -type DocumentHighlightRegistrationOptions struct { - TextDocumentRegistrationOptions - DocumentHighlightOptions -} - -/*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: + /** * The range this link applies to. */ Range Range `json:"range"` - - /*Target defined: + /** * The uri this link points to. */ Target string `json:"target,omitempty"` - - /*Tooltip defined: + /** * The tooltip text when you hover over this link. * * If a tooltip is provided, is will be displayed in a string that includes instructions on how to @@ -1323,25 +1192,22 @@ type DocumentLink struct { * @since 3.15.0 */ Tooltip string `json:"tooltip,omitempty"` - - /*Data defined: + /** * A data entry field that is preserved on a document link between a * DocumentLinkRequest and a DocumentLinkResolveRequest. */ Data interface{} `json:"data,omitempty"` } -/*DocumentLinkClientCapabilities defined: +/** * The client capabilities of a [DocumentLinkRequest](#DocumentLinkRequest). */ type DocumentLinkClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether document link supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` - - /*TooltipSupport defined: + /** * Whether the client support the `tooltip` property on `DocumentLink`. * * @since 3.15.0 @@ -1349,24 +1215,22 @@ type DocumentLinkClientCapabilities struct { TooltipSupport bool `json:"tooltipSupport,omitempty"` } -/*DocumentLinkOptions defined: +/** * Provider options for a [DocumentLinkRequest](#DocumentLinkRequest). */ type DocumentLinkOptions struct { - - /*ResolveProvider defined: + /** * Document links have a resolve provider as well. */ ResolveProvider bool `json:"resolveProvider,omitempty"` WorkDoneProgressOptions } -/*DocumentLinkParams defined: +/** * The parameters of a [DocumentLinkRequest](#DocumentLinkRequest). */ type DocumentLinkParams struct { - - /*TextDocument defined: + /** * The document to provide document links for. */ TextDocument TextDocumentIdentifier `json:"textDocument"` @@ -1374,187 +1238,149 @@ type DocumentLinkParams struct { PartialResultParams } -/*DocumentLinkRegistrationOptions defined: - * Registration options for a [DocumentLinkRequest](#DocumentLinkRequest). - */ -type DocumentLinkRegistrationOptions struct { - TextDocumentRegistrationOptions - DocumentLinkOptions -} - -/*DocumentOnTypeFormattingClientCapabilities defined: +/** * Client capabilities of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). */ type DocumentOnTypeFormattingClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether on type formatting supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*DocumentOnTypeFormattingOptions defined: +/** * Provider options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). */ type DocumentOnTypeFormattingOptions struct { - - /*FirstTriggerCharacter defined: + /** * A character on which formatting should be triggered, like `}`. */ FirstTriggerCharacter string `json:"firstTriggerCharacter"` - - /*MoreTriggerCharacter defined: + /** * More trigger characters. */ MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"` } -/*DocumentOnTypeFormattingParams defined: +/** * The parameters of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). */ type DocumentOnTypeFormattingParams struct { - - /*TextDocument defined: + /** * The document to format. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Position defined: + /** * The position at which this request was send. */ Position Position `json:"position"` - - /*Ch defined: + /** * The character that has been typed. */ Ch string `json:"ch"` - - /*Options defined: + /** * The format options. */ Options FormattingOptions `json:"options"` } -/*DocumentOnTypeFormattingRegistrationOptions defined: - * Registration options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest). - */ -type DocumentOnTypeFormattingRegistrationOptions struct { - TextDocumentRegistrationOptions - DocumentOnTypeFormattingOptions -} - -/*DocumentRangeFormattingClientCapabilities defined: +/** * Client capabilities of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). */ type DocumentRangeFormattingClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether range formatting supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*DocumentRangeFormattingOptions defined: +/** * Provider options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). */ type DocumentRangeFormattingOptions struct { WorkDoneProgressOptions } -/*DocumentRangeFormattingParams defined: +/** * The parameters of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). */ type DocumentRangeFormattingParams struct { - - /*TextDocument defined: + /** * The document to format. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Range defined: + /** * The range to format */ Range Range `json:"range"` - - /*Options defined: + /** * The format options */ Options FormattingOptions `json:"options"` WorkDoneProgressParams } -/*DocumentRangeFormattingRegistrationOptions defined: - * Registration options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest). +/** + * A document selector is the combination of one or many document filters. + * + * @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`; */ -type DocumentRangeFormattingRegistrationOptions struct { - TextDocumentRegistrationOptions - DocumentRangeFormattingOptions -} +type DocumentSelector = []string /*string | DocumentFilter*/ -/*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 * its most interesting range, e.g. the range of an identifier. */ type DocumentSymbol struct { - - /*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: + /** * More detail for this symbol, e.g the signature of a function. */ Detail string `json:"detail,omitempty"` - - /*Kind defined: + /** * The kind of this symbol. */ Kind SymbolKind `json:"kind"` - - /*Deprecated defined: + /** * Indicates if this symbol is deprecated. */ Deprecated bool `json:"deprecated,omitempty"` - - /*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: + /** * 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 of this symbol, e.g. properties of a class. */ Children []DocumentSymbol `json:"children,omitempty"` } -/*DocumentSymbolClientCapabilities defined: +/** * Client Capabilities for a [DocumentSymbolRequest](#DocumentSymbolRequest). */ type DocumentSymbolClientCapabilities 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: + SymbolKind struct { + /** * 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 @@ -1566,26 +1392,24 @@ type DocumentSymbolClientCapabilities struct { */ ValueSet []SymbolKind `json:"valueSet,omitempty"` } `json:"symbolKind,omitempty"` - - /*HierarchicalDocumentSymbolSupport defined: + /** * The client support hierarchical document symbols. */ HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"` } -/*DocumentSymbolOptions defined: +/** * Provider options for a [DocumentSymbolRequest](#DocumentSymbolRequest). */ type DocumentSymbolOptions struct { WorkDoneProgressOptions } -/*DocumentSymbolParams defined: +/** * Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest). */ type DocumentSymbolParams struct { - - /*TextDocument defined: + /** * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` @@ -1593,81 +1417,70 @@ type DocumentSymbolParams struct { PartialResultParams } -/*DocumentSymbolRegistrationOptions defined: - * Registration options for a [DocumentSymbolRequest](#DocumentSymbolRequest). +/** + * A tagging type for string properties that are actually URIs. */ -type DocumentSymbolRegistrationOptions struct { - TextDocumentRegistrationOptions - DocumentSymbolOptions -} +type DocumentURI = string -/*ExecuteCommandClientCapabilities defined: +/** * The client capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest). */ type ExecuteCommandClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Execute command supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*ExecuteCommandOptions defined: +/** * The server capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest). */ type ExecuteCommandOptions struct { - - /*Commands defined: + /** * The commands to be executed on the server */ Commands []string `json:"commands"` WorkDoneProgressOptions } -/*ExecuteCommandParams defined: +/** * The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest). */ type ExecuteCommandParams struct { - - /*Command defined: + /** * The identifier of the actual command handler. */ Command string `json:"command"` - - /*Arguments defined: + /** * Arguments that the command should be invoked with. */ Arguments []interface{} `json:"arguments,omitempty"` WorkDoneProgressParams } -/*ExecuteCommandRegistrationOptions defined: - * Registration options for a [ExecuteCommandRequest](#ExecuteCommandRequest). - */ -type ExecuteCommandRegistrationOptions struct { - ExecuteCommandOptions -} +type FailureHandlingKind string -/*FileEvent defined: +/** + * The file event type + */ +type FileChangeType float64 + +/** * An event describing a file change. */ type FileEvent struct { - - /*URI defined: + /** * The file's uri. */ URI DocumentURI `json:"uri"` - - /*Type defined: + /** * The change type. */ Type FileChangeType `json:"type"` } -// FileSystemWatcher is type FileSystemWatcher struct { - - /*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 @@ -1677,8 +1490,7 @@ type FileSystemWatcher struct { * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) */ GlobPattern string `json:"globPattern"` - - /*Kind defined: + /** * The kind of events of interest. If omitted it defaults * to WatchKind.Create | WatchKind.Change | WatchKind.Delete * which is 7. @@ -1686,32 +1498,27 @@ type FileSystemWatcher struct { Kind float64 `json:"kind,omitempty"` } -/*FoldingRange defined: +/** * Represents a folding range. */ type FoldingRange struct { - - /*StartLine defined: + /** * The zero-based line number from where the folded range starts. */ StartLine float64 `json:"startLine"` - - /*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: + /** * The zero-based line number where the folded range ends. */ EndLine float64 `json:"endLine"` - - /*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: + /** * 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. @@ -1719,40 +1526,39 @@ type FoldingRange struct { Kind string `json:"kind,omitempty"` } -// FoldingRangeClientCapabilities is type FoldingRangeClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether implementation supports dynamic registration for folding range providers. If this is set to `true` * the client supports the new `FoldingRangeRegistrationOptions` 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"` } -// FoldingRangeOptions is +/** + * Enum of known range kinds + */ +type FoldingRangeKind string + type FoldingRangeOptions struct { WorkDoneProgressOptions } -/*FoldingRangeParams defined: +/** * Parameters for a [FoldingRangeRequest](#FoldingRangeRequest). */ type FoldingRangeParams struct { - - /*TextDocument defined: + /** * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` @@ -1760,94 +1566,78 @@ type FoldingRangeParams struct { PartialResultParams } -// FoldingRangeRegistrationOptions is type FoldingRangeRegistrationOptions struct { TextDocumentRegistrationOptions FoldingRangeOptions StaticRegistrationOptions } -/*FormattingOptions defined: +/** * Value-object describing what options formatting should use. */ type FormattingOptions struct { - - /*TabSize defined: + /** * Size of a tab in spaces. */ TabSize float64 `json:"tabSize"` - - /*InsertSpaces defined: + /** * Prefer spaces over tabs. */ InsertSpaces bool `json:"insertSpaces"` - - /*TrimTrailingWhitespace defined: + /** * Trim trailing whitespaces on a line. * * @since 3.15.0 */ TrimTrailingWhitespace bool `json:"trimTrailingWhitespace,omitempty"` - - /*InsertFinalNewline defined: + /** * Insert a newline character at the end of the file if one does not exist. * * @since 3.15.0 */ InsertFinalNewline bool `json:"insertFinalNewline,omitempty"` - - /*TrimFinalNewlines defined: + /** * Trim all newlines after the final newline at the end of the file. * * @since 3.15.0 */ TrimFinalNewlines bool `json:"trimFinalNewlines,omitempty"` - - /*Key defined: - * Signature for further properties. - */ - Key map[string]bool `json:"key"` // [key: string]: boolean | number | string | undefined; } -/*Hover defined: +/** * The result of a hover request. */ type Hover struct { - - /*Contents defined: + /** * The hover's content */ - Contents MarkupContent `json:"contents"` // MarkupContent | MarkedString | MarkedString[] - - /*Range defined: + Contents MarkupContent/*MarkupContent | MarkedString | MarkedString[]*/ `json:"contents"` + /** * An optional range */ - Range *Range `json:"range,omitempty"` + Range Range `json:"range,omitempty"` } -// HoverClientCapabilities is type HoverClientCapabilities 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"` } -/*HoverOptions defined: +/** * Hover options. */ type HoverOptions struct { WorkDoneProgressOptions } -/*HoverParams defined: +/** * Parameters for a [HoverRequest](#HoverRequest). */ type HoverParams struct { @@ -1855,27 +1645,17 @@ type HoverParams struct { WorkDoneProgressParams } -/*HoverRegistrationOptions defined: - * Registration options for a [HoverRequest](#HoverRequest). - */ -type HoverRegistrationOptions struct { - TextDocumentRegistrationOptions - HoverOptions -} - -/*ImplementationClientCapabilities defined: +/** * Since 3.6.0 */ type ImplementationClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether implementation supports dynamic registration. If this is set to `true` * the client supports the new `ImplementationRegistrationOptions` 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. * * Since 3.14.0 @@ -1883,422 +1663,324 @@ type ImplementationClientCapabilities struct { LinkSupport bool `json:"linkSupport,omitempty"` } -// ImplementationOptions is type ImplementationOptions struct { WorkDoneProgressOptions } -// ImplementationParams is type ImplementationParams struct { TextDocumentPositionParams WorkDoneProgressParams PartialResultParams } -// ImplementationRegistrationOptions is type ImplementationRegistrationOptions struct { TextDocumentRegistrationOptions ImplementationOptions StaticRegistrationOptions } -// InitializeParams is -type InitializeParams struct { +/** + * Known error codes for an `InitializeError`; + */ +type InitializeError float64 - /*ProcessID defined: - * The process Id of the parent process that started - * the server. - */ - ProcessID float64 `json:"processId"` - - /*ClientInfo defined: - * Information about the client - * - * @since 3.15.0 - */ - ClientInfo *struct { - - /*Name defined: - * The name of the client as defined by the client. - */ - Name string `json:"name"` - - /*Version defined: - * The client's version as defined by the client. - */ - Version string `json:"version,omitempty"` - } `json:"clientInfo,omitempty"` - - /*RootPath defined: - * The rootPath of the workspace. Is null - * if no folder is open. - * - * @deprecated in favour of rootUri. - */ - RootPath string `json:"rootPath,omitempty"` - - /*RootURI defined: - * The rootUri of the workspace. Is null if no - * folder is open. If both `rootPath` and `rootUri` are set - * `rootUri` wins. - * - * @deprecated in favour of workspaceFolders. - */ - RootURI DocumentURI `json:"rootUri"` - - /*Capabilities defined: - * The capabilities provided by the client (editor or tool) - */ - Capabilities ClientCapabilities `json:"capabilities"` - - /*InitializationOptions defined: - * User provided initialization options. - */ - InitializationOptions interface{} `json:"initializationOptions,omitempty"` - - /*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"` +type InitializeParams = struct { + InnerInitializeParams + WorkspaceFoldersInitializeParams } -/*InitializeResult defined: +/** * The result returned from an initialize request. */ type InitializeResult struct { - - /*Capabilities defined: + /** * The capabilities the language server provides. */ Capabilities ServerCapabilities `json:"capabilities"` - - /*ServerInfo defined: + /** * Information about the server. * * @since 3.15.0 */ - ServerInfo *struct { - - /*Name defined: + ServerInfo struct { + /** * The name of the server as defined by the server. */ Name string `json:"name"` - - /*Version defined: + /** * The servers's version as defined by the server. */ Version string `json:"version,omitempty"` } `json:"serverInfo,omitempty"` - - /*Custom defined: - * Custom initialization results. - */ - Custom map[string]interface{} `json:"custom"` // [custom: string]: any; } -// InitializedParams is type InitializedParams struct { } -/*InnerClientCapabilities defined: +/** * Defines the capabilities provided by the client. */ type InnerClientCapabilities struct { - - /*Workspace defined: + /** * Workspace specific client capabilities. */ - Workspace *WorkspaceClientCapabilities `json:"workspace,omitempty"` - - /*TextDocument defined: + Workspace WorkspaceClientCapabilities `json:"workspace,omitempty"` + /** * Text document specific client capabilities. */ - TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitempty"` - - /*Window defined: + TextDocument TextDocumentClientCapabilities `json:"textDocument,omitempty"` + /** * Window specific client capabilities. */ Window interface{} `json:"window,omitempty"` - - /*Experimental defined: + /** * Experimental client capabilities. */ Experimental interface{} `json:"experimental,omitempty"` } -/*InnerInitializeParams defined: +/** * The initialize parameters */ type InnerInitializeParams struct { - - /*ProcessID defined: + /** * The process Id of the parent process that started * the server. */ - ProcessID float64 `json:"processId"` - - /*ClientInfo defined: + ProcessID float64/*number | null*/ `json:"processId"` + /** * Information about the client * * @since 3.15.0 */ - ClientInfo *struct { - - /*Name defined: + ClientInfo struct { + /** * The name of the client as defined by the client. */ Name string `json:"name"` - - /*Version defined: + /** * The client's version as defined by the client. */ Version string `json:"version,omitempty"` } `json:"clientInfo,omitempty"` - - /*RootPath defined: + /** * The rootPath of the workspace. Is null * if no folder is open. * * @deprecated in favour of rootUri. */ - RootPath string `json:"rootPath,omitempty"` - - /*RootURI defined: + RootPath string/*string | null*/ `json:"rootPath,omitempty"` + /** * The rootUri of the workspace. Is null if no * folder is open. If both `rootPath` and `rootUri` are set * `rootUri` wins. * * @deprecated in favour of workspaceFolders. */ - RootURI DocumentURI `json:"rootUri"` - - /*Capabilities defined: + RootURI DocumentURI/*DocumentUri | null*/ `json:"rootUri"` + /** * The capabilities provided by the client (editor or tool) */ Capabilities ClientCapabilities `json:"capabilities"` - - /*InitializationOptions defined: + /** * User provided initialization options. */ InitializationOptions interface{} `json:"initializationOptions,omitempty"` - - /*Trace defined: + /** * The initial trace setting. If omitted trace is disabled ('off'). */ - Trace string `json:"trace,omitempty"` // 'off' | 'messages' | 'verbose' + Trace string/*'off' | 'messages' | 'verbose'*/ `json:"trace,omitempty"` WorkDoneProgressParams } -/*InnerServerCapabilities defined: +/** * Defines the capabilities provided by a language * server. */ type InnerServerCapabilities struct { - - /*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 - - /*CompletionProvider defined: + TextDocumentSync interface{}/*TextDocumentSyncOptions | TextDocumentSyncKind*/ `json:"textDocumentSync,omitempty"` + /** * The server provides completion support. */ - CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"` - - /*HoverProvider defined: + CompletionProvider CompletionOptions `json:"completionProvider,omitempty"` + /** * The server provides hover support. */ - HoverProvider bool `json:"hoverProvider,omitempty"` // boolean | HoverOptions - - /*SignatureHelpProvider defined: + HoverProvider bool/*boolean | HoverOptions*/ `json:"hoverProvider,omitempty"` + /** * The server provides signature help support. */ - SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"` - - /*DeclarationProvider defined: + SignatureHelpProvider SignatureHelpOptions `json:"signatureHelpProvider,omitempty"` + /** * The server provides Goto Declaration support. */ - DeclarationProvider bool `json:"declarationProvider,omitempty"` // boolean | DeclarationOptions | DeclarationRegistrationOptions - - /*DefinitionProvider defined: + DeclarationProvider interface{}/* bool | DeclarationOptions | DeclarationRegistrationOptions*/ `json:"declarationProvider,omitempty"` + /** * The server provides goto definition support. */ - DefinitionProvider bool `json:"definitionProvider,omitempty"` // boolean | DefinitionOptions - - /*TypeDefinitionProvider defined: + DefinitionProvider bool/*boolean | DefinitionOptions*/ `json:"definitionProvider,omitempty"` + /** * The server provides Goto Type Definition support. */ - TypeDefinitionProvider bool `json:"typeDefinitionProvider,omitempty"` // boolean | TypeDefinitionOptions | TypeDefinitionRegistrationOptions - - /*ImplementationProvider defined: + TypeDefinitionProvider interface{}/* bool | TypeDefinitionOptions | TypeDefinitionRegistrationOptions*/ `json:"typeDefinitionProvider,omitempty"` + /** * The server provides Goto Implementation support. */ - ImplementationProvider bool `json:"implementationProvider,omitempty"` // boolean | ImplementationOptions | ImplementationRegistrationOptions - - /*ReferencesProvider defined: + ImplementationProvider interface{}/* bool | ImplementationOptions | ImplementationRegistrationOptions*/ `json:"implementationProvider,omitempty"` + /** * The server provides find references support. */ - ReferencesProvider bool `json:"referencesProvider,omitempty"` // boolean | ReferenceOptions - - /*DocumentHighlightProvider defined: + ReferencesProvider bool/*boolean | ReferenceOptions*/ `json:"referencesProvider,omitempty"` + /** * The server provides document highlight support. */ - DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"` // boolean | DocumentHighlightOptions - - /*DocumentSymbolProvider defined: + DocumentHighlightProvider bool/*boolean | DocumentHighlightOptions*/ `json:"documentHighlightProvider,omitempty"` + /** * The server provides document symbol support. */ - DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"` // boolean | DocumentSymbolOptions - - /*CodeActionProvider defined: + DocumentSymbolProvider bool/*boolean | DocumentSymbolOptions*/ `json:"documentSymbolProvider,omitempty"` + /** * The server provides code actions. CodeActionOptions may only be * specified if the client states that it supports * `codeActionLiteralSupport` in its initial `initialize` request. */ - CodeActionProvider interface{} `json:"codeActionProvider,omitempty"` // boolean | CodeActionOptions - - /*CodeLensProvider defined: + CodeActionProvider interface{}/*boolean | CodeActionOptions*/ `json:"codeActionProvider,omitempty"` + /** * The server provides code lens. */ - CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"` - - /*DocumentLinkProvider defined: + CodeLensProvider CodeLensOptions `json:"codeLensProvider,omitempty"` + /** * The server provides document link support. */ - DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"` - - /*ColorProvider defined: + DocumentLinkProvider DocumentLinkOptions `json:"documentLinkProvider,omitempty"` + /** * The server provides color provider support. */ - ColorProvider bool `json:"colorProvider,omitempty"` // boolean | DocumentColorOptions | DocumentColorRegistrationOptions - - /*WorkspaceSymbolProvider defined: + ColorProvider interface{}/* bool | DocumentColorOptions | DocumentColorRegistrationOptions*/ `json:"colorProvider,omitempty"` + /** * The server provides workspace symbol support. */ - WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"` // boolean | WorkspaceSymbolOptions - - /*DocumentFormattingProvider defined: + WorkspaceSymbolProvider bool/*boolean | WorkspaceSymbolOptions*/ `json:"workspaceSymbolProvider,omitempty"` + /** * The server provides document formatting. */ - DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"` // boolean | DocumentFormattingOptions - - /*DocumentRangeFormattingProvider defined: + DocumentFormattingProvider bool/*boolean | DocumentFormattingOptions*/ `json:"documentFormattingProvider,omitempty"` + /** * The server provides document range formatting. */ - DocumentRangeFormattingProvider bool `json:"documentRangeFormattingProvider,omitempty"` // boolean | DocumentRangeFormattingOptions - - /*DocumentOnTypeFormattingProvider defined: + DocumentRangeFormattingProvider bool/*boolean | DocumentRangeFormattingOptions*/ `json:"documentRangeFormattingProvider,omitempty"` + /** * The server provides document formatting on typing. */ - DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"` - - /*RenameProvider defined: + DocumentOnTypeFormattingProvider DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"` + /** * The server provides rename support. RenameOptions may only be * specified if the client states that it supports * `prepareSupport` in its initial `initialize` request. */ - RenameProvider interface{} `json:"renameProvider,omitempty"` // boolean | RenameOptions - - /*FoldingRangeProvider defined: + RenameProvider RenameOptions/*boolean | RenameOptions*/ `json:"renameProvider,omitempty"` + /** * The server provides folding provider support. */ - FoldingRangeProvider bool `json:"foldingRangeProvider,omitempty"` // boolean | FoldingRangeOptions | FoldingRangeRegistrationOptions - - /*SelectionRangeProvider defined: + FoldingRangeProvider interface{}/* bool | FoldingRangeOptions | FoldingRangeRegistrationOptions*/ `json:"foldingRangeProvider,omitempty"` + /** * The server provides selection range support. */ - SelectionRangeProvider bool `json:"selectionRangeProvider,omitempty"` // boolean | SelectionRangeOptions | SelectionRangeRegistrationOptions - - /*ExecuteCommandProvider defined: + SelectionRangeProvider interface{}/* bool | SelectionRangeOptions | SelectionRangeRegistrationOptions*/ `json:"selectionRangeProvider,omitempty"` + /** * The server provides execute command support. */ - ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"` - - /*Experimental defined: + ExecuteCommandProvider ExecuteCommandOptions `json:"executeCommandProvider,omitempty"` + /** * Experimental server capabilities. */ Experimental interface{} `json:"experimental,omitempty"` } -/*Location defined: +/** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ +type InsertTextFormat float64 + +/** * Represents a location inside a resource, such as a line * inside a text file. */ type Location struct { - - // URI is - URI DocumentURI `json:"uri"` - - // Range is - Range Range `json:"range"` + URI DocumentURI `json:"uri"` + Range Range `json:"range"` } -/*LocationLink defined: +/** * Represents the connection of two locations. Provides additional metadata over normal [locations](#Location), * including an origin range. */ type LocationLink struct { - - /*OriginSelectionRange defined: + /** * Span of the origin of this link. * * Used as the underlined span for mouse definition hover. Defaults to the word range at * the definition position. */ - OriginSelectionRange *Range `json:"originSelectionRange,omitempty"` - - /*TargetURI defined: + OriginSelectionRange Range `json:"originSelectionRange,omitempty"` + /** * The target resource identifier of this link. */ TargetURI DocumentURI `json:"targetUri"` - - /*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: + /** * 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"` } -/*LogMessageParams defined: +/** * The log message parameters. */ type LogMessageParams struct { - - /*Type defined: + /** * The message type. See {@link MessageType} */ Type MessageType `json:"type"` - - /*Message defined: + /** * The actual message */ Message string `json:"message"` } -// LogTraceParams is type LogTraceParams struct { - - // Message is Message string `json:"message"` - - // Verbose is Verbose string `json:"verbose,omitempty"` } -/*MarkupContent defined: +/** + * MarkedString can be used to render human readable text. It is either a markdown string + * or a code-block that provides a language and a code snippet. The language identifier + * is semantically equal to the optional language identifier in fenced code blocks in GitHub + * issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting + * + * The pair of a language and a value is an equivalent to markdown: + * ```${language} + * ${value} + * ``` + * + * Note that markdown strings will be sanitized - that means html will be escaped. + * @deprecated use MarkupContent instead. + */ +type MarkedString = string /*string | { language: string; value: string }*/ + +/** * 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. * @@ -2323,34 +2005,43 @@ type LogTraceParams struct { * remove HTML from the markdown to avoid script execution. */ type MarkupContent struct { - - /*Kind defined: + /** * The type of the Markup */ Kind MarkupKind `json:"kind"` - - /*Value defined: + /** * The content itself */ Value string `json:"value"` } -// MessageActionItem is -type MessageActionItem struct { +/** + * Describes the content type that a client supports in various + * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + * + * Please note that `MarkupKinds` must not start with a `$`. This kinds + * are reserved for internal usage. + */ +type MarkupKind string - /*Title defined: +type MessageActionItem struct { + /** * A short title like 'Retry', 'Open Log' etc. */ Title string `json:"title"` } -/*ParameterInformation defined: +/** + * The message type + */ +type MessageType float64 + +/** * Represents a parameter of a callable-signature. A parameter can * have a label and a doc-comment. */ type ParameterInformation struct { - - /*Label defined: + /** * The label of this parameter information. * * Either a string or an inclusive start and exclusive end offsets within its containing @@ -2360,26 +2051,23 @@ type ParameterInformation struct { * *Note*: a label of type string should be a substring of its containing signature label. * Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`. */ - Label string `json:"label"` // string | [number, number] - - /*Documentation defined: + Label string/*string | [number, number]*/ `json:"label"` + /** * 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 + Documentation string/*string | MarkupContent*/ `json:"documentation,omitempty"` } -// PartialResultParams is type PartialResultParams struct { - - /*PartialResultToken defined: + /** * An optional token that a server can use to report partial results (e.g. streaming) to * the client. */ - PartialResultToken *ProgressToken `json:"partialResultToken,omitempty"` + PartialResultToken ProgressToken `json:"partialResultToken,omitempty"` } -/*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 `𐐀` @@ -2390,15 +2078,13 @@ type PartialResultParams struct { * denotes `\r|\n` or `\n|` where `|` represents the character offset. */ type Position struct { - - /*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 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`. @@ -2410,75 +2096,67 @@ type Position struct { Character float64 `json:"character"` } -// PrepareRenameParams is type PrepareRenameParams struct { TextDocumentPositionParams WorkDoneProgressParams } -// ProgressParams is type ProgressParams struct { - - /*Token defined: + /** * The progress token provided by the client or server. */ Token ProgressToken `json:"token"` - - /*Value defined: + /** * The progress data. */ Value interface{} `json:"value"` } -/*PublishDiagnosticsClientCapabilities defined: +type ProgressToken = interface{} /*number | string*/ + +/** * The publish diagnostic client capabilities. */ type PublishDiagnosticsClientCapabilities 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. * Clients supporting tags have to handle unknown tags gracefully. * * @since 3.15.0 */ - TagSupport *struct { - - /*ValueSet defined: + TagSupport struct { + /** * The tags supported by the client. */ ValueSet []DiagnosticTag `json:"valueSet"` } `json:"tagSupport,omitempty"` } -/*PublishDiagnosticsParams defined: +/** * The publish diagnostic notification's parameters. */ type PublishDiagnosticsParams struct { - - /*URI defined: + /** * The URI for which diagnostic information is reported. */ URI DocumentURI `json:"uri"` - - /*Version defined: + /** * Optional the version number of the document the diagnostics are published for. * * @since 3.15.0 */ Version float64 `json:"version,omitempty"` - - /*Diagnostics defined: + /** * An array of diagnostic information items. */ Diagnostics []Diagnostic `json:"diagnostics"` } -/*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 @@ -2492,106 +2170,83 @@ type PublishDiagnosticsParams struct { * ``` */ type Range struct { - - /*Start defined: + /** * The range's start position */ Start Position `json:"start"` - - /*End defined: + /** * The range's end position. */ End Position `json:"end"` } -/*ReferenceClientCapabilities defined: +/** * Client Capabilities for a [ReferencesRequest](#ReferencesRequest). */ type ReferenceClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether references supports dynamic registration. */ DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -/*ReferenceContext defined: +/** * Value-object that contains additional information when * requesting references. */ type ReferenceContext struct { - - /*IncludeDeclaration defined: + /** * Include the declaration of the current symbol. */ IncludeDeclaration bool `json:"includeDeclaration"` } -/*ReferenceOptions defined: +/** * Reference options. */ type ReferenceOptions struct { WorkDoneProgressOptions } -/*ReferenceParams defined: +/** * Parameters for a [ReferencesRequest](#ReferencesRequest). */ type ReferenceParams struct { - - // Context is Context ReferenceContext `json:"context"` TextDocumentPositionParams WorkDoneProgressParams PartialResultParams } -/*ReferenceRegistrationOptions defined: - * Registration options for a [ReferencesRequest](#ReferencesRequest). - */ -type ReferenceRegistrationOptions struct { - TextDocumentRegistrationOptions - ReferenceOptions -} - -/*Registration defined: +/** * General parameters to to register for an notification or to register a provider. */ type Registration struct { - - /*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: + /** * The method to register for. */ Method string `json:"method"` - - /*RegisterOptions defined: + /** * Options necessary for the registration. */ RegisterOptions interface{} `json:"registerOptions,omitempty"` } -// RegistrationParams is type RegistrationParams struct { - - // Registrations is Registrations []Registration `json:"registrations"` } -// RenameClientCapabilities is type RenameClientCapabilities 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. * @@ -2600,54 +2255,48 @@ type RenameClientCapabilities struct { PrepareSupport bool `json:"prepareSupport,omitempty"` } -/*RenameFile defined: +/** * Rename file operation */ type RenameFile struct { - - /*Kind defined: + /** * A rename */ - Kind string `json:"kind"` // 'rename' - - /*OldURI defined: + Kind string `json:"kind"` + /** * The old (existing) location. */ OldURI DocumentURI `json:"oldUri"` - - /*NewURI defined: + /** * The new location. */ NewURI DocumentURI `json:"newUri"` - - /*Options defined: + /** * Rename options. */ - Options *RenameFileOptions `json:"options,omitempty"` + Options RenameFileOptions `json:"options,omitempty"` + ResourceOperation } -/*RenameFileOptions defined: +/** * Rename file options */ type RenameFileOptions struct { - - /*Overwrite defined: + /** * Overwrite target if existing. Overwrite wins over `ignoreIfExists` */ Overwrite bool `json:"overwrite,omitempty"` - - /*IgnoreIfExists defined: + /** * Ignores if target exists. */ IgnoreIfExists bool `json:"ignoreIfExists,omitempty"` } -/*RenameOptions defined: +/** * Provider options for a [RenameRequest](#RenameRequest). */ type RenameOptions struct { - - /*PrepareProvider defined: + /** * Renames should be checked and tested before being executed. * * @since version 3.12.0 @@ -2656,22 +2305,19 @@ type RenameOptions struct { WorkDoneProgressOptions } -/*RenameParams defined: +/** * The parameters of a [RenameRequest](#RenameRequest). */ type RenameParams struct { - - /*TextDocument defined: + /** * The document to rename. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Position defined: + /** * The position at which this request was sent. */ Position Position `json:"position"` - - /*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. @@ -2680,53 +2326,39 @@ type RenameParams struct { WorkDoneProgressParams } -/*RenameRegistrationOptions defined: - * Registration options for a [RenameRequest](#RenameRequest). - */ -type RenameRegistrationOptions struct { - TextDocumentRegistrationOptions - RenameOptions -} - -// ResourceOperation is type ResourceOperation struct { - - // Kind is Kind string `json:"kind"` } -/*SaveOptions defined: +type ResourceOperationKind string + +/** * Save options. */ type SaveOptions struct { - - /*IncludeText defined: + /** * The client is supposed to include the content on save. */ IncludeText bool `json:"includeText,omitempty"` } -/*SelectionRange defined: +/** * A selection range represents a part of a selection hierarchy. A selection range * may have a parent selection range that contains it. */ type SelectionRange struct { - - /*Range defined: + /** * The [range](#Range) of this selection range. */ Range Range `json:"range"` - - /*Parent defined: + /** * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`. */ Parent *SelectionRange `json:"parent,omitempty"` } -// SelectionRangeClientCapabilities is type SelectionRangeClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether implementation supports dynamic registration for selection range providers. If this is set to `true` * the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server * capability as well. @@ -2734,22 +2366,19 @@ type SelectionRangeClientCapabilities struct { DynamicRegistration bool `json:"dynamicRegistration,omitempty"` } -// SelectionRangeOptions is type SelectionRangeOptions struct { WorkDoneProgressOptions } -/*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"` @@ -2757,263 +2386,198 @@ type SelectionRangeParams struct { PartialResultParams } -// SelectionRangeRegistrationOptions is type SelectionRangeRegistrationOptions struct { SelectionRangeOptions TextDocumentRegistrationOptions StaticRegistrationOptions } -// ServerCapabilities is -type ServerCapabilities struct { - - /*TextDocumentSync defined: +type ServerCapabilities = struct { + /** * 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 - - /*CompletionProvider defined: + TextDocumentSync interface{}/*TextDocumentSyncOptions | TextDocumentSyncKind*/ `json:"textDocumentSync,omitempty"` + /** * The server provides completion support. */ - CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"` - - /*HoverProvider defined: + CompletionProvider CompletionOptions `json:"completionProvider,omitempty"` + /** * The server provides hover support. */ - HoverProvider bool `json:"hoverProvider,omitempty"` // boolean | HoverOptions - - /*SignatureHelpProvider defined: + HoverProvider bool/*boolean | HoverOptions*/ `json:"hoverProvider,omitempty"` + /** * The server provides signature help support. */ - SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"` - - /*DeclarationProvider defined: + SignatureHelpProvider SignatureHelpOptions `json:"signatureHelpProvider,omitempty"` + /** * The server provides Goto Declaration support. */ - DeclarationProvider bool `json:"declarationProvider,omitempty"` // boolean | DeclarationOptions | DeclarationRegistrationOptions - - /*DefinitionProvider defined: + DeclarationProvider interface{}/* bool | DeclarationOptions | DeclarationRegistrationOptions*/ `json:"declarationProvider,omitempty"` + /** * The server provides goto definition support. */ - DefinitionProvider bool `json:"definitionProvider,omitempty"` // boolean | DefinitionOptions - - /*TypeDefinitionProvider defined: + DefinitionProvider bool/*boolean | DefinitionOptions*/ `json:"definitionProvider,omitempty"` + /** * The server provides Goto Type Definition support. */ - TypeDefinitionProvider bool `json:"typeDefinitionProvider,omitempty"` // boolean | TypeDefinitionOptions | TypeDefinitionRegistrationOptions - - /*ImplementationProvider defined: + TypeDefinitionProvider interface{}/* bool | TypeDefinitionOptions | TypeDefinitionRegistrationOptions*/ `json:"typeDefinitionProvider,omitempty"` + /** * The server provides Goto Implementation support. */ - ImplementationProvider bool `json:"implementationProvider,omitempty"` // boolean | ImplementationOptions | ImplementationRegistrationOptions - - /*ReferencesProvider defined: + ImplementationProvider interface{}/* bool | ImplementationOptions | ImplementationRegistrationOptions*/ `json:"implementationProvider,omitempty"` + /** * The server provides find references support. */ - ReferencesProvider bool `json:"referencesProvider,omitempty"` // boolean | ReferenceOptions - - /*DocumentHighlightProvider defined: + ReferencesProvider bool/*boolean | ReferenceOptions*/ `json:"referencesProvider,omitempty"` + /** * The server provides document highlight support. */ - DocumentHighlightProvider bool `json:"documentHighlightProvider,omitempty"` // boolean | DocumentHighlightOptions - - /*DocumentSymbolProvider defined: + DocumentHighlightProvider bool/*boolean | DocumentHighlightOptions*/ `json:"documentHighlightProvider,omitempty"` + /** * The server provides document symbol support. */ - DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"` // boolean | DocumentSymbolOptions - - /*CodeActionProvider defined: + DocumentSymbolProvider bool/*boolean | DocumentSymbolOptions*/ `json:"documentSymbolProvider,omitempty"` + /** * The server provides code actions. CodeActionOptions may only be * specified if the client states that it supports * `codeActionLiteralSupport` in its initial `initialize` request. */ - CodeActionProvider interface{} `json:"codeActionProvider,omitempty"` // boolean | CodeActionOptions - - /*CodeLensProvider defined: + CodeActionProvider interface{}/*boolean | CodeActionOptions*/ `json:"codeActionProvider,omitempty"` + /** * The server provides code lens. */ - CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"` - - /*DocumentLinkProvider defined: + CodeLensProvider CodeLensOptions `json:"codeLensProvider,omitempty"` + /** * The server provides document link support. */ - DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"` - - /*ColorProvider defined: + DocumentLinkProvider DocumentLinkOptions `json:"documentLinkProvider,omitempty"` + /** * The server provides color provider support. */ - ColorProvider bool `json:"colorProvider,omitempty"` // boolean | DocumentColorOptions | DocumentColorRegistrationOptions - - /*WorkspaceSymbolProvider defined: + ColorProvider interface{}/* bool | DocumentColorOptions | DocumentColorRegistrationOptions*/ `json:"colorProvider,omitempty"` + /** * The server provides workspace symbol support. */ - WorkspaceSymbolProvider bool `json:"workspaceSymbolProvider,omitempty"` // boolean | WorkspaceSymbolOptions - - /*DocumentFormattingProvider defined: + WorkspaceSymbolProvider bool/*boolean | WorkspaceSymbolOptions*/ `json:"workspaceSymbolProvider,omitempty"` + /** * The server provides document formatting. */ - DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"` // boolean | DocumentFormattingOptions - - /*DocumentRangeFormattingProvider defined: + DocumentFormattingProvider bool/*boolean | DocumentFormattingOptions*/ `json:"documentFormattingProvider,omitempty"` + /** * The server provides document range formatting. */ - DocumentRangeFormattingProvider bool `json:"documentRangeFormattingProvider,omitempty"` // boolean | DocumentRangeFormattingOptions - - /*DocumentOnTypeFormattingProvider defined: + DocumentRangeFormattingProvider bool/*boolean | DocumentRangeFormattingOptions*/ `json:"documentRangeFormattingProvider,omitempty"` + /** * The server provides document formatting on typing. */ - DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"` - - /*RenameProvider defined: + DocumentOnTypeFormattingProvider DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"` + /** * The server provides rename support. RenameOptions may only be * specified if the client states that it supports * `prepareSupport` in its initial `initialize` request. */ - RenameProvider interface{} `json:"renameProvider,omitempty"` // boolean | RenameOptions - - /*FoldingRangeProvider defined: + RenameProvider RenameOptions/*boolean | RenameOptions*/ `json:"renameProvider,omitempty"` + /** * The server provides folding provider support. */ - FoldingRangeProvider bool `json:"foldingRangeProvider,omitempty"` // boolean | FoldingRangeOptions | FoldingRangeRegistrationOptions - - /*SelectionRangeProvider defined: + FoldingRangeProvider interface{}/* bool | FoldingRangeOptions | FoldingRangeRegistrationOptions*/ `json:"foldingRangeProvider,omitempty"` + /** * The server provides selection range support. */ - SelectionRangeProvider bool `json:"selectionRangeProvider,omitempty"` // boolean | SelectionRangeOptions | SelectionRangeRegistrationOptions - - /*ExecuteCommandProvider defined: + SelectionRangeProvider interface{}/* bool | SelectionRangeOptions | SelectionRangeRegistrationOptions*/ `json:"selectionRangeProvider,omitempty"` + /** * The server provides execute command support. */ - ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"` - - /*Experimental defined: + ExecuteCommandProvider ExecuteCommandOptions `json:"executeCommandProvider,omitempty"` + /** * Experimental server capabilities. */ Experimental interface{} `json:"experimental,omitempty"` - - /*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"` + Workspace WorkspaceGn `json:"workspace,omitempty"` } -// SetTraceParams is type SetTraceParams struct { - - // Value is Value TraceValues `json:"value"` } -/*ShowMessageParams defined: +/** * The parameters of a notification message. */ type ShowMessageParams struct { - - /*Type defined: + /** * The message type. See {@link MessageType} */ Type MessageType `json:"type"` - - /*Message defined: + /** * The actual message */ Message string `json:"message"` } -// ShowMessageRequestParams is type ShowMessageRequestParams struct { - - /*Type defined: + /** * The message type. See {@link MessageType} */ Type MessageType `json:"type"` - - /*Message defined: + /** * The actual message */ Message string `json:"message"` - - /*Actions defined: + /** * The message action items to present. */ Actions []MessageActionItem `json:"actions,omitempty"` } -/*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: + /** * One or more signatures. */ Signatures []SignatureInformation `json:"signatures"` - - /*ActiveSignature defined: + /** * The active signature. Set to `null` if no * signatures exist. */ - ActiveSignature float64 `json:"activeSignature"` - - /*ActiveParameter defined: + ActiveSignature float64/*number | null*/ `json:"activeSignature"` + /** * The active parameter of the active signature. Set to `null` * if the active signature has no parameters. */ - ActiveParameter float64 `json:"activeParameter"` + ActiveParameter float64/*number | null*/ `json:"activeParameter"` } -/*SignatureHelpClientCapabilities defined: +/** * Client Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest). */ type SignatureHelpClientCapabilities 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: + SignatureInformation struct { + /** * 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: + ParameterInformation struct { + /** * The client supports processing label offsets instead of a * simple label string. * @@ -3022,8 +2586,7 @@ type SignatureHelpClientCapabilities struct { LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"` } `json:"parameterInformation,omitempty"` } `json:"signatureInformation,omitempty"` - - /*ContextSupport defined: + /** * The client supports to send additional context information for a * `textDocument/signatureHelp` request. A client that opts into * contextSupport will also support the `retriggerCharacters` on @@ -3034,53 +2597,47 @@ type SignatureHelpClientCapabilities struct { ContextSupport bool `json:"contextSupport,omitempty"` } -/*SignatureHelpContext defined: +/** * Additional information about the context in which a signature help request was triggered. * * @since 3.15.0 */ type SignatureHelpContext struct { - - /*TriggerKind defined: + /** * Action that caused signature help to be triggered. */ TriggerKind SignatureHelpTriggerKind `json:"triggerKind"` - - /*TriggerCharacter defined: + /** * Character that caused signature help to be triggered. * * This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter` */ TriggerCharacter string `json:"triggerCharacter,omitempty"` - - /*IsRetrigger defined: + /** * `true` if signature help was already showing when it was triggered. * * Retriggers occur when the signature help is already active and can be caused by actions such as * typing a trigger character, a cursor move, or document content changes. */ IsRetrigger bool `json:"isRetrigger"` - - /*ActiveSignatureHelp defined: + /** * The currently active `SignatureHelp`. * * The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on * the user navigating through available signatures. */ - ActiveSignatureHelp *SignatureHelp `json:"activeSignatureHelp,omitempty"` + ActiveSignatureHelp SignatureHelp `json:"activeSignatureHelp,omitempty"` } -/*SignatureHelpOptions defined: +/** * Server Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest). */ type SignatureHelpOptions struct { - - /*TriggerCharacters defined: + /** * List of characters that trigger signature help. */ TriggerCharacters []string `json:"triggerCharacters,omitempty"` - - /*RetriggerCharacters defined: + /** * List of characters that re-trigger signature help. * * These trigger characters are only active when signature help is already showing. All trigger characters @@ -3092,90 +2649,80 @@ type SignatureHelpOptions struct { WorkDoneProgressOptions } -/*SignatureHelpParams defined: +/** * Parameters for a [SignatureHelpRequest](#SignatureHelpRequest). */ type SignatureHelpParams struct { - - /*Context defined: + /** * The signature help context. This is only available if the client specifies * to send this using the client capability `textDocument.signatureHelp.contextSupport === true` * * @since 3.15.0 */ - Context *SignatureHelpContext `json:"context,omitempty"` + Context SignatureHelpContext `json:"context,omitempty"` TextDocumentPositionParams WorkDoneProgressParams } -/*SignatureHelpRegistrationOptions defined: - * Registration options for a [SignatureHelpRequest](#SignatureHelpRequest). +/** + * How a signature help was triggered. + * + * @since 3.15.0 */ -type SignatureHelpRegistrationOptions struct { - TextDocumentRegistrationOptions - SignatureHelpOptions -} +type SignatureHelpTriggerKind float64 -/*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: + /** * The label of this signature. Will be shown in * the UI. */ Label string `json:"label"` - - /*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: + Documentation string/*string | MarkupContent*/ `json:"documentation,omitempty"` + /** * The parameters of this signature. */ Parameters []ParameterInformation `json:"parameters,omitempty"` } -/*StaticRegistrationOptions defined: +/** * Static registration options to be returned in the initialize * request. */ type StaticRegistrationOptions struct { - - /*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"` } -/*SymbolInformation defined: +/** * Represents information about programming constructs like variables, classes, * interfaces etc. */ type SymbolInformation struct { - - /*Name defined: + /** * The name of this symbol. */ Name string `json:"name"` - - /*Kind defined: + /** * The kind of this symbol. */ Kind SymbolKind `json:"kind"` - - /*Deprecated defined: + /** * Indicates if this symbol is deprecated. */ Deprecated bool `json:"deprecated,omitempty"` - - /*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 @@ -3187,8 +2734,7 @@ type SymbolInformation struct { * the symbols. */ Location Location `json:"location"` - - /*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 @@ -3197,299 +2743,225 @@ type SymbolInformation struct { ContainerName string `json:"containerName,omitempty"` } -/*TextDocument defined: - * A simple text document. Not to be implemented. +/** + * A symbol kind. */ -type TextDocument struct { +type SymbolKind float64 - /*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. - * - * @readonly - */ - URI DocumentURI `json:"uri"` - - /*LanguageID defined: - * The identifier of the language associated with this document. - * - * @readonly - */ - LanguageID string `json:"languageId"` - - /*Version defined: - * The version number of this document (it will increase after each - * change, including undo/redo). - * - * @readonly - */ - Version float64 `json:"version"` - - /*LineCount defined: - * The number of lines in this document. - * - * @readonly - */ - LineCount float64 `json:"lineCount"` -} - -/*TextDocumentChangeEvent defined: - * Event to signal changes to a simple text document. - */ -type TextDocumentChangeEvent struct { - - /*Document defined: - * The document that has changed. - */ - Document TextDocument `json:"document"` -} - -/*TextDocumentChangeRegistrationOptions defined: +/** * Describe options to be used when registered for text document change events. */ type TextDocumentChangeRegistrationOptions struct { - - /*SyncKind defined: + /** * How documents are synced to the server. */ SyncKind TextDocumentSyncKind `json:"syncKind"` TextDocumentRegistrationOptions } -/*TextDocumentClientCapabilities defined: +/** * Text document specific client capabilities. */ type TextDocumentClientCapabilities struct { - - /*Synchronization defined: + /** * Defines which synchronization capabilities the client supports. */ - Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"` - - /*Completion defined: + Synchronization TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"` + /** * Capabilities specific to the `textDocument/completion` */ - Completion *CompletionClientCapabilities `json:"completion,omitempty"` - - /*Hover defined: + Completion CompletionClientCapabilities `json:"completion,omitempty"` + /** * Capabilities specific to the `textDocument/hover` */ - Hover *HoverClientCapabilities `json:"hover,omitempty"` - - /*SignatureHelp defined: + Hover HoverClientCapabilities `json:"hover,omitempty"` + /** * Capabilities specific to the `textDocument/signatureHelp` */ - SignatureHelp *SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"` - - /*Declaration defined: + SignatureHelp SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"` + /** * Capabilities specific to the `textDocument/declaration` * * @since 3.14.0 */ - Declaration *DeclarationClientCapabilities `json:"declaration,omitempty"` - - /*Definition defined: + Declaration DeclarationClientCapabilities `json:"declaration,omitempty"` + /** * Capabilities specific to the `textDocument/definition` */ - Definition *DefinitionClientCapabilities `json:"definition,omitempty"` - - /*TypeDefinition defined: + Definition DefinitionClientCapabilities `json:"definition,omitempty"` + /** * Capabilities specific to the `textDocument/typeDefinition` * * @since 3.6.0 */ - TypeDefinition *TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"` - - /*Implementation defined: + TypeDefinition TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"` + /** * Capabilities specific to the `textDocument/implementation` * * @since 3.6.0 */ - Implementation *ImplementationClientCapabilities `json:"implementation,omitempty"` - - /*References defined: + Implementation ImplementationClientCapabilities `json:"implementation,omitempty"` + /** * Capabilities specific to the `textDocument/references` */ - References *ReferenceClientCapabilities `json:"references,omitempty"` - - /*DocumentHighlight defined: + References ReferenceClientCapabilities `json:"references,omitempty"` + /** * Capabilities specific to the `textDocument/documentHighlight` */ - DocumentHighlight *DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"` - - /*DocumentSymbol defined: + DocumentHighlight DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"` + /** * Capabilities specific to the `textDocument/documentSymbol` */ - DocumentSymbol *DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"` - - /*CodeAction defined: + DocumentSymbol DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"` + /** * Capabilities specific to the `textDocument/codeAction` */ - CodeAction *CodeActionClientCapabilities `json:"codeAction,omitempty"` - - /*CodeLens defined: + CodeAction CodeActionClientCapabilities `json:"codeAction,omitempty"` + /** * Capabilities specific to the `textDocument/codeLens` */ - CodeLens *CodeLensClientCapabilities `json:"codeLens,omitempty"` - - /*DocumentLink defined: + CodeLens CodeLensClientCapabilities `json:"codeLens,omitempty"` + /** * Capabilities specific to the `textDocument/documentLink` */ - DocumentLink *DocumentLinkClientCapabilities `json:"documentLink,omitempty"` - - /*ColorProvider defined: + DocumentLink DocumentLinkClientCapabilities `json:"documentLink,omitempty"` + /** * Capabilities specific to the `textDocument/documentColor` */ - ColorProvider *DocumentColorClientCapabilities `json:"colorProvider,omitempty"` - - /*Formatting defined: + ColorProvider DocumentColorClientCapabilities `json:"colorProvider,omitempty"` + /** * Capabilities specific to the `textDocument/formatting` */ - Formatting *DocumentFormattingClientCapabilities `json:"formatting,omitempty"` - - /*RangeFormatting defined: + Formatting DocumentFormattingClientCapabilities `json:"formatting,omitempty"` + /** * Capabilities specific to the `textDocument/rangeFormatting` */ - RangeFormatting *DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"` - - /*OnTypeFormatting defined: + RangeFormatting DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"` + /** * Capabilities specific to the `textDocument/onTypeFormatting` */ - OnTypeFormatting *DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"` - - /*Rename defined: + OnTypeFormatting DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"` + /** * Capabilities specific to the `textDocument/rename` */ - Rename *RenameClientCapabilities `json:"rename,omitempty"` - - /*FoldingRange defined: + Rename RenameClientCapabilities `json:"rename,omitempty"` + /** * Capabilities specific to `textDocument/foldingRange` requests. * * @since 3.10.0 */ - FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitempty"` - - /*SelectionRange defined: + FoldingRange FoldingRangeClientCapabilities `json:"foldingRange,omitempty"` + /** * Capabilities specific to `textDocument/selectionRange` requests * * @since 3.15.0 */ - SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitempty"` - - /*PublishDiagnostics defined: + SelectionRange SelectionRangeClientCapabilities `json:"selectionRange,omitempty"` + /** * Capabilities specific to `textDocument/publishDiagnostics`. */ - PublishDiagnostics *PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"` + PublishDiagnostics PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"` } -/*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: + /** * The range of the document that changed. */ - Range *Range `json:"range,omitempty"` - - /*RangeLength defined: + Range Range `json:"range,omitempty"` + /** * The length of the range that got replaced. */ RangeLength float64 `json:"rangeLength,omitempty"` - - /*Text defined: + /** * The new text of the document. */ Text string `json:"text"` } -/*TextDocumentEdit defined: +/** * Describes textual changes on a text document. */ type TextDocumentEdit struct { - - /*TextDocument defined: + /** * The text document to change. */ TextDocument VersionedTextDocumentIdentifier `json:"textDocument"` - - /*Edits defined: + /** * The edits to be applied. */ Edits []TextEdit `json:"edits"` } -/*TextDocumentIdentifier defined: +/** * A literal to identify a text document in the client. */ type TextDocumentIdentifier struct { - - /*URI defined: + /** * The text document's uri. */ URI DocumentURI `json:"uri"` } -/*TextDocumentItem defined: +/** * An item to transfer a text document from the client to the * server. */ type TextDocumentItem struct { - - /*URI defined: + /** * The text document's uri. */ URI DocumentURI `json:"uri"` - - /*LanguageID defined: + /** * The text document's language identifier */ LanguageID string `json:"languageId"` - - /*Version defined: + /** * The version number of this document (it will increase after each * change, including undo/redo). */ Version float64 `json:"version"` - - /*Text defined: + /** * The content of the opened text document. */ Text string `json:"text"` } -/*TextDocumentPositionParams defined: +/** * A parameter literal used in requests to pass a text document and a position inside that * document. */ type TextDocumentPositionParams struct { - - /*TextDocument defined: + /** * The text document. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Position defined: + /** * The position inside the text document. */ Position Position `json:"position"` } -/*TextDocumentRegistrationOptions defined: +/** * General text document registration options. */ type TextDocumentRegistrationOptions struct { - - /*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"` + DocumentSelector DocumentSelector /*DocumentSelector | null*/ `json:"documentSelector"` } -/*TextDocumentSaveRegistrationOptions defined: +/** + * Represents reasons why a text document is saved. + */ +type TextDocumentSaveReason float64 + +/** * Save registration options. */ type TextDocumentSaveRegistrationOptions struct { @@ -3497,121 +2969,90 @@ type TextDocumentSaveRegistrationOptions struct { SaveOptions } -// TextDocumentSyncClientCapabilities is type TextDocumentSyncClientCapabilities 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"` } -// TextDocumentSyncOptions is -type TextDocumentSyncOptions struct { +/** + * Defines how the host (editor) should sync + * document changes to the language server. + */ +type TextDocumentSyncKind float64 - /*OpenClose defined: +type TextDocumentSyncOptions struct { + /** * Open and close notifications are sent to the server. If omitted open close notification should not * be sent. */ OpenClose bool `json:"openClose,omitempty"` - - /*Change defined: + /** * Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full * and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None. */ Change TextDocumentSyncKind `json:"change,omitempty"` - - /*WillSave defined: + /** * If present will save notifications are sent to the server. If omitted the notification should not be * sent. */ WillSave bool `json:"willSave,omitempty"` - - /*WillSaveWaitUntil defined: + /** * If present will save wait until requests are sent to the server. If omitted the request should not be * sent. */ WillSaveWaitUntil bool `json:"willSaveWaitUntil,omitempty"` - - /*Save defined: + /** * If present save notifications are sent to the server. If omitted the notification should not be * sent. */ - Save *SaveOptions `json:"save,omitempty"` + Save SaveOptions `json:"save,omitempty"` } -// TextDocumentWillSaveEvent is -type TextDocumentWillSaveEvent struct { - - /*Document defined: - * The document that will be saved - */ - Document TextDocument `json:"document"` - - /*Reason defined: - * The reason why save was triggered. - */ - Reason TextDocumentSaveReason `json:"reason"` -} - -/*TextEdit defined: +/** * A text edit applicable to a text document. */ type TextEdit struct { - - /*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: + /** * The string to be inserted. For delete operations use an * empty string. */ NewText string `json:"newText"` } -/*TextEditChange defined: - * A change to capture text edits for existing resources. - */ -type TextEditChange struct { -} +type TraceValues = string /*'off' | 'messages' | 'verbose'*/ -// Tracer is -type Tracer struct { -} - -/*TypeDefinitionClientCapabilities defined: +/** * Since 3.6.0 */ type TypeDefinitionClientCapabilities struct { - - /*DynamicRegistration defined: + /** * Whether implementation supports dynamic registration. If this is set to `true` * the client supports the new `TypeDefinitionRegistrationOptions` 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. * * Since 3.14.0 @@ -3619,148 +3060,127 @@ type TypeDefinitionClientCapabilities struct { LinkSupport bool `json:"linkSupport,omitempty"` } -// TypeDefinitionOptions is type TypeDefinitionOptions struct { WorkDoneProgressOptions } -// TypeDefinitionParams is type TypeDefinitionParams struct { TextDocumentPositionParams WorkDoneProgressParams PartialResultParams } -// TypeDefinitionRegistrationOptions is type TypeDefinitionRegistrationOptions struct { TextDocumentRegistrationOptions TypeDefinitionOptions StaticRegistrationOptions } -/*Unregistration defined: +/** * General parameters to unregister a request or notification. */ type Unregistration struct { - - /*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: + /** * The method to unregister for. */ Method string `json:"method"` } -// UnregistrationParams is type UnregistrationParams struct { - - // Unregisterations is Unregisterations []Unregistration `json:"unregisterations"` } -/*VersionedTextDocumentIdentifier defined: +/** * An identifier to denote a specific version of a text document. */ type VersionedTextDocumentIdentifier struct { - - /*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 * `null` to indicate that the version is unknown and the content on disk is the * truth (as speced with document content ownership). */ - Version float64 `json:"version"` + Version float64/*number | null*/ `json:"version"` TextDocumentIdentifier } -/*WillSaveTextDocumentParams defined: +type WatchKind float64 + +/** * The parameters send in a will save text document notification. */ type WillSaveTextDocumentParams struct { - - /*TextDocument defined: + /** * The document that will be saved. */ TextDocument TextDocumentIdentifier `json:"textDocument"` - - /*Reason defined: + /** * The 'TextDocumentSaveReason'. */ Reason TextDocumentSaveReason `json:"reason"` } -// WorkDoneProgressOptions is type WorkDoneProgressOptions struct { - - // WorkDoneProgress is WorkDoneProgress bool `json:"workDoneProgress,omitempty"` } -// WorkDoneProgressParams is type WorkDoneProgressParams struct { - - /*WorkDoneToken defined: + /** * An optional token that a server can use to report work done progress. */ - WorkDoneToken *ProgressToken `json:"workDoneToken,omitempty"` + WorkDoneToken ProgressToken `json:"workDoneToken,omitempty"` } -/*WorkspaceClientCapabilities defined: +/** * Workspace specific client capabilities. */ type WorkspaceClientCapabilities struct { - - /*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 *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"` - - /*DidChangeConfiguration defined: + WorkspaceEdit WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"` + /** * Capabilities specific to the `workspace/didChangeConfiguration` notification. */ - DidChangeConfiguration *DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"` - - /*DidChangeWatchedFiles defined: + DidChangeConfiguration DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"` + /** * Capabilities specific to the `workspace/didChangeWatchedFiles` notification. */ - DidChangeWatchedFiles *DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"` - - /*Symbol defined: + DidChangeWatchedFiles DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"` + /** * Capabilities specific to the `workspace/symbol` request. */ - Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"` - - /*ExecuteCommand defined: + Symbol WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"` + /** * Capabilities specific to the `workspace/executeCommand` request. */ - ExecuteCommand *ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"` + ExecuteCommand ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"` } -/*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: + /** * Holds changes to existing resources. */ - Changes *map[string][]TextEdit `json:"changes,omitempty"` // [uri: string]: TextEdit[]; - - /*DocumentChanges defined: + Changes struct { + } `json:"changes,omitempty"` + /** * 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 @@ -3772,26 +3192,22 @@ type WorkspaceEdit struct { * If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then * only plain `TextEdit`s using the `changes` property are supported. */ - DocumentChanges []TextDocumentEdit `json:"documentChanges,omitempty"` // (TextDocumentEdit | CreateFile | RenameFile | DeleteFile) + DocumentChanges []TextDocumentEdit/*TextDocumentEdit | CreateFile | RenameFile | DeleteFile*/ `json:"documentChanges,omitempty"` } -// WorkspaceEditClientCapabilities is type WorkspaceEditClientCapabilities 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. * * @since 3.13.0 */ ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"` - - /*FailureHandling defined: + /** * The failure handling strategy of a client if applying the workspace edit * fails. * @@ -3800,107 +3216,66 @@ type WorkspaceEditClientCapabilities struct { FailureHandling FailureHandlingKind `json:"failureHandling,omitempty"` } -// WorkspaceFolder is type WorkspaceFolder struct { - - /*URI defined: + /** * The associated URI for this workspace folder. */ URI string `json:"uri"` - - /*Name defined: + /** * The name of the workspace folder. Used to refer to this * workspace folder in thge user interface. */ Name string `json:"name"` } -/*WorkspaceFoldersChangeEvent defined: +/** * The workspace folder change event. */ type WorkspaceFoldersChangeEvent struct { - - /*Added defined: + /** * The array of added workspace folders */ Added []WorkspaceFolder `json:"added"` - - /*Removed defined: + /** * The array of the removed workspace folders */ Removed []WorkspaceFolder `json:"removed"` } -// 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"` + Workspace WorkspaceGn `json:"workspace,omitempty"` } -// WorkspaceFoldersInitializeParams is type WorkspaceFoldersInitializeParams struct { - - /*WorkspaceFolders defined: + /** * The actual configured workspace folders. */ - WorkspaceFolders []WorkspaceFolder `json:"workspaceFolders"` + WorkspaceFolders []WorkspaceFolder /*WorkspaceFolder[] | null*/ `json:"workspaceFolders"` } -// 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"` + Workspace WorkspaceGn `json:"workspace,omitempty"` } -/*WorkspaceSymbolClientCapabilities defined: +/** * Client capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). */ type WorkspaceSymbolClientCapabilities 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: + SymbolKind struct { + /** * 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 @@ -3914,19 +3289,18 @@ type WorkspaceSymbolClientCapabilities struct { } `json:"symbolKind,omitempty"` } -/*WorkspaceSymbolOptions defined: +/** * Server capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). */ type WorkspaceSymbolOptions struct { WorkDoneProgressOptions } -/*WorkspaceSymbolParams defined: +/** * The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). */ type WorkspaceSymbolParams struct { - - /*Query defined: + /** * A query string to filter symbols by. Clients may send an empty * string here to request all symbols. */ @@ -3935,491 +3309,23 @@ type WorkspaceSymbolParams struct { PartialResultParams } -/*WorkspaceSymbolRegistrationOptions defined: - * Registration options for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest). - */ -type WorkspaceSymbolRegistrationOptions struct { - WorkspaceSymbolOptions -} - -// FoldingRangeKind defines constants -type FoldingRangeKind string - -// ResourceOperationKind defines constants -type ResourceOperationKind string - -// FailureHandlingKind defines constants -type FailureHandlingKind string - -// InitializeError defines constants -type InitializeError float64 - -// MessageType defines constants -type MessageType float64 - -// TextDocumentSyncKind defines constants -type TextDocumentSyncKind float64 - -// FileChangeType defines constants -type FileChangeType float64 - -// WatchKind defines constants -type WatchKind float64 - -// CompletionTriggerKind defines constants -type CompletionTriggerKind float64 - -// SignatureHelpTriggerKind defines constants -type SignatureHelpTriggerKind float64 - -// DiagnosticSeverity defines constants -type DiagnosticSeverity float64 - -// DiagnosticTag defines constants -type DiagnosticTag float64 - -// MarkupKind defines constants -type MarkupKind string - -// CompletionItemKind defines constants -type CompletionItemKind float64 - -// InsertTextFormat defines constants -type InsertTextFormat float64 - -// CompletionItemTag defines constants -type CompletionItemTag float64 - -// DocumentHighlightKind defines constants -type DocumentHighlightKind float64 - -// SymbolKind defines constants -type SymbolKind float64 - -// CodeActionKind defines constants -type CodeActionKind string - -// TextDocumentSaveReason defines constants -type TextDocumentSaveReason float64 - -// ErrorCodes defines constants -type ErrorCodes float64 - -// Touch defines constants -type Touch float64 - -// Trace defines constants -type Trace string - -// TraceFormat defines constants -type TraceFormat string - -// ConnectionErrors defines constants -type ConnectionErrors float64 - -// ConnectionState defines constants -type ConnectionState float64 - const ( - - /*Comment defined: - * Folding range for a comment - */ - Comment FoldingRangeKind = "comment" - - /*Imports defined: - * Folding range for a imports or includes - */ - Imports FoldingRangeKind = "imports" - - /*Region defined: - * Folding range for a region (e.g. `#region`) - */ - Region FoldingRangeKind = "region" - - /*Create defined: - * Supports creating new files and folders. - */ - Create ResourceOperationKind = "create" - - /*Rename defined: - * Supports renaming existing files and folders. - */ - Rename ResourceOperationKind = "rename" - - /*Delete defined: - * Supports deleting existing files and folders. - */ - Delete ResourceOperationKind = "delete" - - /*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 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 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 defined: - * The client tries to undo the operations already executed. But there is no - * guaruntee that this is succeeding. - */ - Undo FailureHandlingKind = "undo" - - /*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 defined: - * An error message. - */ - Error MessageType = 1 - - /*Warning defined: - * A warning message. - */ - Warning MessageType = 2 - - /*Info defined: - * An information message. - */ - Info MessageType = 3 - - /*Log defined: - * A log message. - */ - Log MessageType = 4 - - /*None defined: - * Documents should not be synced at all. - */ - None TextDocumentSyncKind = 0 - - /*Full defined: - * Documents are synced by always sending the full content - * of the document. - */ - Full TextDocumentSyncKind = 1 - - /*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 - - /*Created defined: - * The file got created. - */ - Created FileChangeType = 1 - - /*Changed defined: - * The file got changed. - */ - Changed FileChangeType = 2 - - /*Deleted defined: - * The file got deleted. - */ - Deleted FileChangeType = 3 - - /*WatchCreate defined: - * Interested in create events. - */ - WatchCreate WatchKind = 1 - - /*WatchChange defined: - * Interested in change events - */ - WatchChange WatchKind = 2 - - /*WatchDelete defined: - * Interested in delete events - */ - WatchDelete WatchKind = 4 - - /*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 defined: - * Completion was triggered by a trigger character specified by - * the `triggerCharacters` properties of the `CompletionRegistrationOptions`. - */ - TriggerCharacter CompletionTriggerKind = 2 - - /*TriggerForIncompleteCompletions defined: - * Completion was re-triggered as current completion list is incomplete - */ - TriggerForIncompleteCompletions CompletionTriggerKind = 3 - - /*ContentChange defined: - * Signature help was triggered by the cursor moving or by the document content changing. - */ - ContentChange SignatureHelpTriggerKind = 3 - - /*SeverityError defined: - * Reports an error. - */ - SeverityError DiagnosticSeverity = 1 - - /*SeverityWarning defined: - * Reports a warning. - */ - SeverityWarning DiagnosticSeverity = 2 - - /*SeverityInformation defined: - * Reports an information. - */ - SeverityInformation DiagnosticSeverity = 3 - - /*SeverityHint defined: - * Reports a hint. - */ - SeverityHint DiagnosticSeverity = 4 - - /*Unnecessary defined: - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - Unnecessary DiagnosticTag = 1 - - /*Deprecated defined: - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - Deprecated DiagnosticTag = 2 - - /*PlainText defined: - * Plain text is supported as a content format - */ - PlainText MarkupKind = "plaintext" - - /*Markdown defined: - * Markdown is supported as a content format - */ - Markdown MarkupKind = "markdown" - - // TextCompletion is - TextCompletion CompletionItemKind = 1 - - // MethodCompletion is - MethodCompletion CompletionItemKind = 2 - - // FunctionCompletion is - FunctionCompletion CompletionItemKind = 3 - - // ConstructorCompletion is - ConstructorCompletion CompletionItemKind = 4 - - // FieldCompletion is - FieldCompletion CompletionItemKind = 5 - - // VariableCompletion is - VariableCompletion CompletionItemKind = 6 - - // ClassCompletion is - ClassCompletion CompletionItemKind = 7 - - // InterfaceCompletion is - InterfaceCompletion CompletionItemKind = 8 - - // ModuleCompletion is - ModuleCompletion CompletionItemKind = 9 - - // PropertyCompletion is - PropertyCompletion CompletionItemKind = 10 - - // UnitCompletion is - UnitCompletion CompletionItemKind = 11 - - // ValueCompletion is - ValueCompletion CompletionItemKind = 12 - - // EnumCompletion is - EnumCompletion CompletionItemKind = 13 - - // KeywordCompletion is - KeywordCompletion CompletionItemKind = 14 - - // SnippetCompletion is - SnippetCompletion CompletionItemKind = 15 - - // ColorCompletion is - ColorCompletion CompletionItemKind = 16 - - // FileCompletion is - FileCompletion CompletionItemKind = 17 - - // ReferenceCompletion is - ReferenceCompletion CompletionItemKind = 18 - - // FolderCompletion is - FolderCompletion CompletionItemKind = 19 - - // EnumMemberCompletion is - EnumMemberCompletion CompletionItemKind = 20 - - // ConstantCompletion is - ConstantCompletion CompletionItemKind = 21 - - // StructCompletion is - StructCompletion CompletionItemKind = 22 - - // EventCompletion is - EventCompletion CompletionItemKind = 23 - - // OperatorCompletion is - OperatorCompletion CompletionItemKind = 24 - - // TypeParameterCompletion is - TypeParameterCompletion CompletionItemKind = 25 - - /*PlainTextTextFormat defined: - * The primary text to be inserted is treated as a plain string. - */ - PlainTextTextFormat InsertTextFormat = 1 - - /*SnippetTextFormat defined: - * The primary text to be inserted is treated as a snippet. - * - * 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. - * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md - */ - SnippetTextFormat InsertTextFormat = 2 - - /*Text defined: - * A textual occurrence. - */ - Text DocumentHighlightKind = 1 - - /*Read defined: - * Read-access of a symbol, like reading a variable. - */ - Read DocumentHighlightKind = 2 - - /*Write defined: - * Write-access of a symbol, like writing to a variable. - */ - Write DocumentHighlightKind = 3 - - // File is - File SymbolKind = 1 - - // Module is - Module SymbolKind = 2 - - // Namespace is - Namespace SymbolKind = 3 - - // Package is - Package SymbolKind = 4 - - // Class is - Class SymbolKind = 5 - - // Method is - Method SymbolKind = 6 - - // Property is - Property SymbolKind = 7 - - // Field is - Field SymbolKind = 8 - - // Constructor is - Constructor SymbolKind = 9 - - // Enum is - Enum SymbolKind = 10 - - // Interface is - Interface SymbolKind = 11 - - // Function is - Function SymbolKind = 12 - - // Variable is - Variable SymbolKind = 13 - - // Constant is - Constant SymbolKind = 14 - - // String is - String SymbolKind = 15 - - // Number is - Number SymbolKind = 16 - - // Boolean is - Boolean SymbolKind = 17 - - // Array is - Array SymbolKind = 18 - - // Object is - Object SymbolKind = 19 - - // Key is - Key SymbolKind = 20 - - // Null is - Null SymbolKind = 21 - - // EnumMember is - EnumMember SymbolKind = 22 - - // Struct is - Struct SymbolKind = 23 - - // Event is - Event SymbolKind = 24 - - // Operator is - Operator SymbolKind = 25 - - // TypeParameter is - TypeParameter SymbolKind = 26 - - /*Empty defined: + /** * Empty kind. */ - Empty CodeActionKind = "" - /*QuickFix defined: + Empty CodeActionKind = "" + /** * Base kind for quickfix actions: 'quickfix' */ - QuickFix CodeActionKind = "quickfix" - /*Refactor defined: + QuickFix CodeActionKind = "quickfix" + /** * Base kind for refactoring actions: 'refactor' */ - Refactor CodeActionKind = "refactor" - /*RefactorExtract defined: + Refactor CodeActionKind = "refactor" + /** * Base kind for refactoring extraction actions: 'refactor.extract' * * Example extract actions: @@ -4430,9 +3336,9 @@ const ( * - Extract interface from class * - ... */ - RefactorExtract CodeActionKind = "refactor.extract" - /*RefactorInline defined: + RefactorExtract CodeActionKind = "refactor.extract" + /** * Base kind for refactoring inline actions: 'refactor.inline' * * Example inline actions: @@ -4442,9 +3348,9 @@ const ( * - Inline constant * - ... */ - RefactorInline CodeActionKind = "refactor.inline" - /*RefactorRewrite defined: + RefactorInline CodeActionKind = "refactor.inline" + /** * Base kind for refactoring rewrite actions: 'refactor.rewrite' * * Example rewrite actions: @@ -4456,161 +3362,356 @@ const ( * - Move method to base class * - ... */ - RefactorRewrite CodeActionKind = "refactor.rewrite" - /*Source defined: + RefactorRewrite CodeActionKind = "refactor.rewrite" + /** * Base kind for source actions: `source` * * Source code actions apply to the entire file. */ - Source CodeActionKind = "source" - /*SourceOrganizeImports defined: + Source CodeActionKind = "source" + /** * Base kind for an organize imports source action: `source.organizeImports` */ - SourceOrganizeImports CodeActionKind = "source.organizeImports" - /*Manual defined: + SourceOrganizeImports CodeActionKind = "source.organizeImports" + TextCompletion CompletionItemKind = 1 + MethodCompletion CompletionItemKind = 2 + FunctionCompletion CompletionItemKind = 3 + ConstructorCompletion CompletionItemKind = 4 + FieldCompletion CompletionItemKind = 5 + VariableCompletion CompletionItemKind = 6 + ClassCompletion CompletionItemKind = 7 + InterfaceCompletion CompletionItemKind = 8 + ModuleCompletion CompletionItemKind = 9 + PropertyCompletion CompletionItemKind = 10 + UnitCompletion CompletionItemKind = 11 + ValueCompletion CompletionItemKind = 12 + EnumCompletion CompletionItemKind = 13 + KeywordCompletion CompletionItemKind = 14 + SnippetCompletion CompletionItemKind = 15 + ColorCompletion CompletionItemKind = 16 + FileCompletion CompletionItemKind = 17 + ReferenceCompletion CompletionItemKind = 18 + FolderCompletion CompletionItemKind = 19 + EnumMemberCompletion CompletionItemKind = 20 + ConstantCompletion CompletionItemKind = 21 + StructCompletion CompletionItemKind = 22 + EventCompletion CompletionItemKind = 23 + OperatorCompletion CompletionItemKind = 24 + TypeParameterCompletion CompletionItemKind = 25 + /** + * Render a completion as obsolete, usually using a strike-out. + */ + + ComplDeprecated CompletionItemTag = 1 + /** + * Completion was triggered by typing an identifier (24x7 code + * complete), manual invocation (e.g Ctrl+Space) or via API. + */ + + Invoked CompletionTriggerKind = 1 + /** + * Completion was triggered by a trigger character specified by + * the `triggerCharacters` properties of the `CompletionRegistrationOptions`. + */ + + TriggerCharacter CompletionTriggerKind = 2 + /** + * Completion was re-triggered as current completion list is incomplete + */ + + TriggerForIncompleteCompletions CompletionTriggerKind = 3 + /** + * Reports an error. + */ + + SeverityError DiagnosticSeverity = 1 + /** + * Reports a warning. + */ + + SeverityWarning DiagnosticSeverity = 2 + /** + * Reports an information. + */ + + SeverityInformation DiagnosticSeverity = 3 + /** + * Reports a hint. + */ + + SeverityHint DiagnosticSeverity = 4 + /** + * Unused or unnecessary code. + * + * Clients are allowed to render diagnostics with this tag faded out instead of having + * an error squiggle. + */ + + Unnecessary DiagnosticTag = 1 + /** + * Deprecated or obsolete code. + * + * Clients are allowed to rendered diagnostics with this tag strike through. + */ + + Deprecated DiagnosticTag = 2 + /** + * A textual occurrence. + */ + + Text DocumentHighlightKind = 1 + /** + * Read-access of a symbol, like reading a variable. + */ + + Read DocumentHighlightKind = 2 + /** + * Write-access of a symbol, like writing to a variable. + */ + + Write DocumentHighlightKind = 3 + /** + * 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" + /** + * All operations are executed transactional. That means they either all + * succeed or no changes at all are applied to the workspace. + */ + + Transactional FailureHandlingKind = "transactional" + /** + * 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" + /** + * The client tries to undo the operations already executed. But there is no + * guaruntee that this is succeeding. + */ + + Undo FailureHandlingKind = "undo" + /** + * The file got created. + */ + + Created FileChangeType = 1 + /** + * The file got changed. + */ + + Changed FileChangeType = 2 + /** + * The file got deleted. + */ + + Deleted FileChangeType = 3 + /** + * Folding range for a comment + */ + Comment FoldingRangeKind = "comment" + /** + * Folding range for a imports or includes + */ + Imports FoldingRangeKind = "imports" + /** + * Folding range for a region (e.g. `#region`) + */ + Region FoldingRangeKind = "region" + /** + * 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 + /** + * The primary text to be inserted is treated as a plain string. + */ + + PlainTextTextFormat InsertTextFormat = 1 + /** + * The primary text to be inserted is treated as a snippet. + * + * 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. + * + * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md + */ + + SnippetTextFormat InsertTextFormat = 2 + /** + * Plain text is supported as a content format + */ + + PlainText MarkupKind = "plaintext" + /** + * Markdown is supported as a content format + */ + + Markdown MarkupKind = "markdown" + /** + * An error message. + */ + + Error MessageType = 1 + /** + * A warning message. + */ + + Warning MessageType = 2 + /** + * An information message. + */ + + Info MessageType = 3 + /** + * A log message. + */ + + Log MessageType = 4 + /** + * Supports creating new files and folders. + */ + + Create ResourceOperationKind = "create" + /** + * Supports renaming existing files and folders. + */ + + Rename ResourceOperationKind = "rename" + /** + * Supports deleting existing files and folders. + */ + + Delete ResourceOperationKind = "delete" + /** + * Signature help was invoked manually by the user or by a command. + */ + + SigInvoked SignatureHelpTriggerKind = 1 + /** + * Signature help was triggered by a trigger character. + */ + + SigTriggerCharacter SignatureHelpTriggerKind = 2 + /** + * Signature help was triggered by the cursor moving or by the document content changing. + */ + + SigContentChange SignatureHelpTriggerKind = 3 + File SymbolKind = 1 + Module SymbolKind = 2 + Namespace SymbolKind = 3 + Package SymbolKind = 4 + Class SymbolKind = 5 + Method SymbolKind = 6 + Property SymbolKind = 7 + Field SymbolKind = 8 + Constructor SymbolKind = 9 + Enum SymbolKind = 10 + Interface SymbolKind = 11 + Function SymbolKind = 12 + Variable SymbolKind = 13 + Constant SymbolKind = 14 + String SymbolKind = 15 + Number SymbolKind = 16 + Boolean SymbolKind = 17 + Array SymbolKind = 18 + Object SymbolKind = 19 + Key SymbolKind = 20 + Null SymbolKind = 21 + EnumMember SymbolKind = 22 + Struct SymbolKind = 23 + Event SymbolKind = 24 + Operator SymbolKind = 25 + TypeParameter SymbolKind = 26 + /** * Manually triggered, e.g. by the user pressing save, by starting debugging, * or by an API call. */ - Manual TextDocumentSaveReason = 1 - /*AfterDelay defined: + Manual TextDocumentSaveReason = 1 + /** * Automatic after a delay. */ - AfterDelay TextDocumentSaveReason = 2 - /*FocusOut defined: + AfterDelay TextDocumentSaveReason = 2 + /** * When the editor lost focus. */ + FocusOut TextDocumentSaveReason = 3 - - // MessageWriteError is - MessageWriteError ErrorCodes = 1 - - // MessageReadError is - MessageReadError ErrorCodes = 2 - - // First is - First Touch = 1 - - // Last is - Last Touch = 2 - - // JSON is - JSON TraceFormat = "json" - - /*Closed defined: - * The connection is closed. + /** + * Documents should not be synced at all. */ - Closed ConnectionErrors = 1 - /*Disposed defined: - * The connection got disposed. + None TextDocumentSyncKind = 0 + /** + * Documents are synced by always sending the full content + * of the document. */ - Disposed ConnectionErrors = 2 - /*AlreadyListening defined: - * The connection is already in listening mode. + Full TextDocumentSyncKind = 1 + /** + * Documents are synced by sending the full content on open. + * After that only incremental updates to the document are + * send. */ - AlreadyListening ConnectionErrors = 3 - // New is - New ConnectionState = 1 + Incremental TextDocumentSyncKind = 2 + /** + * Interested in create events. + */ - // Listening is - Listening ConnectionState = 2 + WatchCreate WatchKind = 1 + /** + * Interested in change events + */ + + WatchChange WatchKind = 2 + /** + * Interested in delete events + */ + + WatchDelete WatchKind = 4 ) -// DocumentFilter is a type -/** - * A document filter denotes a document by different properties like - * the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of - * its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName). - * - * 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 - * - `**` to match any number of path segments, including none - * - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files) - * - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) - * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) - * - * @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }` - * @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }` - */ -type DocumentFilter = struct { - - /*Language defined: A language id, like `typescript`. */ - Language string `json:"language,omitempty"` - - /*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 string `json:"pattern,omitempty"` +// Types created to avoid struct in formal parameters and embedded structs +type ParamConfiguration struct { + ConfigurationParams + PartialResultParams } +type ParamInitialize struct { + InitializeParams + WorkDoneProgressParams +} +type WorkspaceGn struct { + WorkspaceFolders WorkspaceFoldersGn `json:"workspaceFolders,omitempty"` +} +type WorkspaceFoldersGn struct { + /** + * The Server has support for workspace folders + */ + Supported bool `json:"supported,omitempty"` -// DocumentSelector is a type -/** - * A document selector is the combination of one or many document filters. - * - * @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`; - */ -type DocumentSelector = []DocumentFilter - -// DocumentURI is a type -/** - * A tagging type for string properties that are actually URIs. - */ -type DocumentURI = string - -// MarkedString is a type -/** - * MarkedString can be used to render human readable text. It is either a markdown string - * or a code-block that provides a language and a code snippet. The language identifier - * is semantically equal to the optional language identifier in fenced code blocks in GitHub - * issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting - * - * The pair of a language and a value is an equivalent to markdown: - * ```${language} - * ${value} - * ``` - * - * Note that markdown strings will be sanitized - that means html will be escaped. - * @deprecated use MarkupContent instead. - */ -type MarkedString = string - -// DefinitionLink is a type -/** - * Information about where a symbol is defined. - * - * Provides additional metadata over normal [location](#Location) definitions, including the range of - * the defining symbol - */ -type DefinitionLink = LocationLink - -// DeclarationLink is a type -/** - * Information about where a symbol is declared. - * - * Provides additional metadata over normal [location](#Location) declarations, including the range of - * the declaring symbol. - * - * Servers should prefer returning `DeclarationLink` over `Declaration` if supported - * by the client. - */ -type DeclarationLink = LocationLink - -// LSPMessageType is a type -/** - * A LSP Log Entry. - */ -type LSPMessageType = string - -// ProgressToken is a type -type ProgressToken = interface{} // number | string -// TraceValues is a type -type TraceValues = string + /** + * 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/*string | boolean*/ `json:"changeNotifications,omitempty"` +} diff --git a/internal/lsp/protocol/tsserver.go b/internal/lsp/protocol/tsserver.go index 9ee423b5c7..f6593cbf64 100644 --- a/internal/lsp/protocol/tsserver.go +++ b/internal/lsp/protocol/tsserver.go @@ -1,5 +1,10 @@ package protocol +// Package protocol contains data types and code for LSP jsonrpcs +// generated automatically from vscode-languageserver-node +// commit: 635ab1fe6f8c57ce9402e573d007f24d6d290fd3 +// last fetched Sun Oct 13 2019 10:14:32 GMT-0400 (Eastern Daylight Time) + // Code generated (see typescript/README.md) DO NOT EDIT. import ( @@ -22,39 +27,40 @@ type Server interface { DidSave(context.Context, *DidSaveTextDocumentParams) error WillSave(context.Context, *WillSaveTextDocumentParams) error DidChangeWatchedFiles(context.Context, *DidChangeWatchedFilesParams) error + CancelRequest(context.Context, *CancelParams) error Progress(context.Context, *ProgressParams) error SetTraceNotification(context.Context, *SetTraceParams) error LogTraceNotification(context.Context, *LogTraceParams) error - Implementation(context.Context, *ImplementationParams) ([]Location, error) - TypeDefinition(context.Context, *TypeDefinitionParams) ([]Location, error) + Implementation(context.Context, *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error) + TypeDefinition(context.Context, *TypeDefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) DocumentColor(context.Context, *DocumentColorParams) ([]ColorInformation, error) ColorPresentation(context.Context, *ColorPresentationParams) ([]ColorPresentation, error) - FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange, error) - Declaration(context.Context, *DeclarationParams) ([]DeclarationLink, error) - SelectionRange(context.Context, *SelectionRangeParams) ([]SelectionRange, error) - Initialize(context.Context, *ParamInitia) (*InitializeResult, error) + FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange /*FoldingRange[] | null*/, error) + Declaration(context.Context, *DeclarationParams) (Declaration /*Declaration | DeclarationLink[] | null*/, error) + SelectionRange(context.Context, *SelectionRangeParams) ([]SelectionRange /*SelectionRange[] | null*/, error) + Initialize(context.Context, *ParamInitialize) (*InitializeResult, error) Shutdown(context.Context) error - WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit, error) - Completion(context.Context, *CompletionParams) (*CompletionList, error) + WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error) + Completion(context.Context, *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error) Resolve(context.Context, *CompletionItem) (*CompletionItem, error) - Hover(context.Context, *HoverParams) (*Hover, error) - SignatureHelp(context.Context, *SignatureHelpParams) (*SignatureHelp, error) - Definition(context.Context, *DefinitionParams) ([]Location, error) - References(context.Context, *ReferenceParams) ([]Location, error) - DocumentHighlight(context.Context, *DocumentHighlightParams) ([]DocumentHighlight, error) - DocumentSymbol(context.Context, *DocumentSymbolParams) ([]DocumentSymbol, error) - CodeAction(context.Context, *CodeActionParams) ([]CodeAction, error) - Symbol(context.Context, *WorkspaceSymbolParams) ([]SymbolInformation, error) - CodeLens(context.Context, *CodeLensParams) ([]CodeLens, error) + Hover(context.Context, *HoverParams) (*Hover /*Hover | null*/, error) + SignatureHelp(context.Context, *SignatureHelpParams) (*SignatureHelp /*SignatureHelp | null*/, error) + Definition(context.Context, *DefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) + References(context.Context, *ReferenceParams) ([]Location /*Location[] | null*/, error) + DocumentHighlight(context.Context, *DocumentHighlightParams) ([]DocumentHighlight /*DocumentHighlight[] | null*/, error) + DocumentSymbol(context.Context, *DocumentSymbolParams) ([]DocumentSymbol /*SymbolInformation[] | DocumentSymbol[] | null*/, error) + CodeAction(context.Context, *CodeActionParams) (interface{} /*Command | CodeAction*/ /*(Command | CodeAction)[] | null*/, error) + Symbol(context.Context, *WorkspaceSymbolParams) ([]SymbolInformation /*SymbolInformation[] | null*/, error) + CodeLens(context.Context, *CodeLensParams) ([]CodeLens /*CodeLens[] | null*/, error) ResolveCodeLens(context.Context, *CodeLens) (*CodeLens, error) - DocumentLink(context.Context, *DocumentLinkParams) ([]DocumentLink, error) + DocumentLink(context.Context, *DocumentLinkParams) ([]DocumentLink /*DocumentLink[] | null*/, error) ResolveDocumentLink(context.Context, *DocumentLink) (*DocumentLink, error) - Formatting(context.Context, *DocumentFormattingParams) ([]TextEdit, error) - RangeFormatting(context.Context, *DocumentRangeFormattingParams) ([]TextEdit, error) - OnTypeFormatting(context.Context, *DocumentOnTypeFormattingParams) ([]TextEdit, error) - Rename(context.Context, *RenameParams) (*WorkspaceEdit, error) - PrepareRename(context.Context, *PrepareRenameParams) (*Range, error) - ExecuteCommand(context.Context, *ExecuteCommandParams) (interface{}, error) + Formatting(context.Context, *DocumentFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) + RangeFormatting(context.Context, *DocumentRangeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) + OnTypeFormatting(context.Context, *DocumentOnTypeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) + Rename(context.Context, *RenameParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) + PrepareRename(context.Context, *PrepareRenameParams) (interface{} /* Range | struct{; Range Range`json:"range"`; Placeholder string`json:"placeholder"`; } | nil*/, error) + ExecuteCommand(context.Context, *ExecuteCommandParams) (interface{} /*any | null*/, error) } func (h serverHandler) Deliver(ctx context.Context, r *jsonrpc2.Request, delivered bool) bool { @@ -162,6 +168,16 @@ func (h serverHandler) Deliver(ctx context.Context, r *jsonrpc2.Request, deliver log.Error(ctx, "", err) } return true + case "$/cancelRequest": // notif + var params CancelParams + if err := json.Unmarshal(*r.Params, ¶ms); err != nil { + sendParseError(ctx, r, err) + return true + } + if err := h.server.CancelRequest(ctx, ¶ms); err != nil { + log.Error(ctx, "", err) + } + return true case "$/progress": // notif var params ProgressParams if err := json.Unmarshal(*r.Params, ¶ms); err != nil { @@ -270,7 +286,7 @@ func (h serverHandler) Deliver(ctx context.Context, r *jsonrpc2.Request, deliver } return true case "initialize": // req - var params ParamInitia + var params ParamInitialize if err := json.Unmarshal(*r.Params, ¶ms); err != nil { sendParseError(ctx, r, err) return true @@ -571,6 +587,10 @@ func (s *serverDispatcher) DidChangeWatchedFiles(ctx context.Context, params *Di return s.Conn.Notify(ctx, "workspace/didChangeWatchedFiles", params) } +func (s *serverDispatcher) CancelRequest(ctx context.Context, params *CancelParams) error { + return s.Conn.Notify(ctx, "$/cancelRequest", params) +} + func (s *serverDispatcher) Progress(ctx context.Context, params *ProgressParams) error { return s.Conn.Notify(ctx, "$/progress", params) } @@ -582,16 +602,16 @@ func (s *serverDispatcher) SetTraceNotification(ctx context.Context, params *Set func (s *serverDispatcher) LogTraceNotification(ctx context.Context, params *LogTraceParams) error { return s.Conn.Notify(ctx, "$/logTraceNotification", params) } -func (s *serverDispatcher) Implementation(ctx context.Context, params *ImplementationParams) ([]Location, error) { - var result []Location +func (s *serverDispatcher) Implementation(ctx context.Context, params *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error) { + var result Definition /*Definition | DefinitionLink[] | null*/ if err := s.Conn.Call(ctx, "textDocument/implementation", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) TypeDefinition(ctx context.Context, params *TypeDefinitionParams) ([]Location, error) { - var result []Location +func (s *serverDispatcher) TypeDefinition(ctx context.Context, params *TypeDefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) { + var result Definition /*Definition | DefinitionLink[] | null*/ if err := s.Conn.Call(ctx, "textDocument/typeDefinition", params, &result); err != nil { return nil, err } @@ -614,31 +634,31 @@ func (s *serverDispatcher) ColorPresentation(ctx context.Context, params *ColorP return result, nil } -func (s *serverDispatcher) FoldingRange(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange, error) { - var result []FoldingRange +func (s *serverDispatcher) FoldingRange(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange /*FoldingRange[] | null*/, error) { + var result []FoldingRange /*FoldingRange[] | null*/ if err := s.Conn.Call(ctx, "textDocument/foldingRange", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) Declaration(ctx context.Context, params *DeclarationParams) ([]DeclarationLink, error) { - var result []DeclarationLink +func (s *serverDispatcher) Declaration(ctx context.Context, params *DeclarationParams) (Declaration /*Declaration | DeclarationLink[] | null*/, error) { + var result Declaration /*Declaration | DeclarationLink[] | null*/ if err := s.Conn.Call(ctx, "textDocument/declaration", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) SelectionRange(ctx context.Context, params *SelectionRangeParams) ([]SelectionRange, error) { - var result []SelectionRange +func (s *serverDispatcher) SelectionRange(ctx context.Context, params *SelectionRangeParams) ([]SelectionRange /*SelectionRange[] | null*/, error) { + var result []SelectionRange /*SelectionRange[] | null*/ if err := s.Conn.Call(ctx, "textDocument/selectionRange", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) Initialize(ctx context.Context, params *ParamInitia) (*InitializeResult, error) { +func (s *serverDispatcher) Initialize(ctx context.Context, params *ParamInitialize) (*InitializeResult, error) { var result InitializeResult if err := s.Conn.Call(ctx, "initialize", params, &result); err != nil { return nil, err @@ -650,16 +670,16 @@ func (s *serverDispatcher) Shutdown(ctx context.Context) error { return s.Conn.Call(ctx, "shutdown", nil, nil) } -func (s *serverDispatcher) WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) ([]TextEdit, error) { - var result []TextEdit +func (s *serverDispatcher) WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error) { + var result []TextEdit /*TextEdit[] | null*/ if err := s.Conn.Call(ctx, "textDocument/willSaveWaitUntil", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) Completion(ctx context.Context, params *CompletionParams) (*CompletionList, error) { - var result CompletionList +func (s *serverDispatcher) Completion(ctx context.Context, params *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error) { + var result CompletionList /*CompletionItem[] | CompletionList | null*/ if err := s.Conn.Call(ctx, "textDocument/completion", params, &result); err != nil { return nil, err } @@ -674,72 +694,72 @@ func (s *serverDispatcher) Resolve(ctx context.Context, params *CompletionItem) return &result, nil } -func (s *serverDispatcher) Hover(ctx context.Context, params *HoverParams) (*Hover, error) { - var result Hover +func (s *serverDispatcher) Hover(ctx context.Context, params *HoverParams) (*Hover /*Hover | null*/, error) { + var result Hover /*Hover | null*/ if err := s.Conn.Call(ctx, "textDocument/hover", params, &result); err != nil { return nil, err } return &result, nil } -func (s *serverDispatcher) SignatureHelp(ctx context.Context, params *SignatureHelpParams) (*SignatureHelp, error) { - var result SignatureHelp +func (s *serverDispatcher) SignatureHelp(ctx context.Context, params *SignatureHelpParams) (*SignatureHelp /*SignatureHelp | null*/, error) { + var result SignatureHelp /*SignatureHelp | null*/ if err := s.Conn.Call(ctx, "textDocument/signatureHelp", params, &result); err != nil { return nil, err } return &result, nil } -func (s *serverDispatcher) Definition(ctx context.Context, params *DefinitionParams) ([]Location, error) { - var result []Location +func (s *serverDispatcher) Definition(ctx context.Context, params *DefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) { + var result Definition /*Definition | DefinitionLink[] | null*/ if err := s.Conn.Call(ctx, "textDocument/definition", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) References(ctx context.Context, params *ReferenceParams) ([]Location, error) { - var result []Location +func (s *serverDispatcher) References(ctx context.Context, params *ReferenceParams) ([]Location /*Location[] | null*/, error) { + var result []Location /*Location[] | null*/ if err := s.Conn.Call(ctx, "textDocument/references", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) DocumentHighlight(ctx context.Context, params *DocumentHighlightParams) ([]DocumentHighlight, error) { - var result []DocumentHighlight +func (s *serverDispatcher) DocumentHighlight(ctx context.Context, params *DocumentHighlightParams) ([]DocumentHighlight /*DocumentHighlight[] | null*/, error) { + var result []DocumentHighlight /*DocumentHighlight[] | null*/ if err := s.Conn.Call(ctx, "textDocument/documentHighlight", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) DocumentSymbol(ctx context.Context, params *DocumentSymbolParams) ([]DocumentSymbol, error) { - var result []DocumentSymbol +func (s *serverDispatcher) DocumentSymbol(ctx context.Context, params *DocumentSymbolParams) ([]DocumentSymbol /*SymbolInformation[] | DocumentSymbol[] | null*/, error) { + var result []DocumentSymbol /*SymbolInformation[] | DocumentSymbol[] | null*/ if err := s.Conn.Call(ctx, "textDocument/documentSymbol", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) CodeAction(ctx context.Context, params *CodeActionParams) ([]CodeAction, error) { - var result []CodeAction +func (s *serverDispatcher) CodeAction(ctx context.Context, params *CodeActionParams) (interface{} /*Command | CodeAction*/ /*(Command | CodeAction)[] | null*/, error) { + var result interface{} /*Command | CodeAction*/ /*(Command | CodeAction)[] | null*/ if err := s.Conn.Call(ctx, "textDocument/codeAction", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) Symbol(ctx context.Context, params *WorkspaceSymbolParams) ([]SymbolInformation, error) { - var result []SymbolInformation +func (s *serverDispatcher) Symbol(ctx context.Context, params *WorkspaceSymbolParams) ([]SymbolInformation /*SymbolInformation[] | null*/, error) { + var result []SymbolInformation /*SymbolInformation[] | null*/ if err := s.Conn.Call(ctx, "workspace/symbol", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) CodeLens(ctx context.Context, params *CodeLensParams) ([]CodeLens, error) { - var result []CodeLens +func (s *serverDispatcher) CodeLens(ctx context.Context, params *CodeLensParams) ([]CodeLens /*CodeLens[] | null*/, error) { + var result []CodeLens /*CodeLens[] | null*/ if err := s.Conn.Call(ctx, "textDocument/codeLens", params, &result); err != nil { return nil, err } @@ -754,8 +774,8 @@ func (s *serverDispatcher) ResolveCodeLens(ctx context.Context, params *CodeLens return &result, nil } -func (s *serverDispatcher) DocumentLink(ctx context.Context, params *DocumentLinkParams) ([]DocumentLink, error) { - var result []DocumentLink +func (s *serverDispatcher) DocumentLink(ctx context.Context, params *DocumentLinkParams) ([]DocumentLink /*DocumentLink[] | null*/, error) { + var result []DocumentLink /*DocumentLink[] | null*/ if err := s.Conn.Call(ctx, "textDocument/documentLink", params, &result); err != nil { return nil, err } @@ -770,63 +790,50 @@ func (s *serverDispatcher) ResolveDocumentLink(ctx context.Context, params *Docu return &result, nil } -func (s *serverDispatcher) Formatting(ctx context.Context, params *DocumentFormattingParams) ([]TextEdit, error) { - var result []TextEdit +func (s *serverDispatcher) Formatting(ctx context.Context, params *DocumentFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) { + var result []TextEdit /*TextEdit[] | null*/ if err := s.Conn.Call(ctx, "textDocument/formatting", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) RangeFormatting(ctx context.Context, params *DocumentRangeFormattingParams) ([]TextEdit, error) { - var result []TextEdit +func (s *serverDispatcher) RangeFormatting(ctx context.Context, params *DocumentRangeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) { + var result []TextEdit /*TextEdit[] | null*/ if err := s.Conn.Call(ctx, "textDocument/rangeFormatting", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) ([]TextEdit, error) { - var result []TextEdit +func (s *serverDispatcher) OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) { + var result []TextEdit /*TextEdit[] | null*/ if err := s.Conn.Call(ctx, "textDocument/onTypeFormatting", params, &result); err != nil { return nil, err } return result, nil } -func (s *serverDispatcher) Rename(ctx context.Context, params *RenameParams) (*WorkspaceEdit, error) { - var result WorkspaceEdit +func (s *serverDispatcher) Rename(ctx context.Context, params *RenameParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) { + var result WorkspaceEdit /*WorkspaceEdit | null*/ if err := s.Conn.Call(ctx, "textDocument/rename", params, &result); err != nil { return nil, err } return &result, nil } -func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (*Range, error) { - var result Range +func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (interface{} /* Range | struct{; Range Range`json:"range"`; Placeholder string`json:"placeholder"`; } | nil*/, error) { + var result interface{} /* Range | struct{; Range Range`json:"range"`; Placeholder string`json:"placeholder"`; } | nil*/ if err := s.Conn.Call(ctx, "textDocument/prepareRename", params, &result); err != nil { return nil, err } - return &result, nil -} - -func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (interface{}, error) { - var result interface{} - if err := s.Conn.Call(ctx, "workspace/executeCommand", params, &result); err != nil { - return nil, err - } return result, nil } -type CancelParams struct { - /** - * The request id to cancel. - */ - ID jsonrpc2.ID `json:"id"` -} - -// Types constructed to avoid structs as formal argument types -type ParamInitia struct { - InitializeParams - WorkDoneProgressParams +func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (interface{} /*any | null*/, error) { + var result interface{} /*any | null*/ + if err := s.Conn.Call(ctx, "workspace/executeCommand", params, &result); err != nil { + return nil, err + } + return result, nil } diff --git a/internal/lsp/server.go b/internal/lsp/server.go index bc053a5661..843db24f70 100644 --- a/internal/lsp/server.go +++ b/internal/lsp/server.go @@ -91,7 +91,7 @@ type Server struct { // General -func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitia) (*protocol.InitializeResult, error) { +func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) { return s.initialize(ctx, params) } @@ -107,6 +107,10 @@ func (s *Server) Exit(ctx context.Context) error { return s.exit(ctx) } +func (s *Server) CancelRequest(ctx context.Context, params *protocol.CancelParams) error { + return s.CancelRequest(ctx, params) +} + // Workspace func (s *Server) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) error { @@ -173,15 +177,15 @@ func (s *Server) SignatureHelp(ctx context.Context, params *protocol.SignatureHe return s.signatureHelp(ctx, params) } -func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) ([]protocol.Location, error) { +func (s *Server) Definition(ctx context.Context, params *protocol.DefinitionParams) (protocol.Definition, error) { return s.definition(ctx, params) } -func (s *Server) TypeDefinition(ctx context.Context, params *protocol.TypeDefinitionParams) ([]protocol.Location, error) { +func (s *Server) TypeDefinition(ctx context.Context, params *protocol.TypeDefinitionParams) (protocol.Definition, error) { return s.typeDefinition(ctx, params) } -func (s *Server) Implementation(ctx context.Context, params *protocol.ImplementationParams) ([]protocol.Location, error) { +func (s *Server) Implementation(ctx context.Context, params *protocol.ImplementationParams) (protocol.Definition, error) { return s.implementation(ctx, params) } @@ -197,7 +201,7 @@ func (s *Server) DocumentSymbol(ctx context.Context, params *protocol.DocumentSy return s.documentSymbol(ctx, params) } -func (s *Server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error) { +func (s *Server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) (interface{}, error) { return s.codeAction(ctx, params) } @@ -241,7 +245,7 @@ func (s *Server) Rename(ctx context.Context, params *protocol.RenameParams) (*pr return s.rename(ctx, params) } -func (s *Server) Declaration(context.Context, *protocol.DeclarationParams) ([]protocol.DeclarationLink, error) { +func (s *Server) Declaration(context.Context, *protocol.DeclarationParams) (protocol.Declaration, error) { return nil, notImplemented("Declaration") } @@ -253,7 +257,7 @@ func (s *Server) LogTraceNotification(context.Context, *protocol.LogTraceParams) return notImplemented("LogtraceNotification") } -func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.Range, error) { +func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (interface{}, error) { // TODO(suzmue): support sending placeholder text. return s.prepareRename(ctx, params) } diff --git a/internal/lsp/source/options.go b/internal/lsp/source/options.go index c45d034b79..fe39ad61a9 100644 --- a/internal/lsp/source/options.go +++ b/internal/lsp/source/options.go @@ -183,7 +183,7 @@ func SetOptions(options *Options, opts interface{}) OptionResults { func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) { // Check if the client supports snippets in completion items. - if c := caps.TextDocument.Completion; c != nil && c.CompletionItem != nil && c.CompletionItem.SnippetSupport { + if c := caps.TextDocument.Completion; c.CompletionItem.SnippetSupport { o.InsertTextFormat = protocol.SnippetTextFormat } // Check if the client supports configuration messages. @@ -192,13 +192,12 @@ func (o *Options) ForClientCapabilities(caps protocol.ClientCapabilities) { o.DynamicWatchedFilesSupported = caps.Workspace.DidChangeWatchedFiles.DynamicRegistration // Check which types of content format are supported by this client. - if hover := caps.TextDocument.Hover; hover != nil && len(hover.ContentFormat) > 0 { + if hover := caps.TextDocument.Hover; len(hover.ContentFormat) > 0 { o.PreferredContentFormat = hover.ContentFormat[0] } // Check if the client supports only line folding. - if fr := caps.TextDocument.FoldingRange; fr != nil { - o.LineFoldingOnly = fr.LineFoldingOnly - } + fr := caps.TextDocument.FoldingRange + o.LineFoldingOnly = fr.LineFoldingOnly } func (o *Options) set(name string, value interface{}) OptionResult { diff --git a/internal/lsp/tests/completion.go b/internal/lsp/tests/completion.go index ba5ec70f24..316e20cd51 100644 --- a/internal/lsp/tests/completion.go +++ b/internal/lsp/tests/completion.go @@ -26,7 +26,7 @@ func ToProtocolCompletionItem(item source.CompletionItem) protocol.CompletionIte Detail: item.Detail, Documentation: item.Documentation, InsertText: item.InsertText, - TextEdit: &protocol.TextEdit{ + TextEdit: protocol.TextEdit{ NewText: item.Snippet(), }, // Negate score so best score has lowest sort text like real API. diff --git a/internal/lsp/text_synchronization.go b/internal/lsp/text_synchronization.go index 680d46bc11..b3b085900f 100644 --- a/internal/lsp/text_synchronization.go +++ b/internal/lsp/text_synchronization.go @@ -96,7 +96,7 @@ func fullChange(changes []protocol.TextDocumentContentChangeEvent) (string, bool return "", false } // The length of the changes must be 1 at this point. - if changes[0].Range == nil && changes[0].RangeLength == 0 { + if changes[0].RangeLength == 0 { // used to check changes[0].Range == nil return changes[0].Text, true } return "", false @@ -116,7 +116,7 @@ func (s *Server) applyChanges(ctx context.Context, uri span.URI, changes []proto Content: content, } - spn, err := m.RangeSpan(*change.Range) + spn, err := m.RangeSpan(change.Range) if err != nil { return "", err }