Suzy Mueller has uploaded this change for review.
internal/lsp: update LSP protocol for 3.17
Update the protocol for the finalized 3.17 release. Changes include
renaming the inlay hint parameter viewport to range.
Change-Id: If22526c656bdac876c6ab4bbad72e690a4175976
---
M internal/lsp/cmd/capabilities_test.go
M internal/lsp/cmd/cmd.go
M internal/lsp/fake/editor.go
M internal/lsp/folding_range.go
M internal/lsp/general.go
M internal/lsp/helper/helper.go
M internal/lsp/inlay_hint.go
M internal/lsp/lsp_test.go
M internal/lsp/lsprpc/goenv.go
M internal/lsp/lsprpc/goenv_test.go
M internal/lsp/lsprpc/lsprpc.go
M internal/lsp/lsprpc/lsprpc_test.go
M internal/lsp/protocol/enums.go
M internal/lsp/protocol/tsclient.go
M internal/lsp/protocol/tsprotocol.go
M internal/lsp/protocol/tsserver.go
M internal/lsp/protocol/typescript/code.ts
M internal/lsp/protocol/typescript/util.ts
M internal/lsp/rename.go
M internal/lsp/server.go
M internal/lsp/server_gen.go
M internal/lsp/source/workspace_symbol.go
M internal/lsp/symbols.go
M internal/lsp/tests/tests.go
24 files changed, 1,128 insertions(+), 855 deletions(-)
diff --git a/internal/lsp/cmd/capabilities_test.go b/internal/lsp/cmd/capabilities_test.go
index 1d01b4b..c306f05 100644
--- a/internal/lsp/cmd/capabilities_test.go
+++ b/internal/lsp/cmd/capabilities_test.go
@@ -38,7 +38,7 @@
ctx := context.Background()
defer c.terminate(ctx)
- params := &protocol.ParamInitialize{}
+ params := &protocol.InitializeParams{}
params.RootURI = protocol.URIFromPath(c.Client.app.wd)
params.Capabilities.Workspace.Configuration = true
diff --git a/internal/lsp/cmd/cmd.go b/internal/lsp/cmd/cmd.go
index a81eb83..e4da08b 100644
--- a/internal/lsp/cmd/cmd.go
+++ b/internal/lsp/cmd/cmd.go
@@ -346,7 +346,7 @@
}
func (c *connection) initialize(ctx context.Context, options func(*source.Options)) error {
- params := &protocol.ParamInitialize{}
+ params := &protocol.InitializeParams{}
params.RootURI = protocol.URIFromPath(c.Client.app.wd)
params.Capabilities.Workspace.Configuration = true
diff --git a/internal/lsp/fake/editor.go b/internal/lsp/fake/editor.go
index 06b90bb..33a32f7 100644
--- a/internal/lsp/fake/editor.go
+++ b/internal/lsp/fake/editor.go
@@ -275,7 +275,7 @@
}
func (e *Editor) initialize(ctx context.Context, workspaceFolders []string) error {
- params := &protocol.ParamInitialize{}
+ params := &protocol.InitializeParams{}
params.ClientInfo.Name = "fakeclient"
params.ClientInfo.Version = "v1.0.0"
diff --git a/internal/lsp/folding_range.go b/internal/lsp/folding_range.go
index 75f48a4..072d201 100644
--- a/internal/lsp/folding_range.go
+++ b/internal/lsp/folding_range.go
@@ -37,7 +37,7 @@
StartCharacter: rng.Start.Character,
EndLine: rng.End.Line,
EndCharacter: rng.End.Character,
- Kind: string(info.Kind),
+ Kind: info.Kind,
})
}
return result, nil
diff --git a/internal/lsp/general.go b/internal/lsp/general.go
index 385a04a..b07cf85 100644
--- a/internal/lsp/general.go
+++ b/internal/lsp/general.go
@@ -24,7 +24,7 @@
"golang.org/x/tools/internal/span"
)
-func (s *Server) initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
+func (s *Server) initialize(ctx context.Context, params *protocol.InitializeParams) (*protocol.InitializeResult, error) {
s.stateMu.Lock()
if s.state >= serverInitializing {
defer s.stateMu.Unlock()
@@ -166,8 +166,8 @@
IncludeText: false,
},
},
- Workspace: protocol.Workspace6Gn{
- WorkspaceFolders: protocol.WorkspaceFolders5Gn{
+ Workspace: protocol.Workspace2Gn{
+ WorkspaceFolders: &protocol.WorkspaceFoldersServerCapabilities{
Supported: true,
ChangeNotifications: "workspace/didChangeWorkspaceFolders",
},
@@ -371,7 +371,7 @@
for pattern := range patterns {
watchers = append(watchers, protocol.FileSystemWatcher{
GlobPattern: pattern,
- Kind: uint32(protocol.WatchChange + protocol.WatchDelete + protocol.WatchCreate),
+ Kind: protocol.WatchChange + protocol.WatchDelete + protocol.WatchCreate,
})
}
diff --git a/internal/lsp/helper/helper.go b/internal/lsp/helper/helper.go
index cadda02..8195c65 100644
--- a/internal/lsp/helper/helper.go
+++ b/internal/lsp/helper/helper.go
@@ -78,8 +78,11 @@
if i > 0 {
cm = ", "
}
- t.Param += fmt.Sprintf("%s%s %s", cm, t.paramnames[i], p)
- this := t.paramnames[i]
+ this := "_"
+ if i < len(t.paramnames) {
+ this = t.paramnames[i]
+ }
+ t.Param += fmt.Sprintf("%s%s %s", cm, this, p)
if this == "_" {
this = "nil"
}
@@ -123,6 +126,7 @@
}
ans, err := format.Source(bytes.Replace(buf.Bytes(), []byte("\\\n"), []byte{}, -1))
if err != nil {
+ log.Print(string(bytes.Replace(buf.Bytes(), []byte("\\\n"), []byte{}, -1)))
log.Fatal(err)
}
fd.Write(ans)
diff --git a/internal/lsp/inlay_hint.go b/internal/lsp/inlay_hint.go
index b2fd028..8d8a419 100644
--- a/internal/lsp/inlay_hint.go
+++ b/internal/lsp/inlay_hint.go
@@ -17,5 +17,5 @@
if !ok {
return nil, err
}
- return source.InlayHint(ctx, snapshot, fh, params.ViewPort)
+ return source.InlayHint(ctx, snapshot, fh, params.Range)
}
diff --git a/internal/lsp/lsp_test.go b/internal/lsp/lsp_test.go
index 2ec833b..0f90a4a 100644
--- a/internal/lsp/lsp_test.go
+++ b/internal/lsp/lsp_test.go
@@ -301,7 +301,7 @@
for _, kind := range kinds {
var kindOnly []protocol.FoldingRange
for _, fRng := range ranges {
- if fRng.Kind == string(kind) {
+ if fRng.Kind == kind {
kindOnly = append(kindOnly, fRng)
}
}
diff --git a/internal/lsp/lsprpc/goenv.go b/internal/lsp/lsprpc/goenv.go
index f313724..99f1cb1 100644
--- a/internal/lsp/lsprpc/goenv.go
+++ b/internal/lsp/lsprpc/goenv.go
@@ -30,7 +30,7 @@
}
func addGoEnvToInitializeRequestV2(ctx context.Context, req *jsonrpc2_v2.Request) error {
- var params protocol.ParamInitialize
+ var params protocol.InitializeParams
if err := json.Unmarshal(req.Params, ¶ms); err != nil {
return err
}
diff --git a/internal/lsp/lsprpc/goenv_test.go b/internal/lsp/lsprpc/goenv_test.go
index cdfe23c..35aa07a 100644
--- a/internal/lsp/lsprpc/goenv_test.go
+++ b/internal/lsp/lsprpc/goenv_test.go
@@ -17,10 +17,10 @@
type initServer struct {
protocol.Server
- params *protocol.ParamInitialize
+ params *protocol.InitializeParams
}
-func (s *initServer) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
+func (s *initServer) Initialize(ctx context.Context, params *protocol.InitializeParams) (*protocol.InitializeResult, error) {
s.params = params
return &protocol.InitializeResult{}, nil
}
@@ -42,7 +42,7 @@
l, _ = env.serve(ctx, t, binder)
conn := env.dial(ctx, t, l.Dialer(), noopBinder, true)
dispatch := protocol.ServerDispatcherV2(conn)
- initParams := &protocol.ParamInitialize{}
+ initParams := &protocol.InitializeParams{}
initParams.InitializationOptions = map[string]interface{}{
"env": map[string]interface{}{
"GONOPROXY": "example.com",
diff --git a/internal/lsp/lsprpc/lsprpc.go b/internal/lsp/lsprpc/lsprpc.go
index a85e791..a9b9f4f 100644
--- a/internal/lsp/lsprpc/lsprpc.go
+++ b/internal/lsp/lsprpc/lsprpc.go
@@ -321,7 +321,7 @@
// It returns an error if r is not an initialize request, or is otherwise
// malformed.
func addGoEnvToInitializeRequest(ctx context.Context, r jsonrpc2.Request) (jsonrpc2.Request, error) {
- var params protocol.ParamInitialize
+ var params protocol.InitializeParams
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
return nil, err
}
diff --git a/internal/lsp/lsprpc/lsprpc_test.go b/internal/lsp/lsprpc/lsprpc_test.go
index cde641c..0a48bb9 100644
--- a/internal/lsp/lsprpc/lsprpc_test.go
+++ b/internal/lsp/lsprpc/lsprpc_test.go
@@ -282,10 +282,10 @@
type initServer struct {
fakeServer
- params *protocol.ParamInitialize
+ params *protocol.InitializeParams
}
-func (s *initServer) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
+func (s *initServer) Initialize(ctx context.Context, params *protocol.InitializeParams) (*protocol.InitializeResult, error) {
s.params = params
return &protocol.InitializeResult{}, nil
}
@@ -301,7 +301,7 @@
conn := tsForwarded.Connect(ctx)
conn.Go(ctx, jsonrpc2.MethodNotFound)
dispatch := protocol.ServerDispatcher(conn)
- initParams := &protocol.ParamInitialize{}
+ initParams := &protocol.InitializeParams{}
initParams.InitializationOptions = map[string]interface{}{
"env": map[string]interface{}{
"GONOPROXY": "example.com",
diff --git a/internal/lsp/protocol/enums.go b/internal/lsp/protocol/enums.go
index 434808e..b6c8970 100644
--- a/internal/lsp/protocol/enums.go
+++ b/internal/lsp/protocol/enums.go
@@ -149,12 +149,12 @@
return TextDocumentSyncKind(parseEnum(s, namesTextDocumentSyncKind[:]))
}
-func (e InitializeError) Format(f fmt.State, c rune) {
- formatEnum(f, c, int(e), namesInitializeError[:], "InitializeError")
+func (e InitializeErrorCodes) Format(f fmt.State, c rune) {
+ formatEnum(f, c, int(e), namesInitializeError[:], "InitializeErrorCodes")
}
-func ParseInitializeError(s string) InitializeError {
- return InitializeError(parseEnum(s, namesInitializeError[:]))
+func ParseInitializeError(s string) InitializeErrorCodes {
+ return InitializeErrorCodes(parseEnum(s, namesInitializeError[:]))
}
func (e MessageType) Format(f fmt.State, c rune) {
diff --git a/internal/lsp/protocol/tsclient.go b/internal/lsp/protocol/tsclient.go
index 971a2df..daeb3ec 100644
--- a/internal/lsp/protocol/tsclient.go
+++ b/internal/lsp/protocol/tsclient.go
@@ -8,8 +8,8 @@
// Package protocol contains data types and code for LSP json rpcs
// generated automatically from vscode-languageserver-node
-// commit: 696f9285bf849b73745682fdb1c1feac73eb8772
-// last fetched Fri Apr 01 2022 10:53:41 GMT-0400 (Eastern Daylight Time)
+// commit: 2b4ae186b2aeb9cc4d2cf20efb6f27bb50467e59
+// last fetched Wed Jun 22 2022 13:57:16 GMT-0400 (Eastern Daylight Time)
import (
"context"
@@ -22,7 +22,7 @@
type Client interface {
ShowMessage(context.Context, *ShowMessageParams) error
LogMessage(context.Context, *LogMessageParams) error
- Event(context.Context, *interface{}) error
+ Event(context.Context, *LSPAny) error
PublishDiagnostics(context.Context, *PublishDiagnosticsParams) error
Progress(context.Context, *ProgressParams) error
WorkspaceFolders(context.Context) ([]WorkspaceFolder /*WorkspaceFolder[] | null*/, error)
@@ -52,7 +52,7 @@
err := client.LogMessage(ctx, ¶ms)
return true, reply(ctx, nil, err)
case "telemetry/event": // notif
- var params interface{}
+ var params LSPAny
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
return true, sendParseError(ctx, reply, err)
}
@@ -156,7 +156,7 @@
return s.sender.Notify(ctx, "window/logMessage", params)
}
-func (s *clientDispatcher) Event(ctx context.Context, params *interface{}) error {
+func (s *clientDispatcher) Event(ctx context.Context, params *LSPAny) error {
return s.sender.Notify(ctx, "telemetry/event", params)
}
diff --git a/internal/lsp/protocol/tsprotocol.go b/internal/lsp/protocol/tsprotocol.go
index 647aabc..f277628 100644
--- a/internal/lsp/protocol/tsprotocol.go
+++ b/internal/lsp/protocol/tsprotocol.go
@@ -6,8 +6,8 @@
// Package protocol contains data types and code for LSP json rpcs
// generated automatically from vscode-languageserver-node
-// commit: 696f9285bf849b73745682fdb1c1feac73eb8772
-// last fetched Fri Apr 01 2022 10:53:41 GMT-0400 (Eastern Daylight Time)
+// commit: 2b4ae186b2aeb9cc4d2cf20efb6f27bb50467e59
+// last fetched Wed Jun 22 2022 13:57:16 GMT-0400 (Eastern Daylight Time)
package protocol
import "encoding/json"
@@ -66,6 +66,33 @@
}
/**
+ * A base for all symbol information.
+ */
+type BaseSymbolInformation struct {
+ /**
+ * The name of this symbol.
+ */
+ Name string `json:"name"`
+ /**
+ * The kind of this symbol.
+ */
+ Kind SymbolKind `json:"kind"`
+ /**
+ * Tags for this symbol.
+ *
+ * @since 3.16.0
+ */
+ Tags []SymbolTag `json:"tags,omitempty"`
+ /**
+ * 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
+ * symbols.
+ */
+ ContainerName string `json:"containerName,omitempty"`
+}
+
+/**
* @since 3.16.0
*/
type CallHierarchyClientCapabilities struct {
@@ -221,14 +248,14 @@
*/
type ChangeAnnotation struct {
/**
- * A human-readable string describing the actual change. The string
- * is rendered prominent in the user interface.
- */
+ * A human-readable string describing the actual change. The string
+ * is rendered prominent in the user interface.
+ */
Label string `json:"label"`
/**
- * A flag which indicates that user confirmation is needed
- * before applying the change.
- */
+ * A flag which indicates that user confirmation is needed
+ * before applying the change.
+ */
NeedsConfirmation bool `json:"needsConfirmation,omitempty"`
/**
* A human-readable string which is rendered less prominent in
@@ -242,39 +269,28 @@
*/
type ChangeAnnotationIdentifier = string
+/**
+ * Defines the capabilities provided by the client.
+ */
type ClientCapabilities struct {
/**
- * The workspace client capabilities
+ * Workspace specific client capabilities.
*/
- Workspace Workspace3Gn `json:"workspace,omitempty"`
+ Workspace WorkspaceClientCapabilities `json:"workspace,omitempty"`
/**
* Text document specific client capabilities.
*/
TextDocument TextDocumentClientCapabilities `json:"textDocument,omitempty"`
/**
+ * Capabilities specific to the notebook document support.
+ *
+ * @since 3.17.0
+ */
+ NotebookDocument NotebookDocumentClientCapabilities `json:"notebookDocument,omitempty"`
+ /**
* Window specific client capabilities.
*/
- Window struct {
- /**
- * Whether client supports server initiated progress using the
- * `window/workDoneProgress/create` request.
- *
- * Since 3.15.0
- */
- WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
- /**
- * Capabilities specific to the showMessage request.
- *
- * @since 3.16.0
- */
- ShowMessage ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
- /**
- * Capabilities specific to the showDocument request.
- *
- * @since 3.16.0
- */
- ShowDocument ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
- } `json:"window,omitempty"`
+ Window WindowClientCapabilities `json:"window,omitempty"`
/**
* General client capabilities.
*
@@ -323,14 +339,14 @@
*
* Clients should follow the following guidelines regarding disabled code actions:
*
- * - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)
- * code action menu.
+ * - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)
+ * code action menus.
*
- * - Disabled actions are shown as faded out in the code action menu when the user request a more specific type
+ * - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type
* of code action, such as refactorings.
*
* - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)
- * that auto applies a code action and only a disabled code actions are returned, the client should show the user an
+ * that auto applies a code action and only disabled code actions are returned, the client should show the user an
* error message with `reason` in the editor.
*
* @since 3.16.0
@@ -349,7 +365,7 @@
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
+ * provides an edit and a command, first the edit is
* executed and then the command.
*/
Command *Command `json:"command,omitempty"`
@@ -413,7 +429,7 @@
*/
DataSupport bool `json:"dataSupport,omitempty"`
/**
- * Whether the client support resolving additional code action
+ * Whether the client supports resolving additional code action
* properties via a separate `codeAction/resolve` request.
*
* @since 3.16.0
@@ -425,7 +441,7 @@
Properties []string `json:"properties"`
} `json:"resolveSupport,omitempty"`
/**
- * Whether th client honors the change annotations in
+ * Whether the client honors the change annotations in
* text edits and resource operations returned via the
* `CodeAction#edit` property by for example presenting
* the workspace edit in the user interface and asking
@@ -513,7 +529,7 @@
/**
* The reason why code actions were requested.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type CodeActionTriggerKind float64
@@ -534,7 +550,7 @@
* source text, like the number of references, a way to run tests, etc.
*
* A code lens is _unresolved_ when no command is associated to it. For performance
- * reasons the creation of a code lens and resolving should be done to two stages.
+ * reasons the creation of a code lens and resolving should be done in two stages.
*/
type CodeLens struct {
/**
@@ -727,7 +743,7 @@
*/
CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"`
/**
- * Client supports the follow content formats for the documentation
+ * Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
*/
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
@@ -787,7 +803,7 @@
* The client has support for completion item label
* details (see also `CompletionItemLabelDetails`).
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
} `json:"completionItem,omitempty"`
@@ -809,7 +825,7 @@
* when accepting a completion item that uses multi line
* text in either `insertText` or `textEdit`.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`
/**
@@ -821,18 +837,18 @@
* The client supports the following `CompletionList` specific
* capabilities.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
CompletionList struct {
/**
- * The client supports the the following itemDefaults on
+ * The client supports the following itemDefaults on
* a completion list.
*
* The value lists the supported property names of the
* `CompletionList.itemDefaults` object. If omitted
* no properties are supported.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
ItemDefaults []string `json:"itemDefaults,omitempty"`
} `json:"completionList,omitempty"`
@@ -871,7 +887,7 @@
/**
* Additional details for the label
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
LabelDetails CompletionItemLabelDetails `json:"labelDetails,omitempty"`
/**
@@ -926,23 +942,25 @@
*
* The `insertText` is subject to interpretation by the client side.
* Some tools might not take the string literally. For example
- * VS Code when code complete is requested in this example `con<cursor position>`
- * and a completion item with an `insertText` of `console` is provided it
- * will only insert `sole`. Therefore it is recommended to use `textEdit` instead
- * since it avoids additional client side interpretation.
+ * VS Code when code complete is requested in this example
+ * `con<cursor position>` and a completion item with an `insertText` of
+ * `console` is provided it will only insert `sole`. Therefore it is
+ * recommended to use `textEdit` instead since it avoids additional client
+ * side interpretation.
*/
InsertText string `json:"insertText,omitempty"`
/**
- * The format of the insert text. The format applies to both the `insertText` property
- * and the `newText` property of a provided `textEdit`. If omitted defaults to
- * `InsertTextFormat.PlainText`.
+ * The format of the insert text. The format applies to both the
+ * `insertText` property and the `newText` property of a provided
+ * `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
*
- * Please note that the insertTextFormat doesn't apply to `additionalTextEdits`.
+ * Please note that the insertTextFormat doesn't apply to
+ * `additionalTextEdits`.
*/
InsertTextFormat InsertTextFormat `json:"insertTextFormat,omitempty"`
/**
* How whitespace and indentation is handled during completion
- * item insertion. If ignored the clients default value depends on
+ * item insertion. If not provided the clients default value depends on
* the `textDocument.completion.insertTextMode` client capability.
*
* @since 3.16.0
@@ -953,21 +971,38 @@
* this completion. When an edit is provided the value of
* [insertText](#CompletionItem.insertText) is ignored.
*
- * Most editors support two different operation when accepting a completion item. One is to insert a
- * completion text and the other is to replace an existing text with a completion text. Since this can
- * usually not predetermined by a server it can report both ranges. Clients need to signal support for
- * `InsertReplaceEdits` via the `textDocument.completion.insertReplaceSupport` client capability
+ * Most editors support two different operations when accepting a completion
+ * item. One is to insert a completion text and the other is to replace an
+ * existing text with a completion text. Since this can usually not be
+ * predetermined by a server it can report both ranges. Clients need to
+ * signal support for `InsertReplaceEdits` via the
+ * `textDocument.completion.insertReplaceSupport` client capability
* property.
*
- * *Note 1:* The text edit's range as well as both ranges from a insert replace edit must be a
- * [single line] and they must contain the position at which completion has been requested.
- * *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range must be a prefix of
- * the edit's replace range, that means it must be contained and starting at the same position.
+ * *Note 1:* The text edit's range as well as both ranges from an insert
+ * replace edit must be a [single line] and they must contain the position
+ * at which completion has been requested.
+ * *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
+ * must be a prefix of the edit's replace range, that means it must be
+ * contained and starting at the same position.
*
* @since 3.16.0 additional type `InsertReplaceEdit`
*/
TextEdit *TextEdit/*TextEdit | InsertReplaceEdit*/ `json:"textEdit,omitempty"`
/**
+ * The edit text used if the completion item is part of a CompletionList and
+ * CompletionList defines an item default for the text edit range.
+ *
+ * Clients will only honor this property if they opt into completion list
+ * item defaults using the capability `completionList.itemDefaults`.
+ *
+ * If not provided and a list's default range is provided the label
+ * property is used as a text.
+ *
+ * @since 3.17.0
+ */
+ TextEditText string `json:"textEditText,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.
@@ -1004,17 +1039,17 @@
/**
* Additional details for a completion item label.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type CompletionItemLabelDetails struct {
/**
* An optional string which is rendered less prominently directly after {@link CompletionItem.label label},
- * without any spacing. Should be used for function signatures or type annotations.
+ * without any spacing. Should be used for function signatures and type annotations.
*/
Detail string `json:"detail,omitempty"`
/**
* An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used
- * for fully qualified names or file path.
+ * for fully qualified names and file paths.
*/
Description string `json:"description,omitempty"`
}
@@ -1034,6 +1069,9 @@
type CompletionList struct {
/**
* This list it not complete. Further typing results in recomputing this list.
+ *
+ * Recomputed lists have all their items replaced (not appended) in the
+ * incomplete completion sessions.
*/
IsIncomplete bool `json:"isIncomplete"`
/**
@@ -1049,33 +1087,39 @@
* signals support for this via the `completionList.itemDefaults`
* capability.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
ItemDefaults struct {
/**
* A default commit character set.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
CommitCharacters []string `json:"commitCharacters,omitempty"`
/**
- * A default edit range
+ * A default edit range.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
EditRange Range/*Range | { insert: Range; replace: Range; }*/ `json:"editRange,omitempty"`
/**
- * A default insert text format
+ * A default insert text format.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InsertTextFormat InsertTextFormat `json:"insertTextFormat,omitempty"`
/**
- * A default insert text mode
+ * A default insert text mode.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`
+ /**
+ * A default data value.
+ *
+ * @since 3.17.0
+ */
+ Data LSPAny `json:"data,omitempty"`
} `json:"itemDefaults,omitempty"`
/**
* The completion items.
@@ -1118,7 +1162,7 @@
* The server supports the following `CompletionItem` specific
* capabilities.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
CompletionItem struct {
/**
@@ -1126,7 +1170,7 @@
* details (see also `CompletionItemLabelDetails`) when
* receiving a completion item in a resolve call.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
} `json:"completionItem,omitempty"`
@@ -1152,13 +1196,6 @@
*/
type CompletionTriggerKind float64
-type ConfigurationClientCapabilities struct {
- /**
- * The workspace client capabilities
- */
- Workspace Workspace4Gn `json:"workspace,omitempty"`
-}
-
type ConfigurationItem struct {
/**
* The scope to get the configuration section for.
@@ -1211,7 +1248,8 @@
}
/**
- * The parameters sent in file create requests/notifications.
+ * The parameters sent in notifications/requests for user-initiated creation of
+ * files.
*
* @since 3.16.0
*/
@@ -1363,7 +1401,8 @@
}
/**
- * The parameters sent in file delete requests/notifications.
+ * The parameters sent in notifications/requests for user-initiated deletes of
+ * files.
*
* @since 3.16.0
*/
@@ -1430,6 +1469,84 @@
}
/**
+ * Client capabilities specific to diagnostic pull requests.
+ *
+ * @since 3.17.0
+ */
+type DiagnosticClientCapabilities = struct {
+ /**
+ * Whether implementation supports dynamic registration. If this is set to `true`
+ * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+ * return value for the corresponding server capability as well.
+ */
+ DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
+ /**
+ * Whether the clients supports related documents for document diagnostic pulls.
+ */
+ RelatedDocumentSupport bool `json:"relatedDocumentSupport,omitempty"`
+}
+
+/**
+ * Diagnostic options.
+ *
+ * @since 3.17.0
+ */
+type DiagnosticOptions struct {
+ WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
+ /**
+ * An optional identifier under which the diagnostics are
+ * managed by the client.
+ */
+ Identifier string `json:"identifier,omitempty"`
+ /**
+ * Whether the language has inter file dependencies meaning that
+ * editing code in one file can result in a different diagnostic
+ * set in another file. Inter file dependencies are common for
+ * most programming languages and typically uncommon for linters.
+ */
+ InterFileDependencies bool `json:"interFileDependencies"`
+ /**
+ * The server provides support for workspace diagnostics as well.
+ */
+ WorkspaceDiagnostics bool `json:"workspaceDiagnostics"`
+}
+
+/**
+ * Diagnostic registration options.
+ *
+ * @since 3.17.0
+ */
+type DiagnosticRegistrationOptions struct {
+ /**
+ * 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/*DocumentSelector | null*/ `json:"documentSelector"`
+ WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
+ /**
+ * An optional identifier under which the diagnostics are
+ * managed by the client.
+ */
+ Identifier string `json:"identifier,omitempty"`
+ /**
+ * Whether the language has inter file dependencies meaning that
+ * editing code in one file can result in a different diagnostic
+ * set in another file. Inter file dependencies are common for
+ * most programming languages and typically uncommon for linters.
+ */
+ InterFileDependencies bool `json:"interFileDependencies"`
+ /**
+ * The server provides support for workspace diagnostics as well.
+ */
+ WorkspaceDiagnostics bool `json:"workspaceDiagnostics"`
+ /**
+ * 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"`
+}
+
+/**
* 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.
@@ -1457,6 +1574,24 @@
*/
type DiagnosticTag float64
+/**
+ * Workspace client capabilities specific to diagnostic pull requests.
+ *
+ * @since 3.17.0
+ */
+type DiagnosticWorkspaceClientCapabilities = struct {
+ /**
+ * Whether the client implementation supports a refresh request sent from
+ * the server to the client.
+ *
+ * Note that this event is global and will force the client to refresh all
+ * pulled diagnostics currently shown. It should be used with absolute care and
+ * is useful for situation where a server for example detects a project wide
+ * change that requires such a calculation.
+ */
+ RefreshSupport bool `json:"refreshSupport,omitempty"`
+}
+
type DidChangeConfigurationClientCapabilities struct {
/**
* Did change configuration notification supports dynamic registration.
@@ -1477,7 +1612,7 @@
/**
* The params sent in a change notebook document notification.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type DidChangeNotebookDocumentParams = struct {
/**
@@ -1538,6 +1673,13 @@
* from the server side.
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
+ /**
+ * Whether the client has support for {@link RelativePattern relative pattern}
+ * or not.
+ *
+ * @since 3.17.0
+ */
+ RelativePatternSupport bool `json:"relativePatternSupport,omitempty"`
}
/**
@@ -1573,7 +1715,7 @@
/**
* The params sent in a close notebook document notification.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type DidCloseNotebookDocumentParams = struct {
/**
@@ -1588,7 +1730,7 @@
}
/**
- * The parameters send in a close text document notification
+ * The parameters sent in a close text document notification
*/
type DidCloseTextDocumentParams struct {
/**
@@ -1598,9 +1740,9 @@
}
/**
- * The params sent in a open notebook document notification.
+ * The params sent in an open notebook document notification.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type DidOpenNotebookDocumentParams = struct {
/**
@@ -1615,7 +1757,7 @@
}
/**
- * The parameters send in a open text document notification
+ * The parameters sent in an open text document notification
*/
type DidOpenTextDocumentParams struct {
/**
@@ -1627,7 +1769,7 @@
/**
* The params sent in a save notebook document notification.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type DidSaveNotebookDocumentParams = struct {
/**
@@ -1637,11 +1779,11 @@
}
/**
- * The parameters send in a save text document notification
+ * The parameters sent in a save text document notification
*/
type DidSaveTextDocumentParams struct {
/**
- * The document that was closed.
+ * The document that was saved.
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
@@ -1685,7 +1827,7 @@
/**
* Parameters of the document diagnostic request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type DocumentDiagnosticParams struct {
/**
@@ -1714,15 +1856,22 @@
/**
* The result of a document diagnostic pull request. A report can
* either be a full report containing all diagnostics for the
- * requested document or a unchanged report indicating that nothing
+ * requested document or an unchanged report indicating that nothing
* has changed in terms of diagnostics in comparison to the last
* pull request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type DocumentDiagnosticReport = interface{} /*RelatedFullDocumentDiagnosticReport | RelatedUnchangedDocumentDiagnosticReport*/
/**
+ * The document diagnostic report kinds.
+ *
+ * @since 3.17.0
+ */
+type DocumentDiagnosticReportKind string
+
+/**
* A document filter describes a top level text document or
* a notebook cell document.
*
@@ -1756,7 +1905,7 @@
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
- * The format options
+ * The format options.
*/
Options FormattingOptions `json:"options"`
WorkDoneProgressParams
@@ -1819,7 +1968,7 @@
*/
Range Range `json:"range"`
/**
- * The uri this link points to.
+ * The uri this link points to. If missing a resolve request is sent later.
*/
Target string `json:"target,omitempty"`
/**
@@ -1848,7 +1997,7 @@
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
/**
- * Whether the client support the `tooltip` property on `DocumentLink`.
+ * Whether the client supports the `tooltip` property on `DocumentLink`.
*
* @since 3.15.0
*/
@@ -1893,7 +2042,7 @@
*/
type DocumentOnTypeFormattingOptions struct {
/**
- * A character on which formatting should be triggered, like `}`.
+ * A character on which formatting should be triggered, like `{`.
*/
FirstTriggerCharacter string `json:"firstTriggerCharacter"`
/**
@@ -1911,15 +2060,20 @@
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
- * The position at which this request was send.
+ * The position around which the on type formatting should happen.
+ * This is not necessarily the exact position where the character denoted
+ * by the property `ch` got typed.
*/
Position Position `json:"position"`
/**
- * The character that has been typed.
+ * The character that has been typed that triggered the formatting
+ * on type request. That is not necessarily the last character that
+ * got inserted into the document since the client could auto insert
+ * characters as well (e.g. like automatic brace completion).
*/
Ch string `json:"ch"`
/**
- * The format options.
+ * The formatting options.
*/
Options FormattingOptions `json:"options"`
}
@@ -2003,13 +2157,13 @@
Deprecated bool `json:"deprecated,omitempty"`
/**
* 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
+ * like comments. This information is typically used to determine if the clients cursor is
* inside the symbol to reveal in the symbol in the UI.
*/
Range Range `json:"range"`
/**
* 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`.
+ * Must be contained by the `range`.
*/
SelectionRange Range `json:"selectionRange"`
/**
@@ -2027,7 +2181,8 @@
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
/**
- * Specific capabilities for the `SymbolKind`.
+ * Specific capabilities for the `SymbolKind` in the
+ * `textDocument/documentSymbol` request.
*/
SymbolKind struct {
/**
@@ -2043,7 +2198,7 @@
ValueSet []SymbolKind `json:"valueSet,omitempty"`
} `json:"symbolKind,omitempty"`
/**
- * The client support hierarchical document symbols.
+ * The client supports hierarchical document symbols.
*/
HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`
/**
@@ -2212,7 +2367,7 @@
*/
DidCreate bool `json:"didCreate,omitempty"`
/**
- * The client has support for willCreateFiles requests.
+ * The client has support for sending willCreateFiles requests.
*/
WillCreate bool `json:"willCreate,omitempty"`
/**
@@ -2220,7 +2375,7 @@
*/
DidRename bool `json:"didRename,omitempty"`
/**
- * The client has support for willRenameFiles requests.
+ * The client has support for sending willRenameFiles requests.
*/
WillRename bool `json:"willRename,omitempty"`
/**
@@ -2228,20 +2383,20 @@
*/
DidDelete bool `json:"didDelete,omitempty"`
/**
- * The client has support for willDeleteFiles requests.
+ * The client has support for sending willDeleteFiles requests.
*/
WillDelete bool `json:"willDelete,omitempty"`
}
/**
* A filter to describe in which file operation requests or notifications
- * the server is interested in.
+ * the server is interested in receiving.
*
* @since 3.16.0
*/
type FileOperationFilter struct {
/**
- * A Uri like `file` or `untitled`.
+ * A Uri scheme like `file` or `untitled`.
*/
Scheme string `json:"scheme,omitempty"`
/**
@@ -2257,34 +2412,34 @@
*/
type FileOperationOptions struct {
/**
- * The server is interested in didCreateFiles notifications.
+ * The server is interested in receiving didCreateFiles notifications.
*/
DidCreate FileOperationRegistrationOptions `json:"didCreate,omitempty"`
/**
- * The server is interested in willCreateFiles requests.
+ * The server is interested in receiving willCreateFiles requests.
*/
WillCreate FileOperationRegistrationOptions `json:"willCreate,omitempty"`
/**
- * The server is interested in didRenameFiles notifications.
+ * The server is interested in receiving didRenameFiles notifications.
*/
DidRename FileOperationRegistrationOptions `json:"didRename,omitempty"`
/**
- * The server is interested in willRenameFiles requests.
+ * The server is interested in receiving willRenameFiles requests.
*/
WillRename FileOperationRegistrationOptions `json:"willRename,omitempty"`
/**
- * The server is interested in didDeleteFiles file notifications.
+ * The server is interested in receiving didDeleteFiles file notifications.
*/
DidDelete FileOperationRegistrationOptions `json:"didDelete,omitempty"`
/**
- * The server is interested in willDeleteFiles file requests.
+ * The server is interested in receiving willDeleteFiles file requests.
*/
WillDelete FileOperationRegistrationOptions `json:"willDelete,omitempty"`
}
/**
* A pattern to describe in which file operation requests or notifications
- * the server is interested in.
+ * the server is interested in receiving.
*
* @since 3.16.0
*/
@@ -2361,21 +2516,17 @@
type FileSystemWatcher struct {
/**
- * 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
- * - `**` 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`)
+ * The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail.
+ *
+ * @since 3.17.0 support for relative patterns.
*/
- GlobPattern string `json:"globPattern"`
+ GlobPattern GlobPattern `json:"globPattern"`
/**
* The kind of events of interest. If omitted it defaults
* to WatchKind.Create | WatchKind.Change | WatchKind.Delete
* which is 7.
*/
- Kind uint32 `json:"kind,omitempty"`
+ Kind WatchKind `json:"kind,omitempty"`
}
/**
@@ -2403,33 +2554,72 @@
EndCharacter uint32 `json:"endCharacter,omitempty"`
/**
* 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.
+ * is used to categorize folding ranges and used by commands like 'Fold all comments'.
+ * See [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
*/
- Kind string `json:"kind,omitempty"`
+ Kind FoldingRangeKind `json:"kind,omitempty"`
+ /**
+ * The text that the client should show when the specified range is
+ * collapsed. If not defined or not supported by the client, a default
+ * will be chosen by the client.
+ *
+ * @since 3.17.0
+ */
+ CollapsedText string `json:"collapsedText,omitempty"`
}
type FoldingRangeClientCapabilities struct {
/**
- * 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.
+ * 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"`
/**
- * 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.
+ * 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 uint32 `json:"rangeLimit,omitempty"`
/**
- * 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.
+ * 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"`
+ /**
+ * Specific options for the folding range kind.
+ *
+ * @since 3.17.0
+ */
+ FoldingRangeKind struct {
+ /**
+ * The folding range kind values the client supports. When this
+ * property exists the client also guarantees that it will
+ * handle values outside its set gracefully and falls back
+ * to a default value when unknown.
+ */
+ ValueSet []FoldingRangeKind `json:"valueSet,omitempty"`
+ } `json:"foldingRangeKind,omitempty"`
+ /**
+ * Specific options for the folding range.
+ *
+ * @since 3.17.0
+ */
+ FoldingRange struct {
+ /**
+ * If set, the client signals that it supports setting collapsedText on
+ * folding ranges to display custom labels instead of the default text.
+ *
+ * @since 3.17.0
+ */
+ CollapsedText bool `json:"collapsedText,omitempty"`
+ } `json:"foldingRange,omitempty"`
}
/**
- * Enum of known range kinds
+ * A set of predefined range kinds.
*/
type FoldingRangeKind string
@@ -2468,7 +2658,7 @@
*/
InsertSpaces bool `json:"insertSpaces"`
/**
- * Trim trailing whitespaces on a line.
+ * Trim trailing whitespace on a line.
*
* @since 3.15.0
*/
@@ -2490,13 +2680,13 @@
/**
* A diagnostic report with a full set of problems.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type FullDocumentDiagnosticReport = struct {
/**
* A full document diagnostic report.
*/
- Kind string `json:"kind"`
+ Kind *DocumentDiagnosticReportKind `json:"kind"`
/**
* An optional result id. If provided it will
* be sent on the next diagnostic request for the
@@ -2547,9 +2737,37 @@
* @since 3.16.0
*/
Markdown MarkdownClientCapabilities `json:"markdown,omitempty"`
+ /**
+ * The position encodings supported by the client. Client and server
+ * have to agree on the same position encoding to ensure that offsets
+ * (e.g. character position in a line) are interpreted the same on both
+ * sides.
+ *
+ * To keep the protocol backwards compatible the following applies: if
+ * the value 'utf-16' is missing from the array of position encodings
+ * servers can assume that the client supports UTF-16. UTF-16 is
+ * therefore a mandatory encoding.
+ *
+ * If omitted it defaults to ['utf-16'].
+ *
+ * Implementation considerations: since the conversion from one encoding
+ * into another requires the content of the file / line the conversion
+ * is best done where the file is read which is usually on the server
+ * side.
+ *
+ * @since 3.17.0
+ */
+ PositionEncodings []PositionEncodingKind `json:"positionEncodings,omitempty"`
}
/**
+ * The glob pattern. Either a string pattern or a relative pattern.
+ *
+ * @since 3.17.0
+ */
+type GlobPattern = interface{} /*Pattern | RelativePattern*/
+
+/**
* The result of a hover request.
*/
type Hover struct {
@@ -2558,7 +2776,8 @@
*/
Contents MarkupContent/*MarkupContent | MarkedString | MarkedString[]*/ `json:"contents"`
/**
- * An optional range
+ * An optional range inside the text document that is used to
+ * visualize the hover, e.g. by changing the background color.
*/
Range Range `json:"range,omitempty"`
}
@@ -2569,7 +2788,7 @@
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
/**
- * Client supports the follow content formats for the content
+ * Client supports the following content formats for the content
* property. The order describes the preferred format of the client.
*/
ContentFormat []MarkupKind `json:"contentFormat,omitempty"`
@@ -2625,14 +2844,17 @@
}
/**
- * Known error codes for an `InitializeError`;
+ * Known error codes for an `InitializeErrorCodes`;
*/
-type InitializeError float64
+type InitializeErrorCodes float64
type InitializeParams struct {
/**
* The process Id of the parent process that started
* the server.
+ *
+ * Is `null` if the process has not been started by another process.
+ * If the parent process is not alive then the server should exit.
*/
ProcessID int32/*integer | null*/ `json:"processId"`
/**
@@ -2689,9 +2911,15 @@
*/
Trace string/* 'off' | 'messages' | 'compact' | 'verbose' */ `json:"trace,omitempty"`
/**
- * The actual configured workspace folders.
+ * The workspace folders configured in the client when the server starts.
+ *
+ * This property is only available if the client supports workspace folders.
+ * It can be `null` if the client supports workspace folders but none are
+ * configured.
+ *
+ * @since 3.6.0
*/
- WorkspaceFolders []WorkspaceFolder/*WorkspaceFolder[] | null*/ `json:"workspaceFolders"`
+ WorkspaceFolders []WorkspaceFolder/*WorkspaceFolder[] | null*/ `json:"workspaceFolders,omitempty"`
}
/**
@@ -2725,7 +2953,7 @@
/**
* Inlay hint information.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHint = struct {
/**
@@ -2745,6 +2973,14 @@
*/
Kind InlayHintKind `json:"kind,omitempty"`
/**
+ * Optional text edits that are performed when accepting this inlay hint.
+ *
+ * *Note* that edits are expected to change the document so that the inlay
+ * hint (or its nearest variant) is now part of the document and the inlay
+ * hint itself is now obsolete.
+ */
+ TextEdits []TextEdit `json:"textEdits,omitempty"`
+ /**
* The tooltip text when you hover over this item.
*/
Tooltip string/*string | MarkupContent*/ `json:"tooltip,omitempty"`
@@ -2764,12 +3000,17 @@
* to visually align/separate an inlay hint.
*/
PaddingRight bool `json:"paddingRight,omitempty"`
+ /**
+ * A data entry field that is preserved on an inlay hint between
+ * a `textDocument/inlayHint` and a `inlayHint/resolve` request.
+ */
+ Data LSPAny `json:"data,omitempty"`
}
/**
- * Inlay hint client capabilities
+ * Inlay hint client capabilities.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintClientCapabilities = struct {
/**
@@ -2777,7 +3018,7 @@
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
/**
- * Indicates which properties a client can resolve lazily on a inlay
+ * Indicates which properties a client can resolve lazily on an inlay
* hint.
*/
ResolveSupport struct {
@@ -2791,7 +3032,7 @@
/**
* Inlay hint kinds.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintKind float64
@@ -2799,7 +3040,7 @@
* An inlay hint label part allows for interactive and composite labels
* of inlay hints.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintLabelPart = struct {
/**
@@ -2838,7 +3079,7 @@
/**
* Inlay hint options used during static registration.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintOptions struct {
WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
@@ -2850,9 +3091,9 @@
}
/**
- * A parameter literal used in inlay hints requests.
+ * A parameter literal used in inlay hint requests.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintParams struct {
/**
@@ -2864,15 +3105,15 @@
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
- * The visible document range for which inlay hints should be computed.
+ * The document range for which inlay hints should be computed.
*/
- ViewPort Range `json:"viewPort"`
+ Range Range `json:"range"`
}
/**
* Inlay hint options used during static or dynamic registration.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintRegistrationOptions struct {
WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
@@ -2896,7 +3137,7 @@
/**
* Client workspace capabilities specific to inlay hints.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlayHintWorkspaceClientCapabilities = struct {
/**
@@ -2918,14 +3159,14 @@
* - as an evaluatable expression (class InlineValueEvaluatableExpression)
* The InlineValue types combines all inline value types into one type.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValue = interface{} /* InlineValueText | InlineValueVariableLookup | InlineValueEvaluatableExpression*/
/**
* Client capabilities specific to inline values.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueClientCapabilities = struct {
/**
@@ -2935,10 +3176,14 @@
}
/**
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueContext = struct {
/**
+ * The stack frame (as a DAP Id) where the execution has stopped.
+ */
+ FrameID int32 `json:"frameId"`
+ /**
* The document range where execution has stopped.
* Typically the end position of the range denotes the line where the inline values are shown.
*/
@@ -2950,7 +3195,7 @@
* If only a range is specified, the expression will be extracted from the underlying document.
* An optional expression can be used to override the extracted expression.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueEvaluatableExpression = struct {
/**
@@ -2967,14 +3212,14 @@
/**
* Inline value options used during static registration.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueOptions = WorkDoneProgressOptions
/**
* A parameter literal used in inline value requests.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueParams struct {
/**
@@ -2986,9 +3231,9 @@
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
- * The visible document range for which inline values should be computed.
+ * The document range for which inline values should be computed.
*/
- ViewPort Range `json:"viewPort"`
+ Range Range `json:"range"`
/**
* Additional information about the context in which inline values were
* requested.
@@ -2999,7 +3244,7 @@
/**
* Inline value options used during static or dynamic registration.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueRegistrationOptions struct {
/**
@@ -3017,7 +3262,7 @@
/**
* Provide inline value as text.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueText = struct {
/**
@@ -3035,7 +3280,7 @@
* If only a range is specified, the variable name will be extracted from the underlying document.
* An optional variable name can be used to override the extracted name.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueVariableLookup = struct {
/**
@@ -3056,7 +3301,7 @@
/**
* Client workspace capabilities specific to inline values.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type InlineValueWorkspaceClientCapabilities = struct {
/**
@@ -3106,25 +3351,31 @@
type InsertTextMode float64
/**
- * The LSP any type
+ * The LSP any type.
+ *
+ * In the current implementation we map LSPAny to any. This is due to the fact
+ * that the TypeScript compilers can't infer string access signatures for
+ * interface correctly (it can though for types). See the following issue for
+ * details: https://github.com/microsoft/TypeScript/issues/15300.
+ *
+ * When the issue is addressed LSPAny can be defined as follows:
+ *
+ * ```ts
+ * export type LSPAny = LSPObject | LSPArray | string | integer | uinteger | decimal | boolean | null | undefined;
+ * export type LSPObject = { [key: string]: LSPAny };
+ * export type LSPArray = LSPAny[];
+ * ```
+ *
+ * Please note that strictly speaking a property with the value `undefined`
+ * can't be converted into JSON preserving the property name. However for
+ * convenience it is allowed and assumed that all these properties are
+ * optional as well.
*
* @since 3.17.0
*/
-type LSPAny = interface{} /* LSPObject | LSPArray | string | int32 | uint32 | Decimal | bool | float64*/
+type LSPAny = interface{}
-/**
- * LSP arrays.
- *
- * @since 3.17.0
- */
-type LSPArray = []LSPAny
-
-/**
- * LSP object definition.
- *
- * @since 3.17.0
- */
-type LSPObject = map[string]interface{} /*[key: string]: LSPAny*/
+type LSPObject = interface{}
/**
* Client capabilities for the linked editing range request.
@@ -3191,7 +3442,7 @@
/**
* Span of the origin of this link.
*
- * Used as the underlined span for mouse definition hover. Defaults to the word range at
+ * Used as the underlined span for mouse interaction. Defaults to the word range at
* the definition position.
*/
OriginSelectionRange Range `json:"originSelectionRange,omitempty"`
@@ -3207,7 +3458,7 @@
TargetRange Range `json:"targetRange"`
/**
* 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`
+ * Must be contained by the `targetRange`. See also `DocumentSymbol#range`
*/
TargetSelectionRange Range `json:"targetSelectionRange"`
}
@@ -3221,7 +3472,7 @@
*/
Type MessageType `json:"type"`
/**
- * The actual message
+ * The actual message.
*/
Message string `json:"message"`
}
@@ -3281,13 +3532,13 @@
* ```ts
* let markdown: MarkdownContent = {
* kind: MarkupKind.Markdown,
- * value: [
- * '# Header',
- * 'Some text',
- * '```typescript',
- * 'someCode();',
- * '```'
- * ].join('\n')
+ * value: [
+ * '# Header',
+ * 'Some text',
+ * '```typescript',
+ * 'someCode();',
+ * '```'
+ * ].join('\n')
* };
* ```
*
@@ -3394,7 +3645,7 @@
* cells and can therefore be used to uniquely identify a
* notebook cell or the cell's text document.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type NotebookCell = struct {
/**
@@ -3408,6 +3659,8 @@
Document DocumentURI `json:"document"`
/**
* Additional metadata stored with the cell.
+ *
+ * Note: should always be an object literal (e.g. LSPObject)
*/
Metadata LSPObject `json:"metadata,omitempty"`
/**
@@ -3421,7 +3674,7 @@
* A change describing how to move a `NotebookCell`
* array from state S to S'.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type NotebookCellArrayChange = struct {
/**
@@ -3441,7 +3694,7 @@
/**
* A notebook cell kind.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type NotebookCellKind float64
@@ -3449,27 +3702,29 @@
* A notebook cell text document filter denotes a cell text
* document by different properties.
*
- * @since 3.17.0 - proposed state.
+ * @since 3.17.0
*/
type NotebookCellTextDocumentFilter = struct {
/**
* A filter that matches against the notebook
- * containing the notebook cell.
+ * containing the notebook cell. If a string
+ * value is provided it matches against the
+ * notebook type. '*' matches every notebook.
*/
- NotebookDocument NotebookDocumentFilter `json:"notebookDocument"`
+ Notebook string/*string | NotebookDocumentFilter*/ `json:"notebook"`
/**
* A language id like `python`.
*
* Will be matched against the language id of the
- * notebook cell document.
+ * notebook cell document. '*' matches every language.
*/
- CellLanguage string `json:"cellLanguage,omitempty"`
+ Language string `json:"language,omitempty"`
}
/**
* A notebook document.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type NotebookDocument = struct {
/**
@@ -3488,6 +3743,8 @@
/**
* Additional metadata stored with the notebook
* document.
+ *
+ * Note: should always be an object literal (e.g. LSPObject)
*/
Metadata LSPObject `json:"metadata,omitempty"`
/**
@@ -3499,11 +3756,13 @@
/**
* A change event for a notebook document.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type NotebookDocumentChangeEvent = struct {
/**
* The changed meta data if any.
+ *
+ * Note: should always be an object literal (e.g. LSPObject)
*/
Metadata LSPObject `json:"metadata,omitempty"`
/**
@@ -3544,26 +3803,39 @@
}
/**
- * A notebook document filter denotes a notebook document by
- * different properties.
+ * Capabilities specific to the notebook document support.
*
- * @since 3.17.0 - proposed state.
+ * @since 3.17.0
+ */
+type NotebookDocumentClientCapabilities struct {
+ /**
+ * Capabilities specific to notebook document synchronization
+ *
+ * @since 3.17.0
+ */
+ Synchronization NotebookDocumentSyncClientCapabilities `json:"synchronization"`
+}
+
+/**
+ * A notebook document filter denotes a notebook document by
+ * different properties. The properties will be match
+ * against the notebook's URI (same as with documents)
+ *
+ * @since 3.17.0
*/
type NotebookDocumentFilter = struct {
/** The type of the enclosing notebook. */
NotebookType string `json:"notebookType"`
- /** A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
- * Will be matched against the URI of the notebook. */
+ /** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
Scheme string `json:"scheme,omitempty"`
- /** A glob pattern, like `*.ipynb`.
- * Will be matched against the notebooks` URI path section.*/
+ /** A glob pattern. */
Pattern string `json:"pattern,omitempty"`
}
/**
* A literal to identify a notebook document in the client.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type NotebookDocumentIdentifier = struct {
/**
@@ -3573,6 +3845,78 @@
}
/**
+ * Notebook specific client capabilities.
+ *
+ * @since 3.17.0
+ */
+type NotebookDocumentSyncClientCapabilities = struct {
+ /**
+ * Whether implementation supports dynamic registration. If this is
+ * set to `true` the client supports the new
+ * `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
+ * return value for the corresponding server capability as well.
+ */
+ DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
+ /**
+ * The client supports sending execution summary data per cell.
+ */
+ ExecutionSummarySupport bool `json:"executionSummarySupport,omitempty"`
+}
+
+/**
+ * Options specific to a notebook plus its cells
+ * to be synced to the server.
+ *
+ * If a selector provides a notebook document
+ * filter but no cell selector all cells of a
+ * matching notebook document will be synced.
+ *
+ * If a selector provides no notebook document
+ * filter but only a cell selector all notebook
+ * document that contain at least one matching
+ * cell will be synced.
+ *
+ * @since 3.17.0
+ */
+type NotebookDocumentSyncOptions = struct {
+ /**
+ * The notebooks to be synced
+ */
+ NotebookSelector []struct {
+ /**
+ * The notebook to be synced If a string
+ * value is provided it matches against the
+ * notebook type. '*' matches every notebook.
+ */
+ Notebook string/*string | NotebookDocumentFilter*/ `json:"notebook"`
+ /**
+ * The cells of the matching notebook to be synced.
+ */
+ Cells []struct {
+ Language string `json:"language"`
+ } `json:"cells,omitempty"`
+ } `json:"notebookSelector"`
+ /**
+ * Whether save notification should be forwarded to
+ * the server. Will only be honored if mode === `notebook`.
+ */
+ Save bool `json:"save,omitempty"`
+}
+
+/**
+ * Registration options specific to a notebook.
+ *
+ * @since 3.17.0
+ */
+type NotebookDocumentSyncRegistrationOptions struct {
+ /**
+ * 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"`
+}
+
+/**
* A text document identifier to optionally denote a specific version of a text document.
*/
type OptionalVersionedTextDocumentIdentifier struct {
@@ -3604,7 +3948,7 @@
*/
Label string/*string | [uinteger, uinteger]*/ `json:"label"`
/**
- * The human-readable doc-comment of this signature. Will be shown
+ * The human-readable doc-comment of this parameter. Will be shown
* in the UI but can be omitted.
*/
Documentation string/*string | MarkupContent*/ `json:"documentation,omitempty"`
@@ -3619,24 +3963,60 @@
}
/**
- * 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 `𐐀`
- * is 1 and the character offset of b is 3 since `𐐀` is represented using two code
- * units in UTF-16.
+ * The glob pattern to watch relative to the base path. 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`)
*
- * Positions are line end character agnostic. So you can not specify a position that
- * denotes `\r|\n` or `\n|` where `|` represents the character offset.
+ * @since 3.17.0
+ */
+type Pattern = string
+
+/**
+ * Position in a text document expressed as zero-based line and character
+ * offset. Prior to 3.17 the offsets were always 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 `𐐀` is 1 and the character
+ * offset of b is 3 since `𐐀` is represented using two code units in UTF-16.
+ * Since 3.17 clients and servers can agree on a different string encoding
+ * representation (e.g. UTF-8). The client announces it's supported encoding
+ * via the client capability [`general.positionEncodings`](#clientCapabilities).
+ * The value is an array of position encodings the client supports, with
+ * decreasing preference (e.g. the encoding at index `0` is the most preferred
+ * one). To stay backwards compatible the only mandatory encoding is UTF-16
+ * represented via the string `utf-16`. The server can pick one of the
+ * encodings offered by the client and signals that encoding back to the
+ * client via the initialize result's property
+ * [`capabilities.positionEncoding`](#serverCapabilities). If the string value
+ * `utf-16` is missing from the client's capability `general.positionEncodings`
+ * servers can safely assume that the client supports UTF-16. If the server
+ * omits the position encoding in its initialize result the encoding defaults
+ * to the string value `utf-16`. Implementation considerations: since the
+ * conversion from one encoding into another requires the content of the
+ * file / line the conversion is best done where the file is read which is
+ * usually on the server side.
+ *
+ * Positions are line end character agnostic. So you can not specify a position
+ * that denotes `\r|\n` or `\n|` where `|` represents the character offset.
+ *
+ * @since 3.17.0 - support for negotiated position encoding.
*/
type Position struct {
/**
* 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 uint32 `json:"line"`
/**
- * 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`.
+ * Character offset on a line in a document (zero-based).
+ *
+ * The meaning of this offset is determined by the negotiated
+ * `PositionEncodingKind`.
*
* If the character value is greater than the line length it defaults back to the
* line length.
@@ -3644,17 +4024,26 @@
Character uint32 `json:"character"`
}
+/**
+ * A set of predefined position encoding kinds.
+ *
+ * @since 3.17.0
+ */
+type PositionEncodingKind string
+
type PrepareRenameParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
+type PrepareRenameResult = interface{} /* Range | struct{; Range *Range`json:"range"`; Placeholder string`json:"placeholder"`; } | struct{; DefaultBehavior bool`json:"defaultBehavior"`; }*/
+
type PrepareSupportDefaultBehavior = interface{}
/**
* A previous result id in a workspace pull request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type PreviousResultID = struct {
/**
@@ -3703,7 +4092,7 @@
} `json:"tagSupport,omitempty"`
/**
* Whether the client interprets the version property of the
- * `textDocument/publishDiagnostics` notification`s parameter.
+ * `textDocument/publishDiagnostics` notification's parameter.
*
* @since 3.15.0
*/
@@ -3759,7 +4148,7 @@
*/
type Range struct {
/**
- * The range's start position
+ * The range's start position.
*/
Start Position `json:"start"`
/**
@@ -3816,7 +4205,7 @@
*/
ID string `json:"id"`
/**
- * The method to register for.
+ * The method / capability to register for.
*/
Method string `json:"method"`
/**
@@ -3848,7 +4237,7 @@
/**
* A full diagnostic report with a set of related documents.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type RelatedFullDocumentDiagnosticReport struct {
/**
@@ -3858,15 +4247,15 @@
* such a language is C/C++ where marco definitions in a file
* a.cpp and result in errors in a header file b.hpp.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
- RelatedDocuments map[string]interface{} /*[uri: string ** DocumentUri *]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;*/ `json:"relatedDocuments,omitempty"`
+ RelatedDocuments map[DocumentURI][]TextEdit /*[uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;*/ `json:"relatedDocuments,omitempty"`
}
/**
* An unchanged diagnostic report with a set of related documents.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type RelatedUnchangedDocumentDiagnosticReport struct {
/**
@@ -3876,9 +4265,28 @@
* such a language is C/C++ where marco definitions in a file
* a.cpp and result in errors in a header file b.hpp.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
- RelatedDocuments map[string]interface{} /*[uri: string ** DocumentUri *]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;*/ `json:"relatedDocuments,omitempty"`
+ RelatedDocuments map[DocumentURI][]TextEdit /*[uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;*/ `json:"relatedDocuments,omitempty"`
+}
+
+/**
+ * A relative pattern is a helper to construct glob patterns that are matched
+ * relatively to a base URI. The common value for a `baseUri` is a workspace
+ * folder root, but it can be another absolute URI as well.
+ *
+ * @since 3.17.0
+ */
+type RelativePattern struct {
+ /**
+ * A workspace folder or a base URI to which this pattern will be matched
+ * against relatively.
+ */
+ BaseURI interface{}/*WorkspaceFolder | URI*/ `json:"baseUri"`
+ /**
+ * The actual glob pattern;
+ */
+ Pattern Pattern `json:"pattern"`
}
type RenameClientCapabilities struct {
@@ -3903,7 +4311,7 @@
*/
PrepareSupportDefaultBehavior PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitempty"`
/**
- * Whether th client honors the change annotations in
+ * Whether the client honors the change annotations in
* text edits and resource operations returned via the
* rename request's workspace edit by for example presenting
* the workspace edit in the user interface and asking
@@ -3952,7 +4360,8 @@
}
/**
- * The parameters sent in file rename requests/notifications.
+ * The parameters sent in notifications/requests for user-initiated renames of
+ * files.
*
* @since 3.16.0
*/
@@ -4302,13 +4711,36 @@
RefreshSupport bool `json:"refreshSupport,omitempty"`
}
+/**
+ * Defines the capabilities provided by a language
+ * server.
+ */
type ServerCapabilities struct {
/**
- * Defines how text documents are synced. Is either a detailed structure defining each notification or
- * for backwards compatibility the TextDocumentSyncKind number.
+ * The position encoding the server picked from the encodings offered
+ * by the client via the client capability `general.positionEncodings`.
+ *
+ * If the client didn't provide any position encodings the only valid
+ * value that a server can return is 'utf-16'.
+ *
+ * If omitted it defaults to 'utf-16'.
+ *
+ * @since 3.17.0
+ */
+ PositionEncoding PositionEncodingKind `json:"positionEncoding,omitempty"`
+ /**
+ * Defines how text documents are synced. Is either a detailed structure
+ * defining each notification or for backwards compatibility the
+ * TextDocumentSyncKind number.
*/
TextDocumentSync interface{}/*TextDocumentSyncOptions | TextDocumentSyncKind*/ `json:"textDocumentSync,omitempty"`
/**
+ * Defines how notebook documents are synced.
+ *
+ * @since 3.17.0
+ */
+ NotebookDocumentSync interface{}/*NotebookDocumentSyncOptions | NotebookDocumentSyncRegistrationOptions*/ `json:"notebookDocumentSync,omitempty"`
+ /**
* The server provides completion support.
*/
CompletionProvider CompletionOptions `json:"completionProvider,omitempty"`
@@ -4419,10 +4851,6 @@
*/
SemanticTokensProvider interface{}/*SemanticTokensOptions | SemanticTokensRegistrationOptions*/ `json:"semanticTokensProvider,omitempty"`
/**
- * The workspace server capabilities
- */
- Workspace Workspace6Gn `json:"workspace,omitempty"`
- /**
* The server provides moniker support.
*
* @since 3.16.0
@@ -4431,22 +4859,32 @@
/**
* The server provides type hierarchy support.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
TypeHierarchyProvider interface{}/* bool | TypeHierarchyOptions | TypeHierarchyRegistrationOptions*/ `json:"typeHierarchyProvider,omitempty"`
/**
* The server provides inline values.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InlineValueProvider interface{}/* bool | InlineValueOptions | InlineValueRegistrationOptions*/ `json:"inlineValueProvider,omitempty"`
/**
* The server provides inlay hints.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InlayHintProvider interface{}/* bool | InlayHintOptions | InlayHintRegistrationOptions*/ `json:"inlayHintProvider,omitempty"`
/**
+ * The server has support for pull model diagnostics.
+ *
+ * @since 3.17.0
+ */
+ DiagnosticProvider interface{}/*DiagnosticOptions | DiagnosticRegistrationOptions*/ `json:"diagnosticProvider,omitempty"`
+ /**
+ * Workspace specific server capabilities.
+ */
+ Workspace Workspace2Gn `json:"workspace,omitempty"`
+ /**
* Experimental server capabilities.
*/
Experimental interface{} `json:"experimental,omitempty"`
@@ -4457,13 +4895,13 @@
}
/**
- * Client capabilities for the show document request.
+ * Client capabilities for the showDocument request.
*
* @since 3.16.0
*/
type ShowDocumentClientCapabilities struct {
/**
- * The client has support for the show document
+ * The client has support for the showDocument
* request.
*/
Support bool `json:"support"`
@@ -4489,7 +4927,7 @@
* An optional property to indicate whether the editor
* showing the document should take focus or not.
* Clients might ignore this property if an external
- * program in started.
+ * program is started.
*/
TakeFocus bool `json:"takeFocus,omitempty"`
/**
@@ -4502,7 +4940,7 @@
}
/**
- * The result of an show document request.
+ * The result of a showDocument request.
*
* @since 3.16.0
*/
@@ -4522,7 +4960,7 @@
*/
Type MessageType `json:"type"`
/**
- * The actual message
+ * The actual message.
*/
Message string `json:"message"`
}
@@ -4550,7 +4988,7 @@
*/
Type MessageType `json:"type"`
/**
- * The actual message
+ * The actual message.
*/
Message string `json:"message"`
/**
@@ -4607,7 +5045,7 @@
*/
SignatureInformation struct {
/**
- * Client supports the follow content formats for the documentation
+ * Client supports the following content formats for the documentation
* property. The order describes the preferred format of the client.
*/
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
@@ -4624,7 +5062,7 @@
LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
} `json:"parameterInformation,omitempty"`
/**
- * The client support the `activeParameter` property on `SignatureInformation`
+ * The client supports the `activeParameter` property on `SignatureInformation`
* literal.
*
* @since 3.16.0
@@ -4661,7 +5099,7 @@
/**
* `true` if signature help was already showing when it was triggered.
*
- * Retrigger occurs when the signature help is already active and can be caused by actions such as
+ * Retriggers occurs 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"`
@@ -4679,7 +5117,7 @@
*/
type SignatureHelpOptions struct {
/**
- * List of characters that trigger signature help.
+ * List of characters that trigger signature help automatically.
*/
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
/**
@@ -4764,20 +5202,6 @@
*/
type SymbolInformation struct {
/**
- * The name of this symbol.
- */
- Name string `json:"name"`
- /**
- * The kind of this symbol.
- */
- Kind SymbolKind `json:"kind"`
- /**
- * Tags for this completion item.
- *
- * @since 3.16.0
- */
- Tags []SymbolTag `json:"tags,omitempty"`
- /**
* Indicates if this symbol is deprecated.
*
* @deprecated Use tags instead
@@ -4788,20 +5212,14 @@
* 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
* the range usually spans more than the actual symbol's name and does
- * normally include thinks like visibility modifiers.
+ * normally include things like visibility modifiers.
*
- * The range doesn't have to denote a node range in the sense of a abstract
+ * The range doesn't have to denote a node range in the sense of an abstract
* syntax tree. It can therefore not be used to re-construct a hierarchy of
* the symbols.
*/
Location Location `json:"location"`
- /**
- * 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
- * symbols.
- */
- ContainerName string `json:"containerName,omitempty"`
+ BaseSymbolInformation
}
/**
@@ -4811,6 +5229,7 @@
/**
* Symbol tags are extra annotations that tweak the rendering of a symbol.
+ *
* @since 3.16
*/
type SymbolTag float64
@@ -4824,101 +5243,104 @@
*/
Synchronization TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"`
/**
- * Capabilities specific to the `textDocument/completion`
+ * Capabilities specific to the `textDocument/completion` request.
*/
Completion CompletionClientCapabilities `json:"completion,omitempty"`
/**
- * Capabilities specific to the `textDocument/hover`
+ * Capabilities specific to the `textDocument/hover` request.
*/
Hover HoverClientCapabilities `json:"hover,omitempty"`
/**
- * Capabilities specific to the `textDocument/signatureHelp`
+ * Capabilities specific to the `textDocument/signatureHelp` request.
*/
SignatureHelp SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"`
/**
- * Capabilities specific to the `textDocument/declaration`
+ * Capabilities specific to the `textDocument/declaration` request.
*
* @since 3.14.0
*/
Declaration DeclarationClientCapabilities `json:"declaration,omitempty"`
/**
- * Capabilities specific to the `textDocument/definition`
+ * Capabilities specific to the `textDocument/definition` request.
*/
Definition DefinitionClientCapabilities `json:"definition,omitempty"`
/**
- * Capabilities specific to the `textDocument/typeDefinition`
+ * Capabilities specific to the `textDocument/typeDefinition` request.
*
* @since 3.6.0
*/
TypeDefinition TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"`
/**
- * Capabilities specific to the `textDocument/implementation`
+ * Capabilities specific to the `textDocument/implementation` request.
*
* @since 3.6.0
*/
Implementation ImplementationClientCapabilities `json:"implementation,omitempty"`
/**
- * Capabilities specific to the `textDocument/references`
+ * Capabilities specific to the `textDocument/references` request.
*/
References ReferenceClientCapabilities `json:"references,omitempty"`
/**
- * Capabilities specific to the `textDocument/documentHighlight`
+ * Capabilities specific to the `textDocument/documentHighlight` request.
*/
DocumentHighlight DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"`
/**
- * Capabilities specific to the `textDocument/documentSymbol`
+ * Capabilities specific to the `textDocument/documentSymbol` request.
*/
DocumentSymbol DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"`
/**
- * Capabilities specific to the `textDocument/codeAction`
+ * Capabilities specific to the `textDocument/codeAction` request.
*/
CodeAction CodeActionClientCapabilities `json:"codeAction,omitempty"`
/**
- * Capabilities specific to the `textDocument/codeLens`
+ * Capabilities specific to the `textDocument/codeLens` request.
*/
CodeLens CodeLensClientCapabilities `json:"codeLens,omitempty"`
/**
- * Capabilities specific to the `textDocument/documentLink`
+ * Capabilities specific to the `textDocument/documentLink` request.
*/
DocumentLink DocumentLinkClientCapabilities `json:"documentLink,omitempty"`
/**
- * Capabilities specific to the `textDocument/documentColor`
+ * Capabilities specific to the `textDocument/documentColor` and the
+ * `textDocument/colorPresentation` request.
+ *
+ * @since 3.6.0
*/
ColorProvider DocumentColorClientCapabilities `json:"colorProvider,omitempty"`
/**
- * Capabilities specific to the `textDocument/formatting`
+ * Capabilities specific to the `textDocument/formatting` request.
*/
Formatting DocumentFormattingClientCapabilities `json:"formatting,omitempty"`
/**
- * Capabilities specific to the `textDocument/rangeFormatting`
+ * Capabilities specific to the `textDocument/rangeFormatting` request.
*/
RangeFormatting DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"`
/**
- * Capabilities specific to the `textDocument/onTypeFormatting`
+ * Capabilities specific to the `textDocument/onTypeFormatting` request.
*/
OnTypeFormatting DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"`
/**
- * Capabilities specific to the `textDocument/rename`
+ * Capabilities specific to the `textDocument/rename` request.
*/
Rename RenameClientCapabilities `json:"rename,omitempty"`
/**
- * Capabilities specific to `textDocument/foldingRange` request.
+ * Capabilities specific to the `textDocument/foldingRange` request.
*
* @since 3.10.0
*/
FoldingRange FoldingRangeClientCapabilities `json:"foldingRange,omitempty"`
/**
- * Capabilities specific to `textDocument/selectionRange` request.
+ * Capabilities specific to the `textDocument/selectionRange` request.
*
* @since 3.15.0
*/
SelectionRange SelectionRangeClientCapabilities `json:"selectionRange,omitempty"`
/**
- * Capabilities specific to `textDocument/publishDiagnostics` notification.
+ * Capabilities specific to the `textDocument/publishDiagnostics` notification.
*/
PublishDiagnostics PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"`
/**
- * Capabilities specific to the various call hierarchy request.
+ * Capabilities specific to the various call hierarchy requests.
*
* @since 3.16.0
*/
@@ -4930,13 +5352,13 @@
*/
SemanticTokens SemanticTokensClientCapabilities `json:"semanticTokens,omitempty"`
/**
- * Capabilities specific to the linked editing range request.
+ * Capabilities specific to the `textDocument/linkedEditingRange` request.
*
* @since 3.16.0
*/
LinkedEditingRange LinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitempty"`
/**
- * Client capabilities specific to the moniker request.
+ * Client capabilities specific to the `textDocument/moniker` request.
*
* @since 3.16.0
*/
@@ -4944,26 +5366,32 @@
/**
* Capabilities specific to the various type hierarchy requests.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
TypeHierarchy TypeHierarchyClientCapabilities `json:"typeHierarchy,omitempty"`
/**
* Capabilities specific to the `textDocument/inlineValue` request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InlineValue InlineValueClientCapabilities `json:"inlineValue,omitempty"`
/**
* Capabilities specific to the `textDocument/inlayHint` request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
InlayHint InlayHintClientCapabilities `json:"inlayHint,omitempty"`
+ /**
+ * Capabilities specific to the diagnostic pull model.
+ *
+ * @since 3.17.0
+ */
+ Diagnostic DiagnosticClientCapabilities `json:"diagnostic,omitempty"`
}
/**
- * 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.
+ * An event describing a change to a text document. If only a text is provided
+ * it is considered to be the full content of the document.
*/
type TextDocumentContentChangeEvent = struct {
/**
@@ -5018,7 +5446,7 @@
* @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' }`
*
- * @since 3.17.0 - proposed state.
+ * @since 3.17.0
*/
type TextDocumentFilter = struct {
/** A language id, like `typescript`. */
@@ -5049,7 +5477,7 @@
*/
URI DocumentURI `json:"uri"`
/**
- * The text document's language identifier
+ * The text document's language identifier.
*/
LanguageID string `json:"languageId"`
/**
@@ -5167,7 +5595,7 @@
type TokenFormat = string
-type TraceValues = string /* 'off' | 'messages' | 'compact' | 'verbose' */
+type TraceValues string
/**
* Since 3.6.0
@@ -5204,7 +5632,7 @@
}
/**
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchyClientCapabilities = struct {
/**
@@ -5216,7 +5644,7 @@
}
/**
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchyItem = struct {
/**
@@ -5262,14 +5690,14 @@
/**
* Type hierarchy options used during static registration.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchyOptions = WorkDoneProgressOptions
/**
* The parameter of a `textDocument/prepareTypeHierarchy` request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchyPrepareParams struct {
/**
@@ -5289,7 +5717,7 @@
/**
* Type hierarchy options used during static or dynamic registration.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchyRegistrationOptions struct {
/**
@@ -5307,7 +5735,7 @@
/**
* The parameter of a `typeHierarchy/subtypes` request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchySubtypesParams struct {
/**
@@ -5325,7 +5753,7 @@
/**
* The parameter of a `typeHierarchy/supertypes` request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type TypeHierarchySupertypesParams struct {
/**
@@ -5351,7 +5779,7 @@
* A diagnostic report indicating that the last returned
* report is still accurate.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type UnchangedDocumentDiagnosticReport = struct {
/**
@@ -5360,7 +5788,7 @@
* only return `unchanged` if result ids are
* provided.
*/
- Kind string `json:"kind"`
+ Kind *DocumentDiagnosticReportKind `json:"kind"`
/**
* A result id which will be sent on the next
* diagnostic request for the same document.
@@ -5397,7 +5825,7 @@
/**
* A versioned notebook document identifier.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type VersionedNotebookDocumentIdentifier = struct {
/**
@@ -5424,7 +5852,7 @@
type WatchKind float64
/**
- * The parameters send in a will save text document notification.
+ * The parameters sent in a will save text document notification.
*/
type WillSaveTextDocumentParams struct {
/**
@@ -5437,6 +5865,33 @@
Reason TextDocumentSaveReason `json:"reason"`
}
+type WindowClientCapabilities struct {
+ /**
+ * It indicates whether the client supports server initiated
+ * progress using the `window/workDoneProgress/create` request.
+ *
+ * The capability also controls Whether client supports handling
+ * of progress notifications. If set servers are allowed to report a
+ * `workDoneProgress` property in the request specific server
+ * capabilities.
+ *
+ * @since 3.15.0
+ */
+ WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
+ /**
+ * Capabilities specific to the showMessage request.
+ *
+ * @since 3.16.0
+ */
+ ShowMessage ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
+ /**
+ * Capabilities specific to the showDocument request.
+ *
+ * @since 3.16.0
+ */
+ ShowDocument ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
+}
+
type WorkDoneProgressBegin struct {
Kind string `json:"kind"`
/**
@@ -5478,33 +5933,6 @@
Token ProgressToken `json:"token"`
}
-type WorkDoneProgressClientCapabilities struct {
- /**
- * Window specific client capabilities.
- */
- Window struct {
- /**
- * Whether client supports server initiated progress using the
- * `window/workDoneProgress/create` request.
- *
- * Since 3.15.0
- */
- WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
- /**
- * Capabilities specific to the showMessage request.
- *
- * @since 3.16.0
- */
- ShowMessage ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
- /**
- * Capabilities specific to the showDocument request.
- *
- * @since 3.16.0
- */
- ShowDocument ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
- } `json:"window,omitempty"`
-}
-
type WorkDoneProgressCreateParams struct {
/**
* The token to be used to report progress.
@@ -5571,7 +5999,7 @@
*/
ApplyEdit bool `json:"applyEdit,omitempty"`
/**
- * Capabilities specific to `WorkspaceEdit`s
+ * Capabilities specific to `WorkspaceEdit`s.
*/
WorkspaceEdit WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
/**
@@ -5591,6 +6019,18 @@
*/
ExecuteCommand ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
/**
+ * The client has support for workspace folders.
+ *
+ * @since 3.6.0
+ */
+ WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
+ /**
+ * The client supports `workspace/configuration` requests.
+ *
+ * @since 3.6.0
+ */
+ Configuration bool `json:"configuration,omitempty"`
+ /**
* Capabilities specific to the semantic token requests scoped to the
* workspace.
*
@@ -5618,18 +6058,25 @@
*/
InlineValue InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
/**
- * Capabilities specific to the inlay hints requests scoped to the
+ * Capabilities specific to the inlay hint requests scoped to the
* workspace.
*
* @since 3.17.0.
*/
InlayHint InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitempty"`
+ /**
+ * Capabilities specific to the diagnostic requests scoped to the
+ * workspace.
+ *
+ * @since 3.17.0.
+ */
+ Diagnostics DiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitempty"`
}
/**
* Parameters of the workspace diagnostic request.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type WorkspaceDiagnosticParams struct {
/**
@@ -5655,7 +6102,7 @@
/**
* A workspace diagnostic report.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type WorkspaceDiagnosticReport = struct {
Items []WorkspaceDocumentDiagnosticReport `json:"items"`
@@ -5664,7 +6111,7 @@
/**
* A workspace diagnostic document report.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type WorkspaceDocumentDiagnosticReport = interface{} /*WorkspaceFullDocumentDiagnosticReport | WorkspaceUnchangedDocumentDiagnosticReport*/
@@ -5734,7 +6181,7 @@
* Whether the client normalizes line endings to the client specific
* setting.
* If set to `true` the client will normalize line ending characters
- * in a workspace edit containing to the client specific new line
+ * in a workspace edit to the client-specified new line
* character.
*
* @since 3.16.0
@@ -5756,11 +6203,14 @@
} `json:"changeAnnotationSupport,omitempty"`
}
+/**
+ * A workspace folder inside a client.
+ */
type WorkspaceFolder struct {
/**
* The associated URI for this workspace folder.
*/
- URI string `json:"uri"`
+ URI URI `json:"uri"`
/**
* The name of the workspace folder. Used to refer to this
* workspace folder in the user interface.
@@ -5782,31 +6232,40 @@
Removed []WorkspaceFolder `json:"removed"`
}
-type WorkspaceFoldersClientCapabilities struct {
- /**
- * The workspace client capabilities
- */
- Workspace Workspace7Gn `json:"workspace,omitempty"`
-}
-
type WorkspaceFoldersInitializeParams struct {
/**
- * The actual configured workspace folders.
+ * The workspace folders configured in the client when the server starts.
+ *
+ * This property is only available if the client supports workspace folders.
+ * It can be `null` if the client supports workspace folders but none are
+ * configured.
+ *
+ * @since 3.6.0
*/
- WorkspaceFolders []WorkspaceFolder /*WorkspaceFolder[] | null*/ `json:"workspaceFolders"`
+ WorkspaceFolders []WorkspaceFolder /*WorkspaceFolder[] | null*/ `json:"workspaceFolders,omitempty"`
}
type WorkspaceFoldersServerCapabilities struct {
/**
- * The workspace server capabilities
+ * The server has support for workspace folders
*/
- Workspace Workspace9Gn `json:"workspace,omitempty"`
+ Supported bool `json:"supported,omitempty"`
+ /**
+ * Whether the server wants to receive workspace folder
+ * change notifications.
+ *
+ * If a string is provided the string is treated as an ID
+ * under which the notification is registered 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"`
}
/**
* A full document diagnostic report for a workspace diagnostic result.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type WorkspaceFullDocumentDiagnosticReport struct {
/**
@@ -5821,13 +6280,17 @@
}
/**
- * A special workspace symbol that supports locations without a range
+ * A special workspace symbol that supports locations without a range.
*
- * @since 3.17.0 - proposed state
+ * See also SymbolInformation.
+ *
+ * @since 3.17.0
*/
type WorkspaceSymbol struct {
/**
- * The location of the symbol.
+ * The location of the symbol. Whether a server is allowed to
+ * return a location without a range depends on the client
+ * capability `workspace.symbol.resolveSupport`.
*
* See SymbolInformation#location for more details.
*/
@@ -5837,6 +6300,7 @@
* workspace symbol request and a workspace symbol resolve request.
*/
Data LSPAny `json:"data,omitempty"`
+ BaseSymbolInformation
}
/**
@@ -5880,7 +6344,7 @@
* request `workspaceSymbol/resolve` to the server to resolve additional
* properties.
*
- * @since 3.17.0 - proposedState
+ * @since 3.17.0
*/
ResolveSupport struct {
/**
@@ -5899,7 +6363,7 @@
* The server provides support to resolve additional
* information for a workspace symbol.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
ResolveProvider bool `json:"resolveProvider,omitempty"`
WorkDoneProgressOptions
@@ -5921,7 +6385,7 @@
/**
* An unchanged document diagnostic report for a workspace diagnostic result.
*
- * @since 3.17.0 - proposed state
+ * @since 3.17.0
*/
type WorkspaceUnchangedDocumentDiagnosticReport struct {
/**
@@ -6108,6 +6572,18 @@
Deprecated DiagnosticTag = 2
/**
+ * A diagnostic report with a full
+ * set of problems.
+ */
+
+ DocumentDiagnosticFull DocumentDiagnosticReportKind = "full"
+ /**
+ * A report indicating that the last
+ * returned report is still accurate.
+ */
+
+ DocumentDiagnosticUnchanged DocumentDiagnosticReportKind = "unchanged"
+ /**
* A textual occurrence.
*/
@@ -6175,22 +6651,26 @@
/**
* Folding range for a comment
*/
+
Comment FoldingRangeKind = "comment"
/**
- * Folding range for a imports or includes
+ * Folding range for an import or include
*/
+
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
+ UnknownProtocolVersion InitializeErrorCodes = 1
/**
* An inlay hint that for a type annotation.
*/
@@ -6271,15 +6751,18 @@
/**
* The moniker represent a symbol that is imported into a project
*/
+
Import MonikerKind = "import"
/**
* The moniker represents a symbol that is exported from a project
*/
+
Export MonikerKind = "export"
/**
* The moniker represents a symbol that is local to a project (e.g. a local
* variable of a function, a class not visible outside the project, ...)
*/
+
Local MonikerKind = "local"
/**
* A markup-cell is formatted source that is used for display.
@@ -6292,6 +6775,28 @@
Code NotebookCellKind = 2
/**
+ * Character offsets count UTF-8 code units.
+ */
+
+ UTF8 PositionEncodingKind = "utf-8"
+ /**
+ * Character offsets count UTF-16 code units.
+ *
+ * This is the default and must always be supported
+ * by servers
+ */
+
+ UTF16 PositionEncodingKind = "utf-16"
+ /**
+ * Character offsets count UTF-32 code units.
+ *
+ * Implementation note: these are the same as Unicode code points,
+ * so this `PositionEncodingKind` may also be used for an
+ * encoding-agnostic representation of character offsets.
+ */
+
+ UTF32 PositionEncodingKind = "utf-32"
+ /**
* Supports creating new files and folders.
*/
@@ -6387,24 +6892,49 @@
Incremental TextDocumentSyncKind = 2
/**
+ * Turn tracing off.
+ */
+
+ Off TraceValues = "off"
+ /**
+ * Trace messages only.
+ */
+
+ Messages TraceValues = "messages"
+ /**
+ * Compact message tracing.
+ */
+
+ Compact TraceValues = "compact"
+ /**
+ * Verbose message tracing.
+ */
+
+ Verbose TraceValues = "verbose"
+ /**
* The moniker is only unique inside a document
*/
+
Document UniquenessLevel = "document"
/**
* The moniker is unique inside a project for which a dump got created
*/
+
Project UniquenessLevel = "project"
/**
* The moniker is unique inside the group to which a project belongs
*/
+
Group UniquenessLevel = "group"
/**
* The moniker is unique inside the moniker scheme.
*/
+
Scheme UniquenessLevel = "scheme"
/**
* The moniker is globally unique
*/
+
Global UniquenessLevel = "global"
/**
* Interested in create events.
@@ -6428,323 +6958,22 @@
ConfigurationParams
PartialResultParams
}
-type ParamInitialize struct {
- InitializeParams
- WorkDoneProgressParams
-}
-type PrepareRename2Gn struct {
+type PrepareRename1Gn struct {
Range Range `json:"range"`
Placeholder string `json:"placeholder"`
}
-type Workspace3Gn struct {
+type Workspace2Gn struct {
/**
- * The client supports applying batch edits
- * to the workspace by supporting the request
- * 'workspace/applyEdit'
- */
- ApplyEdit bool `json:"applyEdit,omitempty"`
-
- /**
- * Capabilities specific to `WorkspaceEdit`s
- */
- WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/didChangeConfiguration` notification.
- */
- DidChangeConfiguration DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
- */
- DidChangeWatchedFiles DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/symbol` request.
- */
- Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/executeCommand` request.
- */
- ExecuteCommand ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
-
- /**
- * Capabilities specific to the semantic token requests scoped to the
- * workspace.
- *
- * @since 3.16.0.
- */
- SemanticTokens SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`
-
- /**
- * Capabilities specific to the code lens requests scoped to the
- * workspace.
- *
- * @since 3.16.0.
- */
- CodeLens CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
-
- /**
- * The client has support for file notifications/requests for user operations on files.
- *
- * Since 3.16.0
- */
- FileOperations *FileOperationClientCapabilities `json:"fileOperations,omitempty"`
-
- /**
- * Capabilities specific to the inline values requests scoped to the
- * workspace.
- *
- * @since 3.17.0.
- */
- InlineValue InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
-
- /**
- * Capabilities specific to the inlay hints requests scoped to the
- * workspace.
- *
- * @since 3.17.0.
- */
- InlayHint InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitempty"`
-
- /**
- * The client has support for workspace folders
+ * The server supports workspace folder.
*
* @since 3.6.0
*/
- WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
+ WorkspaceFolders *WorkspaceFoldersServerCapabilities `json:"workspaceFolders,omitempty"`
/**
- * The client supports `workspace/configuration` requests.
- *
- * @since 3.6.0
- */
- Configuration bool `json:"configuration,omitempty"`
-}
-type Workspace4Gn struct {
- /**
- * The client supports applying batch edits
- * to the workspace by supporting the request
- * 'workspace/applyEdit'
- */
- ApplyEdit bool `json:"applyEdit,omitempty"`
-
- /**
- * Capabilities specific to `WorkspaceEdit`s
- */
- WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/didChangeConfiguration` notification.
- */
- DidChangeConfiguration DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
- */
- DidChangeWatchedFiles DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/symbol` request.
- */
- Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/executeCommand` request.
- */
- ExecuteCommand ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
-
- /**
- * Capabilities specific to the semantic token requests scoped to the
- * workspace.
- *
- * @since 3.16.0.
- */
- SemanticTokens SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`
-
- /**
- * Capabilities specific to the code lens requests scoped to the
- * workspace.
- *
- * @since 3.16.0.
- */
- CodeLens CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
-
- /**
- * The client has support for file notifications/requests for user operations on files.
- *
- * Since 3.16.0
- */
- FileOperations *FileOperationClientCapabilities `json:"fileOperations,omitempty"`
-
- /**
- * Capabilities specific to the inline values requests scoped to the
- * workspace.
- *
- * @since 3.17.0.
- */
- InlineValue InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
-
- /**
- * Capabilities specific to the inlay hints requests scoped to the
- * workspace.
- *
- * @since 3.17.0.
- */
- InlayHint InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitempty"`
-
- /**
- * The client has support for workspace folders
- *
- * @since 3.6.0
- */
- WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
-
- /**
- * The client supports `workspace/configuration` requests.
- *
- * @since 3.6.0
- */
- Configuration bool `json:"configuration,omitempty"`
-}
-type WorkspaceFolders5Gn struct {
- /**
- * The Server has support for workspace folders
- */
- Supported bool `json:"supported,omitempty"`
-
- /**
- * 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 registered 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"`
-}
-type Workspace6Gn struct {
- /**
* The server is interested in notifications/requests for operations on files.
*
* @since 3.16.0
*/
FileOperations *FileOperationOptions `json:"fileOperations,omitempty"`
-
- WorkspaceFolders WorkspaceFolders5Gn `json:"workspaceFolders,omitempty"`
-}
-type Workspace7Gn struct {
- /**
- * The client supports applying batch edits
- * to the workspace by supporting the request
- * 'workspace/applyEdit'
- */
- ApplyEdit bool `json:"applyEdit,omitempty"`
-
- /**
- * Capabilities specific to `WorkspaceEdit`s
- */
- WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/didChangeConfiguration` notification.
- */
- DidChangeConfiguration DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
- */
- DidChangeWatchedFiles DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/symbol` request.
- */
- Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`
-
- /**
- * Capabilities specific to the `workspace/executeCommand` request.
- */
- ExecuteCommand ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
-
- /**
- * Capabilities specific to the semantic token requests scoped to the
- * workspace.
- *
- * @since 3.16.0.
- */
- SemanticTokens SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`
-
- /**
- * Capabilities specific to the code lens requests scoped to the
- * workspace.
- *
- * @since 3.16.0.
- */
- CodeLens CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
-
- /**
- * The client has support for file notifications/requests for user operations on files.
- *
- * Since 3.16.0
- */
- FileOperations *FileOperationClientCapabilities `json:"fileOperations,omitempty"`
-
- /**
- * Capabilities specific to the inline values requests scoped to the
- * workspace.
- *
- * @since 3.17.0.
- */
- InlineValue InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
-
- /**
- * Capabilities specific to the inlay hints requests scoped to the
- * workspace.
- *
- * @since 3.17.0.
- */
- InlayHint InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitempty"`
-
- /**
- * The client has support for workspace folders
- *
- * @since 3.6.0
- */
- WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
-
- /**
- * The client supports `workspace/configuration` requests.
- *
- * @since 3.6.0
- */
- Configuration bool `json:"configuration,omitempty"`
-}
-type WorkspaceFolders8Gn struct {
- /**
- * The Server has support for workspace folders
- */
- Supported bool `json:"supported,omitempty"`
-
- /**
- * 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 registered 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"`
-}
-type Workspace9Gn struct {
- /**
- * The server is interested in notifications/requests for operations on files.
- *
- * @since 3.16.0
- */
- FileOperations *FileOperationOptions `json:"fileOperations,omitempty"`
-
- WorkspaceFolders WorkspaceFolders8Gn `json:"workspaceFolders,omitempty"`
}
diff --git a/internal/lsp/protocol/tsserver.go b/internal/lsp/protocol/tsserver.go
index a26e50c..a3d89f9 100644
--- a/internal/lsp/protocol/tsserver.go
+++ b/internal/lsp/protocol/tsserver.go
@@ -8,8 +8,8 @@
// Package protocol contains data types and code for LSP json rpcs
// generated automatically from vscode-languageserver-node
-// commit: 696f9285bf849b73745682fdb1c1feac73eb8772
-// last fetched Fri Apr 01 2022 10:53:41 GMT-0400 (Eastern Daylight Time)
+// commit: 2b4ae186b2aeb9cc4d2cf20efb6f27bb50467e59
+// last fetched Wed Jun 22 2022 13:57:16 GMT-0400 (Eastern Daylight Time)
import (
"context"
@@ -25,6 +25,10 @@
DidCreateFiles(context.Context, *CreateFilesParams) error
DidRenameFiles(context.Context, *RenameFilesParams) error
DidDeleteFiles(context.Context, *DeleteFilesParams) error
+ DidOpenNotebookDocument(context.Context, *DidOpenNotebookDocumentParams) error
+ DidChangeNotebookDocument(context.Context, *DidChangeNotebookDocumentParams) error
+ DidSaveNotebookDocument(context.Context, *DidSaveNotebookDocumentParams) error
+ DidCloseNotebookDocument(context.Context, *DidCloseNotebookDocumentParams) error
Initialized(context.Context, *InitializedParams) error
Exit(context.Context) error
DidChangeConfiguration(context.Context, *DidChangeConfigurationParams) error
@@ -34,10 +38,6 @@
DidSave(context.Context, *DidSaveTextDocumentParams) error
WillSave(context.Context, *WillSaveTextDocumentParams) error
DidChangeWatchedFiles(context.Context, *DidChangeWatchedFilesParams) error
- DidOpenNotebookDocument(context.Context, *DidOpenNotebookDocumentParams) error
- DidChangeNotebookDocument(context.Context, *DidChangeNotebookDocumentParams) error
- DidSaveNotebookDocument(context.Context, *DidSaveNotebookDocumentParams) error
- DidCloseNotebookDocument(context.Context, *DidCloseNotebookDocumentParams) error
SetTrace(context.Context, *SetTraceParams) error
LogTrace(context.Context, *LogTraceParams) error
Implementation(context.Context, *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
@@ -67,7 +67,10 @@
InlayHint(context.Context, *InlayHintParams) ([]InlayHint /*InlayHint[] | null*/, error)
Resolve(context.Context, *InlayHint) (*InlayHint, error)
InlayHintRefresh(context.Context) error
- Initialize(context.Context, *ParamInitialize) (*InitializeResult, error)
+ Diagnostic(context.Context, *string) (*string, error)
+ DiagnosticWorkspace(context.Context, *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error)
+ DiagnosticRefresh(context.Context) error
+ Initialize(context.Context, *InitializeParams) (*InitializeResult, error)
Shutdown(context.Context) error
WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error)
Completion(context.Context, *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error)
@@ -91,11 +94,8 @@
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) (*PrepareRename2Gn /*Range | { range: Range; placeholder: string } | { defaultBehavior: boolean } | null*/, error)
- ExecuteCommand(context.Context, *ExecuteCommandParams) (interface{} /* LSPAny | void | float64*/, error)
- Diagnostic(context.Context, *string) (*string, error)
- DiagnosticWorkspace(context.Context, *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error)
- DiagnosticRefresh(context.Context) error
+ PrepareRename(context.Context, *PrepareRenameParams) (*PrepareRename1Gn /*{ range: Range; placeholder: string }*/, error)
+ ExecuteCommand(context.Context, *ExecuteCommandParams) (LSPAny /*LSPAny | null*/, error)
NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)
}
@@ -136,6 +136,34 @@
}
err := server.DidDeleteFiles(ctx, ¶ms)
return true, reply(ctx, nil, err)
+ case "notebookDocument/didOpen": // notif
+ var params DidOpenNotebookDocumentParams
+ if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
+ return true, sendParseError(ctx, reply, err)
+ }
+ err := server.DidOpenNotebookDocument(ctx, ¶ms)
+ return true, reply(ctx, nil, err)
+ case "notebookDocument/didChange": // notif
+ var params DidChangeNotebookDocumentParams
+ if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
+ return true, sendParseError(ctx, reply, err)
+ }
+ err := server.DidChangeNotebookDocument(ctx, ¶ms)
+ return true, reply(ctx, nil, err)
+ case "notebookDocument/didSave": // notif
+ var params DidSaveNotebookDocumentParams
+ if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
+ return true, sendParseError(ctx, reply, err)
+ }
+ err := server.DidSaveNotebookDocument(ctx, ¶ms)
+ return true, reply(ctx, nil, err)
+ case "notebookDocument/didClose": // notif
+ var params DidCloseNotebookDocumentParams
+ if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
+ return true, sendParseError(ctx, reply, err)
+ }
+ err := server.DidCloseNotebookDocument(ctx, ¶ms)
+ return true, reply(ctx, nil, err)
case "initialized": // notif
var params InitializedParams
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
@@ -195,34 +223,6 @@
}
err := server.DidChangeWatchedFiles(ctx, ¶ms)
return true, reply(ctx, nil, err)
- case "notebookDocument/didOpen": // notif
- var params DidOpenNotebookDocumentParams
- if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
- return true, sendParseError(ctx, reply, err)
- }
- err := server.DidOpenNotebookDocument(ctx, ¶ms)
- return true, reply(ctx, nil, err)
- case "notebookDocument/didChange": // notif
- var params DidChangeNotebookDocumentParams
- if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
- return true, sendParseError(ctx, reply, err)
- }
- err := server.DidChangeNotebookDocument(ctx, ¶ms)
- return true, reply(ctx, nil, err)
- case "notebookDocument/didSave": // notif
- var params DidSaveNotebookDocumentParams
- if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
- return true, sendParseError(ctx, reply, err)
- }
- err := server.DidSaveNotebookDocument(ctx, ¶ms)
- return true, reply(ctx, nil, err)
- case "notebookDocument/didClose": // notif
- var params DidCloseNotebookDocumentParams
- if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
- return true, sendParseError(ctx, reply, err)
- }
- err := server.DidCloseNotebookDocument(ctx, ¶ms)
- return true, reply(ctx, nil, err)
case "$/setTrace": // notif
var params SetTraceParams
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
@@ -495,8 +495,34 @@
}
err := server.InlayHintRefresh(ctx)
return true, reply(ctx, nil, err)
+ case "textDocument/diagnostic": // req
+ var params string
+ if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
+ return true, sendParseError(ctx, reply, err)
+ }
+ resp, err := server.Diagnostic(ctx, ¶ms)
+ if err != nil {
+ return true, reply(ctx, nil, err)
+ }
+ return true, reply(ctx, resp, nil)
+ case "workspace/diagnostic": // req
+ var params WorkspaceDiagnosticParams
+ if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
+ return true, sendParseError(ctx, reply, err)
+ }
+ resp, err := server.DiagnosticWorkspace(ctx, ¶ms)
+ if err != nil {
+ return true, reply(ctx, nil, err)
+ }
+ return true, reply(ctx, resp, nil)
+ case "workspace/diagnostic/refresh": // req
+ if len(r.Params()) > 0 {
+ return true, reply(ctx, nil, fmt.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
+ }
+ err := server.DiagnosticRefresh(ctx)
+ return true, reply(ctx, nil, err)
case "initialize": // req
- var params ParamInitialize
+ var params InitializeParams
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
if _, ok := err.(*json.UnmarshalTypeError); !ok {
return true, sendParseError(ctx, reply, err)
@@ -749,32 +775,6 @@
return true, reply(ctx, nil, err)
}
return true, reply(ctx, resp, nil)
- case "textDocument/diagnostic": // req
- var params string
- if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
- return true, sendParseError(ctx, reply, err)
- }
- resp, err := server.Diagnostic(ctx, ¶ms)
- if err != nil {
- return true, reply(ctx, nil, err)
- }
- return true, reply(ctx, resp, nil)
- case "workspace/diagnostic": // req
- var params WorkspaceDiagnosticParams
- if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
- return true, sendParseError(ctx, reply, err)
- }
- resp, err := server.DiagnosticWorkspace(ctx, ¶ms)
- if err != nil {
- return true, reply(ctx, nil, err)
- }
- return true, reply(ctx, resp, nil)
- case "workspace/diagnostic/refresh": // req
- if len(r.Params()) > 0 {
- return true, reply(ctx, nil, fmt.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
- }
- err := server.DiagnosticRefresh(ctx)
- return true, reply(ctx, nil, err)
default:
return false, nil
@@ -801,6 +801,22 @@
return s.sender.Notify(ctx, "workspace/didDeleteFiles", params)
}
+func (s *serverDispatcher) DidOpenNotebookDocument(ctx context.Context, params *DidOpenNotebookDocumentParams) error {
+ return s.sender.Notify(ctx, "notebookDocument/didOpen", params)
+}
+
+func (s *serverDispatcher) DidChangeNotebookDocument(ctx context.Context, params *DidChangeNotebookDocumentParams) error {
+ return s.sender.Notify(ctx, "notebookDocument/didChange", params)
+}
+
+func (s *serverDispatcher) DidSaveNotebookDocument(ctx context.Context, params *DidSaveNotebookDocumentParams) error {
+ return s.sender.Notify(ctx, "notebookDocument/didSave", params)
+}
+
+func (s *serverDispatcher) DidCloseNotebookDocument(ctx context.Context, params *DidCloseNotebookDocumentParams) error {
+ return s.sender.Notify(ctx, "notebookDocument/didClose", params)
+}
+
func (s *serverDispatcher) Initialized(ctx context.Context, params *InitializedParams) error {
return s.sender.Notify(ctx, "initialized", params)
}
@@ -837,22 +853,6 @@
return s.sender.Notify(ctx, "workspace/didChangeWatchedFiles", params)
}
-func (s *serverDispatcher) DidOpenNotebookDocument(ctx context.Context, params *DidOpenNotebookDocumentParams) error {
- return s.sender.Notify(ctx, "notebookDocument/didOpen", params)
-}
-
-func (s *serverDispatcher) DidChangeNotebookDocument(ctx context.Context, params *DidChangeNotebookDocumentParams) error {
- return s.sender.Notify(ctx, "notebookDocument/didChange", params)
-}
-
-func (s *serverDispatcher) DidSaveNotebookDocument(ctx context.Context, params *DidSaveNotebookDocumentParams) error {
- return s.sender.Notify(ctx, "notebookDocument/didSave", params)
-}
-
-func (s *serverDispatcher) DidCloseNotebookDocument(ctx context.Context, params *DidCloseNotebookDocumentParams) error {
- return s.sender.Notify(ctx, "notebookDocument/didClose", params)
-}
-
func (s *serverDispatcher) SetTrace(ctx context.Context, params *SetTraceParams) error {
return s.sender.Notify(ctx, "$/setTrace", params)
}
@@ -1064,7 +1064,27 @@
return s.sender.Call(ctx, "workspace/inlayHint/refresh", nil, nil)
}
-func (s *serverDispatcher) Initialize(ctx context.Context, params *ParamInitialize) (*InitializeResult, error) {
+func (s *serverDispatcher) Diagnostic(ctx context.Context, params *string) (*string, error) {
+ var result *string
+ if err := s.sender.Call(ctx, "textDocument/diagnostic", params, &result); err != nil {
+ return nil, err
+ }
+ return result, nil
+}
+
+func (s *serverDispatcher) DiagnosticWorkspace(ctx context.Context, params *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error) {
+ var result *WorkspaceDiagnosticReport
+ if err := s.sender.Call(ctx, "workspace/diagnostic", params, &result); err != nil {
+ return nil, err
+ }
+ return result, nil
+}
+
+func (s *serverDispatcher) DiagnosticRefresh(ctx context.Context) error {
+ return s.sender.Call(ctx, "workspace/diagnostic/refresh", nil, nil)
+}
+
+func (s *serverDispatcher) Initialize(ctx context.Context, params *InitializeParams) (*InitializeResult, error) {
var result *InitializeResult
if err := s.sender.Call(ctx, "initialize", params, &result); err != nil {
return nil, err
@@ -1248,42 +1268,22 @@
return result, nil
}
-func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (*PrepareRename2Gn /*Range | { range: Range; placeholder: string } | { defaultBehavior: boolean } | null*/, error) {
- var result *PrepareRename2Gn /*Range | { range: Range; placeholder: string } | { defaultBehavior: boolean } | null*/
+func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (*PrepareRename1Gn /*{ range: Range; placeholder: string }*/, error) {
+ var result *PrepareRename1Gn /*{ range: Range; placeholder: string }*/
if err := s.sender.Call(ctx, "textDocument/prepareRename", params, &result); err != nil {
return nil, err
}
return result, nil
}
-func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (interface{} /* LSPAny | void | float64*/, error) {
- var result interface{} /* LSPAny | void | float64*/
+func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (LSPAny /*LSPAny | null*/, error) {
+ var result LSPAny /*LSPAny | null*/
if err := s.sender.Call(ctx, "workspace/executeCommand", params, &result); err != nil {
return nil, err
}
return result, nil
}
-func (s *serverDispatcher) Diagnostic(ctx context.Context, params *string) (*string, error) {
- var result *string
- if err := s.sender.Call(ctx, "textDocument/diagnostic", params, &result); err != nil {
- return nil, err
- }
- return result, nil
-}
-
-func (s *serverDispatcher) DiagnosticWorkspace(ctx context.Context, params *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error) {
- var result *WorkspaceDiagnosticReport
- if err := s.sender.Call(ctx, "workspace/diagnostic", params, &result); err != nil {
- return nil, err
- }
- return result, nil
-}
-
-func (s *serverDispatcher) DiagnosticRefresh(ctx context.Context) error {
- return s.sender.Call(ctx, "workspace/diagnostic/refresh", nil, nil)
-}
-
func (s *serverDispatcher) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error) {
var result interface{}
if err := s.sender.Call(ctx, method, params, &result); err != nil {
diff --git a/internal/lsp/protocol/typescript/code.ts b/internal/lsp/protocol/typescript/code.ts
index 1eefa55..7cf9a88 100644
--- a/internal/lsp/protocol/typescript/code.ts
+++ b/internal/lsp/protocol/typescript/code.ts
@@ -390,6 +390,13 @@
case 'CodeActionKind':
case 'Integer':
case 'Uinteger':
+ case 'WatchKind':
+ case 'PositionEncodingKind':
+ case 'InitializeErrorCodes':
+ case 'LSPErrorCodes':
+ case 'FoldingRangeKind':
+ case 'TraceValues':
+ case 'ErrorCodes':
case 'Decimal':
// want the Module, if anything
return a.statements.length > 0 ? a : b;
@@ -462,7 +469,7 @@
underlying(n.type, f);
} else if (
ts.isLiteralTypeNode(n) || ts.isVariableStatement(n) ||
- ts.isTupleTypeNode(n)) {
+ ts.isTupleTypeNode(n) || ts.isTypeQueryNode(n) ) {
// we only see these in moreTypes, but they are handled elsewhere
} else if (ts.isEnumMember(n)) {
if (ts.isStringLiteral(n.initializer)) return;
@@ -482,7 +489,8 @@
};
rpcTypes.forEach(extra); // all the types needed by the rpcs
// needed in enums.go (or elsewhere)
- extra('InitializeError');
+ extra('InitializeErrorCodes');
+ extra('DocumentDiagnosticReportKind');
extra('WatchKind');
extra('FoldingRangeKind');
// not sure why these weren't picked up
@@ -677,7 +685,7 @@
// generate Go types
function toGo(d: Data, nm: string) {
if (!d) return; // this is probably a generic T
- if (d.name.startsWith('Inner') || d.name === 'WindowClientCapabilities') return; // removed by alias processing
+ if (d.name.startsWith('Inner')) return; // removed by alias processing
if (d.name === 'Integer' || d.name === 'Uinteger') return; // unneeded
switch (d.kind) {
case 'alias':
@@ -853,10 +861,15 @@
// these are anonymous structs
const v = goTypeLiteral(n, nm);
return v;
+ } else if (ts.isTypeQueryNode(n) && ts.isQualifiedName(n.exprName)) {
+ // Currently we only us the typeof operator to get to the type of a enum
+ // value expressed by an or type (e.g. kind: typeof DocumentDiagnosticReportKind.full)
+ // So we assume a qualifed name and turn it into a string literal type
+ return n.exprName.left.getText()
} else if (ts.isTupleTypeNode(n)) {
if (n.getText() == '[number, number]') return '[]float64';
throw new Error(`goType unexpected Tuple ${n.getText()}`);
- }
+ }
throw new Error(`${strKind(n)} goType unexpected ${n.getText()} for ${nm}`);
}
@@ -887,6 +900,13 @@
// (Command | CodeAction)[] | null
return `[]CodeAction ${help}`;
}
+ if (nm == 'textDocument/prepareRename') {
+ // these names have to be made unique
+ const genName = `${goName("prepareRename")}${extraTypes.size}Gn`;
+ extraTypes.set(genName, [`Range Range \`json:"range"\`
+ Placeholder string \`json:"placeholder"\``]);
+ return `${genName} /*{ range: Range; placeholder: string }*/`;
+ }
let v = goType(n.types[0], 'a');
return `${v} ${help}`;
}
@@ -917,6 +937,7 @@
// the first one includes the second one
return `${goType(n.types[0], '9d')}`;
}
+
throw new Error(`911 ${nm}: a:${a}/${goType(n.types[0], '9a')} b:${b}/${goType(n.types[1], '9b')} ${loc(n)}`);
}
case 3: {
@@ -950,14 +971,6 @@
}
case 4:
if (nm == 'documentChanges') return `TextDocumentEdit ${help} `;
- if (nm == 'textDocument/prepareRename') {
- // these names have to be made unique
- const genName = `${goName("prepareRename")}${extraTypes.size}Gn`;
- extraTypes.set(genName, [`Range Range \`json:"range"\`
- Placeholder string \`json:"placeholder"\``]);
- return `${genName} ${help} `;
- }
- break;
case 8: // LSPany
break;
default:
@@ -1062,6 +1075,7 @@
return false;
case 'TypeLiteral': return false; // true makes for difficult compound constants
// but think more carefully to understands why starred is needed.
+ case 'TypeQuery': return true
case 'TypeReference': {
if (!ts.isTypeReferenceNode(te)) throw new Error(`1047 impossible ${strKind(te)}`);
const d = seenTypes.get(goName(te.typeName.getText()));
@@ -1137,7 +1151,7 @@
v.sort();
v.forEach((x) => toGo(seenTypes.get(x), x));
u.prgo(u.computeHeader(true));
- u.prgo('import "encoding/json"\n\n');
+ u.prgo('\nimport "encoding/json"\n\n');
typesOut.forEach((s) => {
u.prgo(s);
// it's more convenient not to have to think about trailing newlines
@@ -1243,7 +1257,7 @@
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
return true, sendParseError(ctx, reply, err)
}`;
- if (a === 'ParamInitialize') {
+ if (a === 'InitializeParams') {
case1 = `var params ${a}
if err := json.Unmarshal(r.Params(), ¶ms); err != nil {
if _, ok := err.(*json.UnmarshalTypeError); !ok {
@@ -1300,7 +1314,7 @@
let prefix = x.substring(0, j);
x = prefix + suffix;
}
- if (seenNames.has(x)) {
+ if (seenNames.has(x) || (m.substring(0,i) !== 'textDocument' && (x === 'DidChange' || x === 'DidOpen' || x === 'DidSave' || x === 'DidClose'))) {
// various Resolve and Diagnostic
x += m[0].toUpperCase() + m.substring(1, i);
}
@@ -1313,7 +1327,7 @@
if (s == '' || s == 'void') return false;
const skip = (x: string) => s.startsWith(x);
if (skip('[]') || skip('interface') || skip('Declaration') ||
- skip('Definition') || skip('DocumentSelector'))
+ skip('Definition') || skip('DocumentSelector') || skip('LSPAny'))
return false;
return true;
}
@@ -1362,6 +1376,7 @@
import (
"context"
"encoding/json"
+ "fmt"
"golang.org/x/tools/internal/jsonrpc2"
)
diff --git a/internal/lsp/protocol/typescript/util.ts b/internal/lsp/protocol/typescript/util.ts
index 9475b26..138ef1e 100644
--- a/internal/lsp/protocol/typescript/util.ts
+++ b/internal/lsp/protocol/typescript/util.ts
@@ -15,7 +15,7 @@
`${dir}/${srcDir}/protocol/src/browser/main.ts`, `${dir}${srcDir}/types/src/main.ts`,
`${dir}${srcDir}/jsonrpc/src/node/main.ts`
];
-export const gitHash = '696f9285bf849b73745682fdb1c1feac73eb8772';
+export const gitHash = '2b4ae186b2aeb9cc4d2cf20efb6f27bb50467e59';
let outFname = 'tsprotocol.go';
let fda: number, fdb: number, fde: number; // file descriptors
@@ -93,7 +93,13 @@
// in the end, none of these are emitted.
ans = 'Inner' + s.substring(1);
}
- else { ans = s.substring(0, 1).toUpperCase() + s.substring(1); }
+ else {
+ if (s.charAt(0) == '$') {
+ // This happens for special keywords like import and export.
+ s = s.substring(1);
+ }
+ ans = s.substring(0, 1).toUpperCase() + s.substring(1);
+ }
ans = ans.replace(/Uri$/, 'URI');
ans = ans.replace(/Id$/, 'ID');
return ans;
@@ -112,7 +118,8 @@
let pref = new Map<string, string>([
['DiagnosticSeverity', 'Severity'], ['WatchKind', 'Watch'],
['SignatureHelpTriggerKind', 'Sig'], ['CompletionItemTag', 'Compl'],
- ['Integer', 'INT_'], ['Uinteger', 'UINT_'], ['CodeActionTriggerKind', 'CodeAction']
+ ['Integer', 'INT_'], ['Uinteger', 'UINT_'], ['CodeActionTriggerKind', 'CodeAction'],
+ ['DocumentDiagnosticReportKind','DocumentDiagnostic' ],
]); // typeName->prefix
let suff = new Map<string, string>([
['CompletionItemKind', 'Completion'], ['InsertTextFormat', 'TextFormat'],
diff --git a/internal/lsp/rename.go b/internal/lsp/rename.go
index 739ae90..a25d421 100644
--- a/internal/lsp/rename.go
+++ b/internal/lsp/rename.go
@@ -35,7 +35,7 @@
}, nil
}
-func (s *Server) prepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.PrepareRename2Gn, error) {
+func (s *Server) prepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.PrepareRename1Gn, error) {
snapshot, fh, ok, release, err := s.beginFileRequest(ctx, params.TextDocument.URI, source.Go)
defer release()
if !ok {
@@ -49,7 +49,7 @@
// internal error details.
return nil, usererr
}
- return &protocol.PrepareRename2Gn{
+ return &protocol.PrepareRename1Gn{
Range: item.Range,
Placeholder: item.Text,
}, nil
diff --git a/internal/lsp/server.go b/internal/lsp/server.go
index fb820cc..7d525b2 100644
--- a/internal/lsp/server.go
+++ b/internal/lsp/server.go
@@ -123,7 +123,7 @@
changes []source.FileModification
}
-func (s *Server) workDoneProgressCancel(params *protocol.WorkDoneProgressCancelParams) error {
+func (s *Server) workDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) error {
return s.progress.Cancel(params.Token)
}
diff --git a/internal/lsp/server_gen.go b/internal/lsp/server_gen.go
index 4e9db0e..09ec646 100644
--- a/internal/lsp/server_gen.go
+++ b/internal/lsp/server_gen.go
@@ -124,7 +124,7 @@
return s.documentSymbol(ctx, params)
}
-func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (interface{}, error) {
+func (s *Server) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (protocol.LSPAny, error) {
return s.executeCommand(ctx, params)
}
@@ -152,7 +152,7 @@
return s.incomingCalls(ctx, params)
}
-func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitialize) (*protocol.InitializeResult, error) {
+func (s *Server) Initialize(ctx context.Context, params *protocol.InitializeParams) (*protocol.InitializeResult, error) {
return s.initialize(ctx, params)
}
@@ -204,7 +204,7 @@
return s.prepareCallHierarchy(ctx, params)
}
-func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.PrepareRename2Gn, error) {
+func (s *Server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.PrepareRename1Gn, error) {
return s.prepareRename(ctx, params)
}
@@ -317,5 +317,5 @@
}
func (s *Server) WorkDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) error {
- return s.workDoneProgressCancel(params)
+ return s.workDoneProgressCancel(ctx, params)
}
diff --git a/internal/lsp/source/workspace_symbol.go b/internal/lsp/source/workspace_symbol.go
index c7cfe5c..357b0bc 100644
--- a/internal/lsp/source/workspace_symbol.go
+++ b/internal/lsp/source/workspace_symbol.go
@@ -555,12 +555,14 @@
// TODO: work out how to handle tags if/when they are needed.
func (s symbolInformation) asProtocolSymbolInformation() protocol.SymbolInformation {
return protocol.SymbolInformation{
- Name: s.symbol,
- Kind: s.kind,
+ BaseSymbolInformation: protocol.BaseSymbolInformation{
+ Name: s.symbol,
+ Kind: s.kind,
+ ContainerName: s.container,
+ },
Location: protocol.Location{
URI: protocol.URIFromSpanURI(s.uri),
Range: s.rng,
},
- ContainerName: s.container,
}
}
diff --git a/internal/lsp/symbols.go b/internal/lsp/symbols.go
index f04e457..8d6fa4f 100644
--- a/internal/lsp/symbols.go
+++ b/internal/lsp/symbols.go
@@ -44,8 +44,10 @@
// If the client does not support hierarchical document symbols, then
// we need to be backwards compatible for now and return SymbolInformation.
symbols[i] = protocol.SymbolInformation{
- Name: s.Name,
- Kind: s.Kind,
+ BaseSymbolInformation: protocol.BaseSymbolInformation{
+ Name: s.Name,
+ Kind: s.Kind,
+ },
Deprecated: s.Deprecated,
Location: protocol.Location{
URI: params.TextDocument.URI,
diff --git a/internal/lsp/tests/tests.go b/internal/lsp/tests/tests.go
index ec804e5..f534ed6 100644
--- a/internal/lsp/tests/tests.go
+++ b/internal/lsp/tests/tests.go
@@ -1362,8 +1362,10 @@
// Reuse @symbol in the workspace symbols tests.
si := protocol.SymbolInformation{
- Name: siName,
- Kind: sym.Kind,
+ BaseSymbolInformation: protocol.BaseSymbolInformation{
+ Name: siName,
+ Kind: sym.Kind,
+ },
Location: protocol.Location{
URI: protocol.URIFromSpanURI(spn.URI()),
Range: sym.SelectionRange,
To view, visit change 413675. To unsubscribe, or for help writing mail filters, visit settings.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/bcf825ae-5935-4e7f-aaf9-e6284f4a6451
Patch set 1:gopls-CI +1
Attention is currently required from: Suzy Mueller.
Suzy Mueller uploaded patch set #2 to this change.
The following approvals got outdated and were removed: Run-TryBot+1 by Suzy Mueller, TryBot-Result+1 by Gopher Robot, gopls-CI+1 by kokoro
24 files changed, 1,127 insertions(+), 855 deletions(-)
To view, visit change 413675. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Suzy Mueller.
Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/ea99e4f5-2276-40b1-86f5-dafd92d72692
Patch set 2:gopls-CI +1
Suzy Mueller abandoned this change.
To view, visit change 413675. To unsubscribe, or for help writing mail filters, visit settings.