From 9646943c1d88ac0d0da42100fa2560449c7137c2 Mon Sep 17 00:00:00 2001 From: Myles Hyson Date: Tue, 27 May 2025 14:10:13 -0700 Subject: [PATCH] add some helpful utils for decoding a jsonrpc message into a protocol message struct. fix interface bindings --- lspgenerator/go/go_generator.py | 2 + lspgenerator/go/notifications.py | 4 +- lspgenerator/go/registry.py | 49 +++ lspgenerator/go/requests.py | 8 +- protocol/registry.go | 671 +++++++++++++++++++++++++++++ protocol/types.go | 708 +++++++++++++++---------------- protocol/utils.go | 93 ++++ protocol/utils_test.go | 39 ++ 8 files changed, 1214 insertions(+), 360 deletions(-) create mode 100644 lspgenerator/go/registry.py create mode 100644 protocol/registry.go create mode 100644 protocol/utils.go create mode 100644 protocol/utils_test.go diff --git a/lspgenerator/go/go_generator.py b/lspgenerator/go/go_generator.py index cd1b963..8ebb404 100644 --- a/lspgenerator/go/go_generator.py +++ b/lspgenerator/go/go_generator.py @@ -8,6 +8,7 @@ from .enums import generate_enums from .notifications import generate_notifications from .or_types import generate_or_types +from .registry import generate_registry from .requests import generate_requests from .structs import generate_structs from .tests import generate_tests @@ -40,6 +41,7 @@ def generate_from_spec( + or_types, ), "types_test.go": generate_tests(spec), + "registry.go": generate_registry(spec), } output_path = pathlib.Path(output_dir) test_path = pathlib.Path(test_dir) diff --git a/lspgenerator/go/notifications.py b/lspgenerator/go/notifications.py index 5617fde..4d4f7e7 100644 --- a/lspgenerator/go/notifications.py +++ b/lspgenerator/go/notifications.py @@ -46,9 +46,9 @@ def generate_notifications( f'\tParams {param_type} `json:"params"`', ] struct.append("}") - struct.append(f"func (t *{notification.typeName}) isMessage() {{}}") + struct.append(f"func (t {notification.typeName}) isMessage() {{}}") struct.append( - f"func (t *{notification.typeName}) isNotification() {{}}" + f"func (t {notification.typeName}) isNotification() {{}}", ) struct += [ f"func (t *{notification.typeName}) UnmarshalJSON(x []byte) error {{", diff --git a/lspgenerator/go/registry.py b/lspgenerator/go/registry.py new file mode 100644 index 0000000..24bcd98 --- /dev/null +++ b/lspgenerator/go/registry.py @@ -0,0 +1,49 @@ +from generator import model + +from .utils import join + + +def generate_registry(spec: model.LSPModel) -> str: + result = [ + "package protocol", + "import (", + ' "encoding/json"', + ")", + "var MessageRegistry = map[string]func([]byte) (Message, error) {", + ] + + result.extend( + [ + join( + [ + f' "{request.method}": func(data []byte) (Message, error) {{', + f" var message {request.typeName}", + " if err := json.Unmarshal(data, &message); err != nil {", + " return nil, err", + " }", + " return message, nil", + " },", + ], + ) + for request in spec.requests + ], + ) + result.extend( + [ + join( + [ + f' "{notification.method}": func(data []byte) (Message, error) {{', + f" var message {notification.typeName}", + " if err := json.Unmarshal(data, &message); err != nil {", + " return nil, err", + " }", + " return message, nil", + " },", + ], + ) + for notification in spec.notifications + ], + ) + result.append("}") + + return join(result) diff --git a/lspgenerator/go/requests.py b/lspgenerator/go/requests.py index 3132e5c..aa68bf1 100644 --- a/lspgenerator/go/requests.py +++ b/lspgenerator/go/requests.py @@ -50,8 +50,8 @@ def generate_requests( ] struct.append("}") - struct.append(f"func (t *{request.typeName}) isMessage() {{}}") - struct.append(f"func (t *{request.typeName}) isRequest() {{}}") + struct.append(f"func (t {request.typeName}) isMessage() {{}}") + struct.append(f"func (t {request.typeName}) isRequest() {{}}") struct += [ f"func (t *{request.typeName}) UnmarshalJSON(x []byte) error {{", " var m map[string]any", @@ -119,7 +119,7 @@ def generate_requests( " return nil", "}", ] - struct.append(f"func (t *{response_name}) isMessage() {{}}") - struct.append(f"func (t *{response_name}) isResponse() {{}}") + struct.append(f"func (t {response_name}) isMessage() {{}}") + struct.append(f"func (t {response_name}) isResponse() {{}}") result.append(join(struct)) return result diff --git a/protocol/registry.go b/protocol/registry.go new file mode 100644 index 0000000..0fe7a2d --- /dev/null +++ b/protocol/registry.go @@ -0,0 +1,671 @@ +package protocol +import ( + "encoding/json" +) +var MessageRegistry = map[string]func([]byte) (Message, error) { + "textDocument/implementation": func(data []byte) (Message, error) { + var message ImplementationRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/typeDefinition": func(data []byte) (Message, error) { + var message TypeDefinitionRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/workspaceFolders": func(data []byte) (Message, error) { + var message WorkspaceFoldersRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/configuration": func(data []byte) (Message, error) { + var message ConfigurationRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/documentColor": func(data []byte) (Message, error) { + var message DocumentColorRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/colorPresentation": func(data []byte) (Message, error) { + var message ColorPresentationRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/foldingRange": func(data []byte) (Message, error) { + var message FoldingRangeRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/foldingRange/refresh": func(data []byte) (Message, error) { + var message FoldingRangeRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/declaration": func(data []byte) (Message, error) { + var message DeclarationRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/selectionRange": func(data []byte) (Message, error) { + var message SelectionRangeRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "window/workDoneProgress/create": func(data []byte) (Message, error) { + var message WorkDoneProgressCreateRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/prepareCallHierarchy": func(data []byte) (Message, error) { + var message CallHierarchyPrepareRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "callHierarchy/incomingCalls": func(data []byte) (Message, error) { + var message CallHierarchyIncomingCallsRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "callHierarchy/outgoingCalls": func(data []byte) (Message, error) { + var message CallHierarchyOutgoingCallsRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/semanticTokens/full": func(data []byte) (Message, error) { + var message SemanticTokensRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/semanticTokens/full/delta": func(data []byte) (Message, error) { + var message SemanticTokensDeltaRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/semanticTokens/range": func(data []byte) (Message, error) { + var message SemanticTokensRangeRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/semanticTokens/refresh": func(data []byte) (Message, error) { + var message SemanticTokensRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "window/showDocument": func(data []byte) (Message, error) { + var message ShowDocumentRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/linkedEditingRange": func(data []byte) (Message, error) { + var message LinkedEditingRangeRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/willCreateFiles": func(data []byte) (Message, error) { + var message WillCreateFilesRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/willRenameFiles": func(data []byte) (Message, error) { + var message WillRenameFilesRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/willDeleteFiles": func(data []byte) (Message, error) { + var message WillDeleteFilesRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/moniker": func(data []byte) (Message, error) { + var message MonikerRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/prepareTypeHierarchy": func(data []byte) (Message, error) { + var message TypeHierarchyPrepareRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "typeHierarchy/supertypes": func(data []byte) (Message, error) { + var message TypeHierarchySupertypesRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "typeHierarchy/subtypes": func(data []byte) (Message, error) { + var message TypeHierarchySubtypesRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/inlineValue": func(data []byte) (Message, error) { + var message InlineValueRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/inlineValue/refresh": func(data []byte) (Message, error) { + var message InlineValueRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/inlayHint": func(data []byte) (Message, error) { + var message InlayHintRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "inlayHint/resolve": func(data []byte) (Message, error) { + var message InlayHintResolveRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/inlayHint/refresh": func(data []byte) (Message, error) { + var message InlayHintRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/diagnostic": func(data []byte) (Message, error) { + var message DocumentDiagnosticRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/diagnostic": func(data []byte) (Message, error) { + var message WorkspaceDiagnosticRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/diagnostic/refresh": func(data []byte) (Message, error) { + var message DiagnosticRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/inlineCompletion": func(data []byte) (Message, error) { + var message InlineCompletionRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/textDocumentContent": func(data []byte) (Message, error) { + var message TextDocumentContentRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/textDocumentContent/refresh": func(data []byte) (Message, error) { + var message TextDocumentContentRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "client/registerCapability": func(data []byte) (Message, error) { + var message RegistrationRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "client/unregisterCapability": func(data []byte) (Message, error) { + var message UnregistrationRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "initialize": func(data []byte) (Message, error) { + var message InitializeRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "shutdown": func(data []byte) (Message, error) { + var message ShutdownRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "window/showMessageRequest": func(data []byte) (Message, error) { + var message ShowMessageRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/willSaveWaitUntil": func(data []byte) (Message, error) { + var message WillSaveTextDocumentWaitUntilRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/completion": func(data []byte) (Message, error) { + var message CompletionRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "completionItem/resolve": func(data []byte) (Message, error) { + var message CompletionResolveRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/hover": func(data []byte) (Message, error) { + var message HoverRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/signatureHelp": func(data []byte) (Message, error) { + var message SignatureHelpRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/definition": func(data []byte) (Message, error) { + var message DefinitionRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/references": func(data []byte) (Message, error) { + var message ReferencesRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/documentHighlight": func(data []byte) (Message, error) { + var message DocumentHighlightRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/documentSymbol": func(data []byte) (Message, error) { + var message DocumentSymbolRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/codeAction": func(data []byte) (Message, error) { + var message CodeActionRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "codeAction/resolve": func(data []byte) (Message, error) { + var message CodeActionResolveRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/symbol": func(data []byte) (Message, error) { + var message WorkspaceSymbolRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspaceSymbol/resolve": func(data []byte) (Message, error) { + var message WorkspaceSymbolResolveRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/codeLens": func(data []byte) (Message, error) { + var message CodeLensRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "codeLens/resolve": func(data []byte) (Message, error) { + var message CodeLensResolveRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/codeLens/refresh": func(data []byte) (Message, error) { + var message CodeLensRefreshRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/documentLink": func(data []byte) (Message, error) { + var message DocumentLinkRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "documentLink/resolve": func(data []byte) (Message, error) { + var message DocumentLinkResolveRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/formatting": func(data []byte) (Message, error) { + var message DocumentFormattingRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/rangeFormatting": func(data []byte) (Message, error) { + var message DocumentRangeFormattingRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/rangesFormatting": func(data []byte) (Message, error) { + var message DocumentRangesFormattingRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/onTypeFormatting": func(data []byte) (Message, error) { + var message DocumentOnTypeFormattingRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/rename": func(data []byte) (Message, error) { + var message RenameRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/prepareRename": func(data []byte) (Message, error) { + var message PrepareRenameRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/executeCommand": func(data []byte) (Message, error) { + var message ExecuteCommandRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/applyEdit": func(data []byte) (Message, error) { + var message ApplyWorkspaceEditRequest + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/didChangeWorkspaceFolders": func(data []byte) (Message, error) { + var message DidChangeWorkspaceFoldersNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "window/workDoneProgress/cancel": func(data []byte) (Message, error) { + var message WorkDoneProgressCancelNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/didCreateFiles": func(data []byte) (Message, error) { + var message DidCreateFilesNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/didRenameFiles": func(data []byte) (Message, error) { + var message DidRenameFilesNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/didDeleteFiles": func(data []byte) (Message, error) { + var message DidDeleteFilesNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "notebookDocument/didOpen": func(data []byte) (Message, error) { + var message DidOpenNotebookDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "notebookDocument/didChange": func(data []byte) (Message, error) { + var message DidChangeNotebookDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "notebookDocument/didSave": func(data []byte) (Message, error) { + var message DidSaveNotebookDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "notebookDocument/didClose": func(data []byte) (Message, error) { + var message DidCloseNotebookDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "initialized": func(data []byte) (Message, error) { + var message InitializedNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "exit": func(data []byte) (Message, error) { + var message ExitNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/didChangeConfiguration": func(data []byte) (Message, error) { + var message DidChangeConfigurationNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "window/showMessage": func(data []byte) (Message, error) { + var message ShowMessageNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "window/logMessage": func(data []byte) (Message, error) { + var message LogMessageNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "telemetry/event": func(data []byte) (Message, error) { + var message TelemetryEventNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/didOpen": func(data []byte) (Message, error) { + var message DidOpenTextDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/didChange": func(data []byte) (Message, error) { + var message DidChangeTextDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/didClose": func(data []byte) (Message, error) { + var message DidCloseTextDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/didSave": func(data []byte) (Message, error) { + var message DidSaveTextDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/willSave": func(data []byte) (Message, error) { + var message WillSaveTextDocumentNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "workspace/didChangeWatchedFiles": func(data []byte) (Message, error) { + var message DidChangeWatchedFilesNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "textDocument/publishDiagnostics": func(data []byte) (Message, error) { + var message PublishDiagnosticsNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "$/setTrace": func(data []byte) (Message, error) { + var message SetTraceNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "$/logTrace": func(data []byte) (Message, error) { + var message LogTraceNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "$/cancelRequest": func(data []byte) (Message, error) { + var message CancelNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, + "$/progress": func(data []byte) (Message, error) { + var message ProgressNotification + if err := json.Unmarshal(data, &message); err != nil { + return nil, err + } + return message, nil + }, +} \ No newline at end of file diff --git a/protocol/types.go b/protocol/types.go index e05612f..2cc27c8 100644 --- a/protocol/types.go +++ b/protocol/types.go @@ -13200,8 +13200,8 @@ type CallHierarchyIncomingCallsRequest struct { Method RequestMethod `json:"method"` Params CallHierarchyIncomingCallsParams `json:"params"` } -func (t *CallHierarchyIncomingCallsRequest) isMessage() {} -func (t *CallHierarchyIncomingCallsRequest) isRequest() {} +func (t CallHierarchyIncomingCallsRequest) isMessage() {} +func (t CallHierarchyIncomingCallsRequest) isRequest() {} func (t *CallHierarchyIncomingCallsRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13235,8 +13235,8 @@ type CallHierarchyOutgoingCallsRequest struct { Method RequestMethod `json:"method"` Params CallHierarchyOutgoingCallsParams `json:"params"` } -func (t *CallHierarchyOutgoingCallsRequest) isMessage() {} -func (t *CallHierarchyOutgoingCallsRequest) isRequest() {} +func (t CallHierarchyOutgoingCallsRequest) isMessage() {} +func (t CallHierarchyOutgoingCallsRequest) isRequest() {} func (t *CallHierarchyOutgoingCallsRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13269,8 +13269,8 @@ type RegistrationRequest struct { Method RequestMethod `json:"method"` Params RegistrationParams `json:"params"` } -func (t *RegistrationRequest) isMessage() {} -func (t *RegistrationRequest) isRequest() {} +func (t RegistrationRequest) isMessage() {} +func (t RegistrationRequest) isRequest() {} func (t *RegistrationRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13303,8 +13303,8 @@ type UnregistrationRequest struct { Method RequestMethod `json:"method"` Params UnregistrationParams `json:"params"` } -func (t *UnregistrationRequest) isMessage() {} -func (t *UnregistrationRequest) isRequest() {} +func (t UnregistrationRequest) isMessage() {} +func (t UnregistrationRequest) isRequest() {} func (t *UnregistrationRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13338,8 +13338,8 @@ type CodeActionResolveRequest struct { Method RequestMethod `json:"method"` Params CodeAction `json:"params"` } -func (t *CodeActionResolveRequest) isMessage() {} -func (t *CodeActionResolveRequest) isRequest() {} +func (t CodeActionResolveRequest) isMessage() {} +func (t CodeActionResolveRequest) isRequest() {} func (t *CodeActionResolveRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13371,8 +13371,8 @@ type CodeLensResolveRequest struct { Method RequestMethod `json:"method"` Params CodeLens `json:"params"` } -func (t *CodeLensResolveRequest) isMessage() {} -func (t *CodeLensResolveRequest) isRequest() {} +func (t CodeLensResolveRequest) isMessage() {} +func (t CodeLensResolveRequest) isRequest() {} func (t *CodeLensResolveRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13406,8 +13406,8 @@ type CompletionResolveRequest struct { Method RequestMethod `json:"method"` Params CompletionItem `json:"params"` } -func (t *CompletionResolveRequest) isMessage() {} -func (t *CompletionResolveRequest) isRequest() {} +func (t CompletionResolveRequest) isMessage() {} +func (t CompletionResolveRequest) isRequest() {} func (t *CompletionResolveRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13441,8 +13441,8 @@ type DocumentLinkResolveRequest struct { Method RequestMethod `json:"method"` Params DocumentLink `json:"params"` } -func (t *DocumentLinkResolveRequest) isMessage() {} -func (t *DocumentLinkResolveRequest) isRequest() {} +func (t DocumentLinkResolveRequest) isMessage() {} +func (t DocumentLinkResolveRequest) isRequest() {} func (t *DocumentLinkResolveRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13478,8 +13478,8 @@ type InitializeRequest struct { Method RequestMethod `json:"method"` Params InitializeParams `json:"params"` } -func (t *InitializeRequest) isMessage() {} -func (t *InitializeRequest) isRequest() {} +func (t InitializeRequest) isMessage() {} +func (t InitializeRequest) isRequest() {} func (t *InitializeRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13515,8 +13515,8 @@ type InlayHintResolveRequest struct { Method RequestMethod `json:"method"` Params InlayHint `json:"params"` } -func (t *InlayHintResolveRequest) isMessage() {} -func (t *InlayHintResolveRequest) isRequest() {} +func (t InlayHintResolveRequest) isMessage() {} +func (t InlayHintResolveRequest) isRequest() {} func (t *InlayHintResolveRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13551,8 +13551,8 @@ type ShutdownRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *ShutdownRequest) isMessage() {} -func (t *ShutdownRequest) isRequest() {} +func (t ShutdownRequest) isMessage() {} +func (t ShutdownRequest) isRequest() {} func (t *ShutdownRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13584,8 +13584,8 @@ type CodeActionRequest struct { Method RequestMethod `json:"method"` Params CodeActionParams `json:"params"` } -func (t *CodeActionRequest) isMessage() {} -func (t *CodeActionRequest) isRequest() {} +func (t CodeActionRequest) isMessage() {} +func (t CodeActionRequest) isRequest() {} func (t *CodeActionRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13617,8 +13617,8 @@ type CodeLensRequest struct { Method RequestMethod `json:"method"` Params CodeLensParams `json:"params"` } -func (t *CodeLensRequest) isMessage() {} -func (t *CodeLensRequest) isRequest() {} +func (t CodeLensRequest) isMessage() {} +func (t CodeLensRequest) isRequest() {} func (t *CodeLensRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13653,8 +13653,8 @@ type ColorPresentationRequest struct { Method RequestMethod `json:"method"` Params ColorPresentationParams `json:"params"` } -func (t *ColorPresentationRequest) isMessage() {} -func (t *ColorPresentationRequest) isRequest() {} +func (t ColorPresentationRequest) isMessage() {} +func (t ColorPresentationRequest) isRequest() {} func (t *ColorPresentationRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13694,8 +13694,8 @@ type CompletionRequest struct { Method RequestMethod `json:"method"` Params CompletionParams `json:"params"` } -func (t *CompletionRequest) isMessage() {} -func (t *CompletionRequest) isRequest() {} +func (t CompletionRequest) isMessage() {} +func (t CompletionRequest) isRequest() {} func (t *CompletionRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13730,8 +13730,8 @@ type DeclarationRequest struct { Method RequestMethod `json:"method"` Params DeclarationParams `json:"params"` } -func (t *DeclarationRequest) isMessage() {} -func (t *DeclarationRequest) isRequest() {} +func (t DeclarationRequest) isMessage() {} +func (t DeclarationRequest) isRequest() {} func (t *DeclarationRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13766,8 +13766,8 @@ type DefinitionRequest struct { Method RequestMethod `json:"method"` Params DefinitionParams `json:"params"` } -func (t *DefinitionRequest) isMessage() {} -func (t *DefinitionRequest) isRequest() {} +func (t DefinitionRequest) isMessage() {} +func (t DefinitionRequest) isRequest() {} func (t *DefinitionRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13801,8 +13801,8 @@ type DocumentDiagnosticRequest struct { Method RequestMethod `json:"method"` Params DocumentDiagnosticParams `json:"params"` } -func (t *DocumentDiagnosticRequest) isMessage() {} -func (t *DocumentDiagnosticRequest) isRequest() {} +func (t DocumentDiagnosticRequest) isMessage() {} +func (t DocumentDiagnosticRequest) isRequest() {} func (t *DocumentDiagnosticRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13837,8 +13837,8 @@ type DocumentColorRequest struct { Method RequestMethod `json:"method"` Params DocumentColorParams `json:"params"` } -func (t *DocumentColorRequest) isMessage() {} -func (t *DocumentColorRequest) isRequest() {} +func (t DocumentColorRequest) isMessage() {} +func (t DocumentColorRequest) isRequest() {} func (t *DocumentColorRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13873,8 +13873,8 @@ type DocumentHighlightRequest struct { Method RequestMethod `json:"method"` Params DocumentHighlightParams `json:"params"` } -func (t *DocumentHighlightRequest) isMessage() {} -func (t *DocumentHighlightRequest) isRequest() {} +func (t DocumentHighlightRequest) isMessage() {} +func (t DocumentHighlightRequest) isRequest() {} func (t *DocumentHighlightRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13906,8 +13906,8 @@ type DocumentLinkRequest struct { Method RequestMethod `json:"method"` Params DocumentLinkParams `json:"params"` } -func (t *DocumentLinkRequest) isMessage() {} -func (t *DocumentLinkRequest) isRequest() {} +func (t DocumentLinkRequest) isMessage() {} +func (t DocumentLinkRequest) isRequest() {} func (t *DocumentLinkRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13942,8 +13942,8 @@ type DocumentSymbolRequest struct { Method RequestMethod `json:"method"` Params DocumentSymbolParams `json:"params"` } -func (t *DocumentSymbolRequest) isMessage() {} -func (t *DocumentSymbolRequest) isRequest() {} +func (t DocumentSymbolRequest) isMessage() {} +func (t DocumentSymbolRequest) isRequest() {} func (t *DocumentSymbolRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -13978,8 +13978,8 @@ type FoldingRangeRequest struct { Method RequestMethod `json:"method"` Params FoldingRangeParams `json:"params"` } -func (t *FoldingRangeRequest) isMessage() {} -func (t *FoldingRangeRequest) isRequest() {} +func (t FoldingRangeRequest) isMessage() {} +func (t FoldingRangeRequest) isRequest() {} func (t *FoldingRangeRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14011,8 +14011,8 @@ type DocumentFormattingRequest struct { Method RequestMethod `json:"method"` Params DocumentFormattingParams `json:"params"` } -func (t *DocumentFormattingRequest) isMessage() {} -func (t *DocumentFormattingRequest) isRequest() {} +func (t DocumentFormattingRequest) isMessage() {} +func (t DocumentFormattingRequest) isRequest() {} func (t *DocumentFormattingRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14046,8 +14046,8 @@ type HoverRequest struct { Method RequestMethod `json:"method"` Params HoverParams `json:"params"` } -func (t *HoverRequest) isMessage() {} -func (t *HoverRequest) isRequest() {} +func (t HoverRequest) isMessage() {} +func (t HoverRequest) isRequest() {} func (t *HoverRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14081,8 +14081,8 @@ type ImplementationRequest struct { Method RequestMethod `json:"method"` Params ImplementationParams `json:"params"` } -func (t *ImplementationRequest) isMessage() {} -func (t *ImplementationRequest) isRequest() {} +func (t ImplementationRequest) isMessage() {} +func (t ImplementationRequest) isRequest() {} func (t *ImplementationRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14118,8 +14118,8 @@ type InlayHintRequest struct { Method RequestMethod `json:"method"` Params InlayHintParams `json:"params"` } -func (t *InlayHintRequest) isMessage() {} -func (t *InlayHintRequest) isRequest() {} +func (t InlayHintRequest) isMessage() {} +func (t InlayHintRequest) isRequest() {} func (t *InlayHintRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14156,8 +14156,8 @@ type InlineCompletionRequest struct { Method RequestMethod `json:"method"` Params InlineCompletionParams `json:"params"` } -func (t *InlineCompletionRequest) isMessage() {} -func (t *InlineCompletionRequest) isRequest() {} +func (t InlineCompletionRequest) isMessage() {} +func (t InlineCompletionRequest) isRequest() {} func (t *InlineCompletionRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14193,8 +14193,8 @@ type InlineValueRequest struct { Method RequestMethod `json:"method"` Params InlineValueParams `json:"params"` } -func (t *InlineValueRequest) isMessage() {} -func (t *InlineValueRequest) isRequest() {} +func (t InlineValueRequest) isMessage() {} +func (t InlineValueRequest) isRequest() {} func (t *InlineValueRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14228,8 +14228,8 @@ type LinkedEditingRangeRequest struct { Method RequestMethod `json:"method"` Params LinkedEditingRangeParams `json:"params"` } -func (t *LinkedEditingRangeRequest) isMessage() {} -func (t *LinkedEditingRangeRequest) isRequest() {} +func (t LinkedEditingRangeRequest) isMessage() {} +func (t LinkedEditingRangeRequest) isRequest() {} func (t *LinkedEditingRangeRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14263,8 +14263,8 @@ type MonikerRequest struct { Method RequestMethod `json:"method"` Params MonikerParams `json:"params"` } -func (t *MonikerRequest) isMessage() {} -func (t *MonikerRequest) isRequest() {} +func (t MonikerRequest) isMessage() {} +func (t MonikerRequest) isRequest() {} func (t *MonikerRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14296,8 +14296,8 @@ type DocumentOnTypeFormattingRequest struct { Method RequestMethod `json:"method"` Params DocumentOnTypeFormattingParams `json:"params"` } -func (t *DocumentOnTypeFormattingRequest) isMessage() {} -func (t *DocumentOnTypeFormattingRequest) isRequest() {} +func (t DocumentOnTypeFormattingRequest) isMessage() {} +func (t DocumentOnTypeFormattingRequest) isRequest() {} func (t *DocumentOnTypeFormattingRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14332,8 +14332,8 @@ type CallHierarchyPrepareRequest struct { Method RequestMethod `json:"method"` Params CallHierarchyPrepareParams `json:"params"` } -func (t *CallHierarchyPrepareRequest) isMessage() {} -func (t *CallHierarchyPrepareRequest) isRequest() {} +func (t CallHierarchyPrepareRequest) isMessage() {} +func (t CallHierarchyPrepareRequest) isRequest() {} func (t *CallHierarchyPrepareRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14367,8 +14367,8 @@ type PrepareRenameRequest struct { Method RequestMethod `json:"method"` Params PrepareRenameParams `json:"params"` } -func (t *PrepareRenameRequest) isMessage() {} -func (t *PrepareRenameRequest) isRequest() {} +func (t PrepareRenameRequest) isMessage() {} +func (t PrepareRenameRequest) isRequest() {} func (t *PrepareRenameRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14403,8 +14403,8 @@ type TypeHierarchyPrepareRequest struct { Method RequestMethod `json:"method"` Params TypeHierarchyPrepareParams `json:"params"` } -func (t *TypeHierarchyPrepareRequest) isMessage() {} -func (t *TypeHierarchyPrepareRequest) isRequest() {} +func (t TypeHierarchyPrepareRequest) isMessage() {} +func (t TypeHierarchyPrepareRequest) isRequest() {} func (t *TypeHierarchyPrepareRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14436,8 +14436,8 @@ type DocumentRangeFormattingRequest struct { Method RequestMethod `json:"method"` Params DocumentRangeFormattingParams `json:"params"` } -func (t *DocumentRangeFormattingRequest) isMessage() {} -func (t *DocumentRangeFormattingRequest) isRequest() {} +func (t DocumentRangeFormattingRequest) isMessage() {} +func (t DocumentRangeFormattingRequest) isRequest() {} func (t *DocumentRangeFormattingRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14472,8 +14472,8 @@ type DocumentRangesFormattingRequest struct { Method RequestMethod `json:"method"` Params DocumentRangesFormattingParams `json:"params"` } -func (t *DocumentRangesFormattingRequest) isMessage() {} -func (t *DocumentRangesFormattingRequest) isRequest() {} +func (t DocumentRangesFormattingRequest) isMessage() {} +func (t DocumentRangesFormattingRequest) isRequest() {} func (t *DocumentRangesFormattingRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14508,8 +14508,8 @@ type ReferencesRequest struct { Method RequestMethod `json:"method"` Params ReferenceParams `json:"params"` } -func (t *ReferencesRequest) isMessage() {} -func (t *ReferencesRequest) isRequest() {} +func (t ReferencesRequest) isMessage() {} +func (t ReferencesRequest) isRequest() {} func (t *ReferencesRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14541,8 +14541,8 @@ type RenameRequest struct { Method RequestMethod `json:"method"` Params RenameParams `json:"params"` } -func (t *RenameRequest) isMessage() {} -func (t *RenameRequest) isRequest() {} +func (t RenameRequest) isMessage() {} +func (t RenameRequest) isRequest() {} func (t *RenameRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14577,8 +14577,8 @@ type SelectionRangeRequest struct { Method RequestMethod `json:"method"` Params SelectionRangeParams `json:"params"` } -func (t *SelectionRangeRequest) isMessage() {} -func (t *SelectionRangeRequest) isRequest() {} +func (t SelectionRangeRequest) isMessage() {} +func (t SelectionRangeRequest) isRequest() {} func (t *SelectionRangeRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14610,8 +14610,8 @@ type SemanticTokensRequest struct { Method RequestMethod `json:"method"` Params SemanticTokensParams `json:"params"` } -func (t *SemanticTokensRequest) isMessage() {} -func (t *SemanticTokensRequest) isRequest() {} +func (t SemanticTokensRequest) isMessage() {} +func (t SemanticTokensRequest) isRequest() {} func (t *SemanticTokensRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14643,8 +14643,8 @@ type SemanticTokensDeltaRequest struct { Method RequestMethod `json:"method"` Params SemanticTokensDeltaParams `json:"params"` } -func (t *SemanticTokensDeltaRequest) isMessage() {} -func (t *SemanticTokensDeltaRequest) isRequest() {} +func (t SemanticTokensDeltaRequest) isMessage() {} +func (t SemanticTokensDeltaRequest) isRequest() {} func (t *SemanticTokensDeltaRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14676,8 +14676,8 @@ type SemanticTokensRangeRequest struct { Method RequestMethod `json:"method"` Params SemanticTokensRangeParams `json:"params"` } -func (t *SemanticTokensRangeRequest) isMessage() {} -func (t *SemanticTokensRangeRequest) isRequest() {} +func (t SemanticTokensRangeRequest) isMessage() {} +func (t SemanticTokensRangeRequest) isRequest() {} func (t *SemanticTokensRangeRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14709,8 +14709,8 @@ type SignatureHelpRequest struct { Method RequestMethod `json:"method"` Params SignatureHelpParams `json:"params"` } -func (t *SignatureHelpRequest) isMessage() {} -func (t *SignatureHelpRequest) isRequest() {} +func (t SignatureHelpRequest) isMessage() {} +func (t SignatureHelpRequest) isRequest() {} func (t *SignatureHelpRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14744,8 +14744,8 @@ type TypeDefinitionRequest struct { Method RequestMethod `json:"method"` Params TypeDefinitionParams `json:"params"` } -func (t *TypeDefinitionRequest) isMessage() {} -func (t *TypeDefinitionRequest) isRequest() {} +func (t TypeDefinitionRequest) isMessage() {} +func (t TypeDefinitionRequest) isRequest() {} func (t *TypeDefinitionRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14782,8 +14782,8 @@ type WillSaveTextDocumentWaitUntilRequest struct { Method RequestMethod `json:"method"` Params WillSaveTextDocumentParams `json:"params"` } -func (t *WillSaveTextDocumentWaitUntilRequest) isMessage() {} -func (t *WillSaveTextDocumentWaitUntilRequest) isRequest() {} +func (t WillSaveTextDocumentWaitUntilRequest) isMessage() {} +func (t WillSaveTextDocumentWaitUntilRequest) isRequest() {} func (t *WillSaveTextDocumentWaitUntilRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14817,8 +14817,8 @@ type TypeHierarchySubtypesRequest struct { Method RequestMethod `json:"method"` Params TypeHierarchySubtypesParams `json:"params"` } -func (t *TypeHierarchySubtypesRequest) isMessage() {} -func (t *TypeHierarchySubtypesRequest) isRequest() {} +func (t TypeHierarchySubtypesRequest) isMessage() {} +func (t TypeHierarchySubtypesRequest) isRequest() {} func (t *TypeHierarchySubtypesRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14852,8 +14852,8 @@ type TypeHierarchySupertypesRequest struct { Method RequestMethod `json:"method"` Params TypeHierarchySupertypesParams `json:"params"` } -func (t *TypeHierarchySupertypesRequest) isMessage() {} -func (t *TypeHierarchySupertypesRequest) isRequest() {} +func (t TypeHierarchySupertypesRequest) isMessage() {} +func (t TypeHierarchySupertypesRequest) isRequest() {} func (t *TypeHierarchySupertypesRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14890,8 +14890,8 @@ type ShowDocumentRequest struct { Method RequestMethod `json:"method"` Params ShowDocumentParams `json:"params"` } -func (t *ShowDocumentRequest) isMessage() {} -func (t *ShowDocumentRequest) isRequest() {} +func (t ShowDocumentRequest) isMessage() {} +func (t ShowDocumentRequest) isRequest() {} func (t *ShowDocumentRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14924,8 +14924,8 @@ type ShowMessageRequest struct { Method RequestMethod `json:"method"` Params ShowMessageRequestParams `json:"params"` } -func (t *ShowMessageRequest) isMessage() {} -func (t *ShowMessageRequest) isRequest() {} +func (t ShowMessageRequest) isMessage() {} +func (t ShowMessageRequest) isRequest() {} func (t *ShowMessageRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14958,8 +14958,8 @@ type WorkDoneProgressCreateRequest struct { Method RequestMethod `json:"method"` Params WorkDoneProgressCreateParams `json:"params"` } -func (t *WorkDoneProgressCreateRequest) isMessage() {} -func (t *WorkDoneProgressCreateRequest) isRequest() {} +func (t WorkDoneProgressCreateRequest) isMessage() {} +func (t WorkDoneProgressCreateRequest) isRequest() {} func (t *WorkDoneProgressCreateRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -14991,8 +14991,8 @@ type ApplyWorkspaceEditRequest struct { Method RequestMethod `json:"method"` Params ApplyWorkspaceEditParams `json:"params"` } -func (t *ApplyWorkspaceEditRequest) isMessage() {} -func (t *ApplyWorkspaceEditRequest) isRequest() {} +func (t ApplyWorkspaceEditRequest) isMessage() {} +func (t ApplyWorkspaceEditRequest) isRequest() {} func (t *ApplyWorkspaceEditRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15026,8 +15026,8 @@ type CodeLensRefreshRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *CodeLensRefreshRequest) isMessage() {} -func (t *CodeLensRefreshRequest) isRequest() {} +func (t CodeLensRefreshRequest) isMessage() {} +func (t CodeLensRefreshRequest) isRequest() {} func (t *CodeLensRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15065,8 +15065,8 @@ type ConfigurationRequest struct { Method RequestMethod `json:"method"` Params ConfigurationParams `json:"params"` } -func (t *ConfigurationRequest) isMessage() {} -func (t *ConfigurationRequest) isRequest() {} +func (t ConfigurationRequest) isMessage() {} +func (t ConfigurationRequest) isRequest() {} func (t *ConfigurationRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15100,8 +15100,8 @@ type WorkspaceDiagnosticRequest struct { Method RequestMethod `json:"method"` Params WorkspaceDiagnosticParams `json:"params"` } -func (t *WorkspaceDiagnosticRequest) isMessage() {} -func (t *WorkspaceDiagnosticRequest) isRequest() {} +func (t WorkspaceDiagnosticRequest) isMessage() {} +func (t WorkspaceDiagnosticRequest) isRequest() {} func (t *WorkspaceDiagnosticRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15135,8 +15135,8 @@ type DiagnosticRefreshRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *DiagnosticRefreshRequest) isMessage() {} -func (t *DiagnosticRefreshRequest) isRequest() {} +func (t DiagnosticRefreshRequest) isMessage() {} +func (t DiagnosticRefreshRequest) isRequest() {} func (t *DiagnosticRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15169,8 +15169,8 @@ type ExecuteCommandRequest struct { Method RequestMethod `json:"method"` Params ExecuteCommandParams `json:"params"` } -func (t *ExecuteCommandRequest) isMessage() {} -func (t *ExecuteCommandRequest) isRequest() {} +func (t ExecuteCommandRequest) isMessage() {} +func (t ExecuteCommandRequest) isRequest() {} func (t *ExecuteCommandRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15203,8 +15203,8 @@ type FoldingRangeRefreshRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *FoldingRangeRefreshRequest) isMessage() {} -func (t *FoldingRangeRefreshRequest) isRequest() {} +func (t FoldingRangeRefreshRequest) isMessage() {} +func (t FoldingRangeRefreshRequest) isRequest() {} func (t *FoldingRangeRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15236,8 +15236,8 @@ type InlayHintRefreshRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *InlayHintRefreshRequest) isMessage() {} -func (t *InlayHintRefreshRequest) isRequest() {} +func (t InlayHintRefreshRequest) isMessage() {} +func (t InlayHintRefreshRequest) isRequest() {} func (t *InlayHintRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15269,8 +15269,8 @@ type InlineValueRefreshRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *InlineValueRefreshRequest) isMessage() {} -func (t *InlineValueRefreshRequest) isRequest() {} +func (t InlineValueRefreshRequest) isMessage() {} +func (t InlineValueRefreshRequest) isRequest() {} func (t *InlineValueRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15302,8 +15302,8 @@ type SemanticTokensRefreshRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *SemanticTokensRefreshRequest) isMessage() {} -func (t *SemanticTokensRefreshRequest) isRequest() {} +func (t SemanticTokensRefreshRequest) isMessage() {} +func (t SemanticTokensRefreshRequest) isRequest() {} func (t *SemanticTokensRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15342,8 +15342,8 @@ type WorkspaceSymbolRequest struct { Method RequestMethod `json:"method"` Params WorkspaceSymbolParams `json:"params"` } -func (t *WorkspaceSymbolRequest) isMessage() {} -func (t *WorkspaceSymbolRequest) isRequest() {} +func (t WorkspaceSymbolRequest) isMessage() {} +func (t WorkspaceSymbolRequest) isRequest() {} func (t *WorkspaceSymbolRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15379,8 +15379,8 @@ type TextDocumentContentRequest struct { Method RequestMethod `json:"method"` Params TextDocumentContentParams `json:"params"` } -func (t *TextDocumentContentRequest) isMessage() {} -func (t *TextDocumentContentRequest) isRequest() {} +func (t TextDocumentContentRequest) isMessage() {} +func (t TextDocumentContentRequest) isRequest() {} func (t *TextDocumentContentRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15416,8 +15416,8 @@ type TextDocumentContentRefreshRequest struct { Method RequestMethod `json:"method"` Params TextDocumentContentRefreshParams `json:"params"` } -func (t *TextDocumentContentRefreshRequest) isMessage() {} -func (t *TextDocumentContentRefreshRequest) isRequest() {} +func (t TextDocumentContentRefreshRequest) isMessage() {} +func (t TextDocumentContentRefreshRequest) isRequest() {} func (t *TextDocumentContentRefreshRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15456,8 +15456,8 @@ type WillCreateFilesRequest struct { Method RequestMethod `json:"method"` Params CreateFilesParams `json:"params"` } -func (t *WillCreateFilesRequest) isMessage() {} -func (t *WillCreateFilesRequest) isRequest() {} +func (t WillCreateFilesRequest) isMessage() {} +func (t WillCreateFilesRequest) isRequest() {} func (t *WillCreateFilesRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15492,8 +15492,8 @@ type WillDeleteFilesRequest struct { Method RequestMethod `json:"method"` Params DeleteFilesParams `json:"params"` } -func (t *WillDeleteFilesRequest) isMessage() {} -func (t *WillDeleteFilesRequest) isRequest() {} +func (t WillDeleteFilesRequest) isMessage() {} +func (t WillDeleteFilesRequest) isRequest() {} func (t *WillDeleteFilesRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15528,8 +15528,8 @@ type WillRenameFilesRequest struct { Method RequestMethod `json:"method"` Params RenameFilesParams `json:"params"` } -func (t *WillRenameFilesRequest) isMessage() {} -func (t *WillRenameFilesRequest) isRequest() {} +func (t WillRenameFilesRequest) isMessage() {} +func (t WillRenameFilesRequest) isRequest() {} func (t *WillRenameFilesRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15561,8 +15561,8 @@ type WorkspaceFoldersRequest struct { Method RequestMethod `json:"method"` Params any `json:"params"` } -func (t *WorkspaceFoldersRequest) isMessage() {} -func (t *WorkspaceFoldersRequest) isRequest() {} +func (t WorkspaceFoldersRequest) isMessage() {} +func (t WorkspaceFoldersRequest) isRequest() {} func (t *WorkspaceFoldersRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15597,8 +15597,8 @@ type WorkspaceSymbolResolveRequest struct { Method RequestMethod `json:"method"` Params WorkspaceSymbol `json:"params"` } -func (t *WorkspaceSymbolResolveRequest) isMessage() {} -func (t *WorkspaceSymbolResolveRequest) isRequest() {} +func (t WorkspaceSymbolResolveRequest) isMessage() {} +func (t WorkspaceSymbolResolveRequest) isRequest() {} func (t *WorkspaceSymbolResolveRequest) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -15647,8 +15647,8 @@ func (t *CallHierarchyIncomingCallsResponse) UnmarshalJSON(x []byte) error { *t = CallHierarchyIncomingCallsResponse(temp) return nil } -func (t *CallHierarchyIncomingCallsResponse) isMessage() {} -func (t *CallHierarchyIncomingCallsResponse) isResponse() {} +func (t CallHierarchyIncomingCallsResponse) isMessage() {} +func (t CallHierarchyIncomingCallsResponse) isResponse() {} type CallHierarchyOutgoingCallsResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15673,8 +15673,8 @@ func (t *CallHierarchyOutgoingCallsResponse) UnmarshalJSON(x []byte) error { *t = CallHierarchyOutgoingCallsResponse(temp) return nil } -func (t *CallHierarchyOutgoingCallsResponse) isMessage() {} -func (t *CallHierarchyOutgoingCallsResponse) isResponse() {} +func (t CallHierarchyOutgoingCallsResponse) isMessage() {} +func (t CallHierarchyOutgoingCallsResponse) isResponse() {} type RegistrationResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15699,8 +15699,8 @@ func (t *RegistrationResponse) UnmarshalJSON(x []byte) error { *t = RegistrationResponse(temp) return nil } -func (t *RegistrationResponse) isMessage() {} -func (t *RegistrationResponse) isResponse() {} +func (t RegistrationResponse) isMessage() {} +func (t RegistrationResponse) isResponse() {} type UnregistrationResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15725,8 +15725,8 @@ func (t *UnregistrationResponse) UnmarshalJSON(x []byte) error { *t = UnregistrationResponse(temp) return nil } -func (t *UnregistrationResponse) isMessage() {} -func (t *UnregistrationResponse) isResponse() {} +func (t UnregistrationResponse) isMessage() {} +func (t UnregistrationResponse) isResponse() {} type CodeActionResolveResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15751,8 +15751,8 @@ func (t *CodeActionResolveResponse) UnmarshalJSON(x []byte) error { *t = CodeActionResolveResponse(temp) return nil } -func (t *CodeActionResolveResponse) isMessage() {} -func (t *CodeActionResolveResponse) isResponse() {} +func (t CodeActionResolveResponse) isMessage() {} +func (t CodeActionResolveResponse) isResponse() {} type CodeLensResolveResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15777,8 +15777,8 @@ func (t *CodeLensResolveResponse) UnmarshalJSON(x []byte) error { *t = CodeLensResolveResponse(temp) return nil } -func (t *CodeLensResolveResponse) isMessage() {} -func (t *CodeLensResolveResponse) isResponse() {} +func (t CodeLensResolveResponse) isMessage() {} +func (t CodeLensResolveResponse) isResponse() {} type CompletionResolveResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15803,8 +15803,8 @@ func (t *CompletionResolveResponse) UnmarshalJSON(x []byte) error { *t = CompletionResolveResponse(temp) return nil } -func (t *CompletionResolveResponse) isMessage() {} -func (t *CompletionResolveResponse) isResponse() {} +func (t CompletionResolveResponse) isMessage() {} +func (t CompletionResolveResponse) isResponse() {} type DocumentLinkResolveResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15829,8 +15829,8 @@ func (t *DocumentLinkResolveResponse) UnmarshalJSON(x []byte) error { *t = DocumentLinkResolveResponse(temp) return nil } -func (t *DocumentLinkResolveResponse) isMessage() {} -func (t *DocumentLinkResolveResponse) isResponse() {} +func (t DocumentLinkResolveResponse) isMessage() {} +func (t DocumentLinkResolveResponse) isResponse() {} type InitializeResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15855,8 +15855,8 @@ func (t *InitializeResponse) UnmarshalJSON(x []byte) error { *t = InitializeResponse(temp) return nil } -func (t *InitializeResponse) isMessage() {} -func (t *InitializeResponse) isResponse() {} +func (t InitializeResponse) isMessage() {} +func (t InitializeResponse) isResponse() {} type InlayHintResolveResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15881,8 +15881,8 @@ func (t *InlayHintResolveResponse) UnmarshalJSON(x []byte) error { *t = InlayHintResolveResponse(temp) return nil } -func (t *InlayHintResolveResponse) isMessage() {} -func (t *InlayHintResolveResponse) isResponse() {} +func (t InlayHintResolveResponse) isMessage() {} +func (t InlayHintResolveResponse) isResponse() {} type ShutdownResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15907,8 +15907,8 @@ func (t *ShutdownResponse) UnmarshalJSON(x []byte) error { *t = ShutdownResponse(temp) return nil } -func (t *ShutdownResponse) isMessage() {} -func (t *ShutdownResponse) isResponse() {} +func (t ShutdownResponse) isMessage() {} +func (t ShutdownResponse) isResponse() {} type CodeActionResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15933,8 +15933,8 @@ func (t *CodeActionResponse) UnmarshalJSON(x []byte) error { *t = CodeActionResponse(temp) return nil } -func (t *CodeActionResponse) isMessage() {} -func (t *CodeActionResponse) isResponse() {} +func (t CodeActionResponse) isMessage() {} +func (t CodeActionResponse) isResponse() {} type CodeLensResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15959,8 +15959,8 @@ func (t *CodeLensResponse) UnmarshalJSON(x []byte) error { *t = CodeLensResponse(temp) return nil } -func (t *CodeLensResponse) isMessage() {} -func (t *CodeLensResponse) isResponse() {} +func (t CodeLensResponse) isMessage() {} +func (t CodeLensResponse) isResponse() {} type ColorPresentationResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -15985,8 +15985,8 @@ func (t *ColorPresentationResponse) UnmarshalJSON(x []byte) error { *t = ColorPresentationResponse(temp) return nil } -func (t *ColorPresentationResponse) isMessage() {} -func (t *ColorPresentationResponse) isResponse() {} +func (t ColorPresentationResponse) isMessage() {} +func (t ColorPresentationResponse) isResponse() {} type CompletionResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16011,8 +16011,8 @@ func (t *CompletionResponse) UnmarshalJSON(x []byte) error { *t = CompletionResponse(temp) return nil } -func (t *CompletionResponse) isMessage() {} -func (t *CompletionResponse) isResponse() {} +func (t CompletionResponse) isMessage() {} +func (t CompletionResponse) isResponse() {} type DeclarationResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16037,8 +16037,8 @@ func (t *DeclarationResponse) UnmarshalJSON(x []byte) error { *t = DeclarationResponse(temp) return nil } -func (t *DeclarationResponse) isMessage() {} -func (t *DeclarationResponse) isResponse() {} +func (t DeclarationResponse) isMessage() {} +func (t DeclarationResponse) isResponse() {} type DefinitionResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16063,8 +16063,8 @@ func (t *DefinitionResponse) UnmarshalJSON(x []byte) error { *t = DefinitionResponse(temp) return nil } -func (t *DefinitionResponse) isMessage() {} -func (t *DefinitionResponse) isResponse() {} +func (t DefinitionResponse) isMessage() {} +func (t DefinitionResponse) isResponse() {} type DocumentDiagnosticResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16089,8 +16089,8 @@ func (t *DocumentDiagnosticResponse) UnmarshalJSON(x []byte) error { *t = DocumentDiagnosticResponse(temp) return nil } -func (t *DocumentDiagnosticResponse) isMessage() {} -func (t *DocumentDiagnosticResponse) isResponse() {} +func (t DocumentDiagnosticResponse) isMessage() {} +func (t DocumentDiagnosticResponse) isResponse() {} type DocumentColorResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16115,8 +16115,8 @@ func (t *DocumentColorResponse) UnmarshalJSON(x []byte) error { *t = DocumentColorResponse(temp) return nil } -func (t *DocumentColorResponse) isMessage() {} -func (t *DocumentColorResponse) isResponse() {} +func (t DocumentColorResponse) isMessage() {} +func (t DocumentColorResponse) isResponse() {} type DocumentHighlightResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16141,8 +16141,8 @@ func (t *DocumentHighlightResponse) UnmarshalJSON(x []byte) error { *t = DocumentHighlightResponse(temp) return nil } -func (t *DocumentHighlightResponse) isMessage() {} -func (t *DocumentHighlightResponse) isResponse() {} +func (t DocumentHighlightResponse) isMessage() {} +func (t DocumentHighlightResponse) isResponse() {} type DocumentLinkResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16167,8 +16167,8 @@ func (t *DocumentLinkResponse) UnmarshalJSON(x []byte) error { *t = DocumentLinkResponse(temp) return nil } -func (t *DocumentLinkResponse) isMessage() {} -func (t *DocumentLinkResponse) isResponse() {} +func (t DocumentLinkResponse) isMessage() {} +func (t DocumentLinkResponse) isResponse() {} type DocumentSymbolResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16193,8 +16193,8 @@ func (t *DocumentSymbolResponse) UnmarshalJSON(x []byte) error { *t = DocumentSymbolResponse(temp) return nil } -func (t *DocumentSymbolResponse) isMessage() {} -func (t *DocumentSymbolResponse) isResponse() {} +func (t DocumentSymbolResponse) isMessage() {} +func (t DocumentSymbolResponse) isResponse() {} type FoldingRangeResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16219,8 +16219,8 @@ func (t *FoldingRangeResponse) UnmarshalJSON(x []byte) error { *t = FoldingRangeResponse(temp) return nil } -func (t *FoldingRangeResponse) isMessage() {} -func (t *FoldingRangeResponse) isResponse() {} +func (t FoldingRangeResponse) isMessage() {} +func (t FoldingRangeResponse) isResponse() {} type DocumentFormattingResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16245,8 +16245,8 @@ func (t *DocumentFormattingResponse) UnmarshalJSON(x []byte) error { *t = DocumentFormattingResponse(temp) return nil } -func (t *DocumentFormattingResponse) isMessage() {} -func (t *DocumentFormattingResponse) isResponse() {} +func (t DocumentFormattingResponse) isMessage() {} +func (t DocumentFormattingResponse) isResponse() {} type HoverResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16271,8 +16271,8 @@ func (t *HoverResponse) UnmarshalJSON(x []byte) error { *t = HoverResponse(temp) return nil } -func (t *HoverResponse) isMessage() {} -func (t *HoverResponse) isResponse() {} +func (t HoverResponse) isMessage() {} +func (t HoverResponse) isResponse() {} type ImplementationResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16297,8 +16297,8 @@ func (t *ImplementationResponse) UnmarshalJSON(x []byte) error { *t = ImplementationResponse(temp) return nil } -func (t *ImplementationResponse) isMessage() {} -func (t *ImplementationResponse) isResponse() {} +func (t ImplementationResponse) isMessage() {} +func (t ImplementationResponse) isResponse() {} type InlayHintResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16323,8 +16323,8 @@ func (t *InlayHintResponse) UnmarshalJSON(x []byte) error { *t = InlayHintResponse(temp) return nil } -func (t *InlayHintResponse) isMessage() {} -func (t *InlayHintResponse) isResponse() {} +func (t InlayHintResponse) isMessage() {} +func (t InlayHintResponse) isResponse() {} type InlineCompletionResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16349,8 +16349,8 @@ func (t *InlineCompletionResponse) UnmarshalJSON(x []byte) error { *t = InlineCompletionResponse(temp) return nil } -func (t *InlineCompletionResponse) isMessage() {} -func (t *InlineCompletionResponse) isResponse() {} +func (t InlineCompletionResponse) isMessage() {} +func (t InlineCompletionResponse) isResponse() {} type InlineValueResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16375,8 +16375,8 @@ func (t *InlineValueResponse) UnmarshalJSON(x []byte) error { *t = InlineValueResponse(temp) return nil } -func (t *InlineValueResponse) isMessage() {} -func (t *InlineValueResponse) isResponse() {} +func (t InlineValueResponse) isMessage() {} +func (t InlineValueResponse) isResponse() {} type LinkedEditingRangeResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16401,8 +16401,8 @@ func (t *LinkedEditingRangeResponse) UnmarshalJSON(x []byte) error { *t = LinkedEditingRangeResponse(temp) return nil } -func (t *LinkedEditingRangeResponse) isMessage() {} -func (t *LinkedEditingRangeResponse) isResponse() {} +func (t LinkedEditingRangeResponse) isMessage() {} +func (t LinkedEditingRangeResponse) isResponse() {} type MonikerResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16427,8 +16427,8 @@ func (t *MonikerResponse) UnmarshalJSON(x []byte) error { *t = MonikerResponse(temp) return nil } -func (t *MonikerResponse) isMessage() {} -func (t *MonikerResponse) isResponse() {} +func (t MonikerResponse) isMessage() {} +func (t MonikerResponse) isResponse() {} type DocumentOnTypeFormattingResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16453,8 +16453,8 @@ func (t *DocumentOnTypeFormattingResponse) UnmarshalJSON(x []byte) error { *t = DocumentOnTypeFormattingResponse(temp) return nil } -func (t *DocumentOnTypeFormattingResponse) isMessage() {} -func (t *DocumentOnTypeFormattingResponse) isResponse() {} +func (t DocumentOnTypeFormattingResponse) isMessage() {} +func (t DocumentOnTypeFormattingResponse) isResponse() {} type CallHierarchyPrepareResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16479,8 +16479,8 @@ func (t *CallHierarchyPrepareResponse) UnmarshalJSON(x []byte) error { *t = CallHierarchyPrepareResponse(temp) return nil } -func (t *CallHierarchyPrepareResponse) isMessage() {} -func (t *CallHierarchyPrepareResponse) isResponse() {} +func (t CallHierarchyPrepareResponse) isMessage() {} +func (t CallHierarchyPrepareResponse) isResponse() {} type PrepareRenameResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16505,8 +16505,8 @@ func (t *PrepareRenameResponse) UnmarshalJSON(x []byte) error { *t = PrepareRenameResponse(temp) return nil } -func (t *PrepareRenameResponse) isMessage() {} -func (t *PrepareRenameResponse) isResponse() {} +func (t PrepareRenameResponse) isMessage() {} +func (t PrepareRenameResponse) isResponse() {} type TypeHierarchyPrepareResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16531,8 +16531,8 @@ func (t *TypeHierarchyPrepareResponse) UnmarshalJSON(x []byte) error { *t = TypeHierarchyPrepareResponse(temp) return nil } -func (t *TypeHierarchyPrepareResponse) isMessage() {} -func (t *TypeHierarchyPrepareResponse) isResponse() {} +func (t TypeHierarchyPrepareResponse) isMessage() {} +func (t TypeHierarchyPrepareResponse) isResponse() {} type DocumentRangeFormattingResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16557,8 +16557,8 @@ func (t *DocumentRangeFormattingResponse) UnmarshalJSON(x []byte) error { *t = DocumentRangeFormattingResponse(temp) return nil } -func (t *DocumentRangeFormattingResponse) isMessage() {} -func (t *DocumentRangeFormattingResponse) isResponse() {} +func (t DocumentRangeFormattingResponse) isMessage() {} +func (t DocumentRangeFormattingResponse) isResponse() {} type DocumentRangesFormattingResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16583,8 +16583,8 @@ func (t *DocumentRangesFormattingResponse) UnmarshalJSON(x []byte) error { *t = DocumentRangesFormattingResponse(temp) return nil } -func (t *DocumentRangesFormattingResponse) isMessage() {} -func (t *DocumentRangesFormattingResponse) isResponse() {} +func (t DocumentRangesFormattingResponse) isMessage() {} +func (t DocumentRangesFormattingResponse) isResponse() {} type ReferencesResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16609,8 +16609,8 @@ func (t *ReferencesResponse) UnmarshalJSON(x []byte) error { *t = ReferencesResponse(temp) return nil } -func (t *ReferencesResponse) isMessage() {} -func (t *ReferencesResponse) isResponse() {} +func (t ReferencesResponse) isMessage() {} +func (t ReferencesResponse) isResponse() {} type RenameResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16635,8 +16635,8 @@ func (t *RenameResponse) UnmarshalJSON(x []byte) error { *t = RenameResponse(temp) return nil } -func (t *RenameResponse) isMessage() {} -func (t *RenameResponse) isResponse() {} +func (t RenameResponse) isMessage() {} +func (t RenameResponse) isResponse() {} type SelectionRangeResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16661,8 +16661,8 @@ func (t *SelectionRangeResponse) UnmarshalJSON(x []byte) error { *t = SelectionRangeResponse(temp) return nil } -func (t *SelectionRangeResponse) isMessage() {} -func (t *SelectionRangeResponse) isResponse() {} +func (t SelectionRangeResponse) isMessage() {} +func (t SelectionRangeResponse) isResponse() {} type SemanticTokensResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16687,8 +16687,8 @@ func (t *SemanticTokensResponse) UnmarshalJSON(x []byte) error { *t = SemanticTokensResponse(temp) return nil } -func (t *SemanticTokensResponse) isMessage() {} -func (t *SemanticTokensResponse) isResponse() {} +func (t SemanticTokensResponse) isMessage() {} +func (t SemanticTokensResponse) isResponse() {} type SemanticTokensDeltaResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16713,8 +16713,8 @@ func (t *SemanticTokensDeltaResponse) UnmarshalJSON(x []byte) error { *t = SemanticTokensDeltaResponse(temp) return nil } -func (t *SemanticTokensDeltaResponse) isMessage() {} -func (t *SemanticTokensDeltaResponse) isResponse() {} +func (t SemanticTokensDeltaResponse) isMessage() {} +func (t SemanticTokensDeltaResponse) isResponse() {} type SemanticTokensRangeResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16739,8 +16739,8 @@ func (t *SemanticTokensRangeResponse) UnmarshalJSON(x []byte) error { *t = SemanticTokensRangeResponse(temp) return nil } -func (t *SemanticTokensRangeResponse) isMessage() {} -func (t *SemanticTokensRangeResponse) isResponse() {} +func (t SemanticTokensRangeResponse) isMessage() {} +func (t SemanticTokensRangeResponse) isResponse() {} type SignatureHelpResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16765,8 +16765,8 @@ func (t *SignatureHelpResponse) UnmarshalJSON(x []byte) error { *t = SignatureHelpResponse(temp) return nil } -func (t *SignatureHelpResponse) isMessage() {} -func (t *SignatureHelpResponse) isResponse() {} +func (t SignatureHelpResponse) isMessage() {} +func (t SignatureHelpResponse) isResponse() {} type TypeDefinitionResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16791,8 +16791,8 @@ func (t *TypeDefinitionResponse) UnmarshalJSON(x []byte) error { *t = TypeDefinitionResponse(temp) return nil } -func (t *TypeDefinitionResponse) isMessage() {} -func (t *TypeDefinitionResponse) isResponse() {} +func (t TypeDefinitionResponse) isMessage() {} +func (t TypeDefinitionResponse) isResponse() {} type WillSaveTextDocumentWaitUntilResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16817,8 +16817,8 @@ func (t *WillSaveTextDocumentWaitUntilResponse) UnmarshalJSON(x []byte) error { *t = WillSaveTextDocumentWaitUntilResponse(temp) return nil } -func (t *WillSaveTextDocumentWaitUntilResponse) isMessage() {} -func (t *WillSaveTextDocumentWaitUntilResponse) isResponse() {} +func (t WillSaveTextDocumentWaitUntilResponse) isMessage() {} +func (t WillSaveTextDocumentWaitUntilResponse) isResponse() {} type TypeHierarchySubtypesResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16843,8 +16843,8 @@ func (t *TypeHierarchySubtypesResponse) UnmarshalJSON(x []byte) error { *t = TypeHierarchySubtypesResponse(temp) return nil } -func (t *TypeHierarchySubtypesResponse) isMessage() {} -func (t *TypeHierarchySubtypesResponse) isResponse() {} +func (t TypeHierarchySubtypesResponse) isMessage() {} +func (t TypeHierarchySubtypesResponse) isResponse() {} type TypeHierarchySupertypesResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16869,8 +16869,8 @@ func (t *TypeHierarchySupertypesResponse) UnmarshalJSON(x []byte) error { *t = TypeHierarchySupertypesResponse(temp) return nil } -func (t *TypeHierarchySupertypesResponse) isMessage() {} -func (t *TypeHierarchySupertypesResponse) isResponse() {} +func (t TypeHierarchySupertypesResponse) isMessage() {} +func (t TypeHierarchySupertypesResponse) isResponse() {} type ShowDocumentResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16895,8 +16895,8 @@ func (t *ShowDocumentResponse) UnmarshalJSON(x []byte) error { *t = ShowDocumentResponse(temp) return nil } -func (t *ShowDocumentResponse) isMessage() {} -func (t *ShowDocumentResponse) isResponse() {} +func (t ShowDocumentResponse) isMessage() {} +func (t ShowDocumentResponse) isResponse() {} type ShowMessageResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16921,8 +16921,8 @@ func (t *ShowMessageResponse) UnmarshalJSON(x []byte) error { *t = ShowMessageResponse(temp) return nil } -func (t *ShowMessageResponse) isMessage() {} -func (t *ShowMessageResponse) isResponse() {} +func (t ShowMessageResponse) isMessage() {} +func (t ShowMessageResponse) isResponse() {} type WorkDoneProgressCreateResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16947,8 +16947,8 @@ func (t *WorkDoneProgressCreateResponse) UnmarshalJSON(x []byte) error { *t = WorkDoneProgressCreateResponse(temp) return nil } -func (t *WorkDoneProgressCreateResponse) isMessage() {} -func (t *WorkDoneProgressCreateResponse) isResponse() {} +func (t WorkDoneProgressCreateResponse) isMessage() {} +func (t WorkDoneProgressCreateResponse) isResponse() {} type ApplyWorkspaceEditResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16973,8 +16973,8 @@ func (t *ApplyWorkspaceEditResponse) UnmarshalJSON(x []byte) error { *t = ApplyWorkspaceEditResponse(temp) return nil } -func (t *ApplyWorkspaceEditResponse) isMessage() {} -func (t *ApplyWorkspaceEditResponse) isResponse() {} +func (t ApplyWorkspaceEditResponse) isMessage() {} +func (t ApplyWorkspaceEditResponse) isResponse() {} type CodeLensRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -16999,8 +16999,8 @@ func (t *CodeLensRefreshResponse) UnmarshalJSON(x []byte) error { *t = CodeLensRefreshResponse(temp) return nil } -func (t *CodeLensRefreshResponse) isMessage() {} -func (t *CodeLensRefreshResponse) isResponse() {} +func (t CodeLensRefreshResponse) isMessage() {} +func (t CodeLensRefreshResponse) isResponse() {} type ConfigurationResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17025,8 +17025,8 @@ func (t *ConfigurationResponse) UnmarshalJSON(x []byte) error { *t = ConfigurationResponse(temp) return nil } -func (t *ConfigurationResponse) isMessage() {} -func (t *ConfigurationResponse) isResponse() {} +func (t ConfigurationResponse) isMessage() {} +func (t ConfigurationResponse) isResponse() {} type WorkspaceDiagnosticResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17051,8 +17051,8 @@ func (t *WorkspaceDiagnosticResponse) UnmarshalJSON(x []byte) error { *t = WorkspaceDiagnosticResponse(temp) return nil } -func (t *WorkspaceDiagnosticResponse) isMessage() {} -func (t *WorkspaceDiagnosticResponse) isResponse() {} +func (t WorkspaceDiagnosticResponse) isMessage() {} +func (t WorkspaceDiagnosticResponse) isResponse() {} type DiagnosticRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17077,8 +17077,8 @@ func (t *DiagnosticRefreshResponse) UnmarshalJSON(x []byte) error { *t = DiagnosticRefreshResponse(temp) return nil } -func (t *DiagnosticRefreshResponse) isMessage() {} -func (t *DiagnosticRefreshResponse) isResponse() {} +func (t DiagnosticRefreshResponse) isMessage() {} +func (t DiagnosticRefreshResponse) isResponse() {} type ExecuteCommandResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17103,8 +17103,8 @@ func (t *ExecuteCommandResponse) UnmarshalJSON(x []byte) error { *t = ExecuteCommandResponse(temp) return nil } -func (t *ExecuteCommandResponse) isMessage() {} -func (t *ExecuteCommandResponse) isResponse() {} +func (t ExecuteCommandResponse) isMessage() {} +func (t ExecuteCommandResponse) isResponse() {} type FoldingRangeRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17129,8 +17129,8 @@ func (t *FoldingRangeRefreshResponse) UnmarshalJSON(x []byte) error { *t = FoldingRangeRefreshResponse(temp) return nil } -func (t *FoldingRangeRefreshResponse) isMessage() {} -func (t *FoldingRangeRefreshResponse) isResponse() {} +func (t FoldingRangeRefreshResponse) isMessage() {} +func (t FoldingRangeRefreshResponse) isResponse() {} type InlayHintRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17155,8 +17155,8 @@ func (t *InlayHintRefreshResponse) UnmarshalJSON(x []byte) error { *t = InlayHintRefreshResponse(temp) return nil } -func (t *InlayHintRefreshResponse) isMessage() {} -func (t *InlayHintRefreshResponse) isResponse() {} +func (t InlayHintRefreshResponse) isMessage() {} +func (t InlayHintRefreshResponse) isResponse() {} type InlineValueRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17181,8 +17181,8 @@ func (t *InlineValueRefreshResponse) UnmarshalJSON(x []byte) error { *t = InlineValueRefreshResponse(temp) return nil } -func (t *InlineValueRefreshResponse) isMessage() {} -func (t *InlineValueRefreshResponse) isResponse() {} +func (t InlineValueRefreshResponse) isMessage() {} +func (t InlineValueRefreshResponse) isResponse() {} type SemanticTokensRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17207,8 +17207,8 @@ func (t *SemanticTokensRefreshResponse) UnmarshalJSON(x []byte) error { *t = SemanticTokensRefreshResponse(temp) return nil } -func (t *SemanticTokensRefreshResponse) isMessage() {} -func (t *SemanticTokensRefreshResponse) isResponse() {} +func (t SemanticTokensRefreshResponse) isMessage() {} +func (t SemanticTokensRefreshResponse) isResponse() {} type WorkspaceSymbolResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17233,8 +17233,8 @@ func (t *WorkspaceSymbolResponse) UnmarshalJSON(x []byte) error { *t = WorkspaceSymbolResponse(temp) return nil } -func (t *WorkspaceSymbolResponse) isMessage() {} -func (t *WorkspaceSymbolResponse) isResponse() {} +func (t WorkspaceSymbolResponse) isMessage() {} +func (t WorkspaceSymbolResponse) isResponse() {} type TextDocumentContentResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17259,8 +17259,8 @@ func (t *TextDocumentContentResponse) UnmarshalJSON(x []byte) error { *t = TextDocumentContentResponse(temp) return nil } -func (t *TextDocumentContentResponse) isMessage() {} -func (t *TextDocumentContentResponse) isResponse() {} +func (t TextDocumentContentResponse) isMessage() {} +func (t TextDocumentContentResponse) isResponse() {} type TextDocumentContentRefreshResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17285,8 +17285,8 @@ func (t *TextDocumentContentRefreshResponse) UnmarshalJSON(x []byte) error { *t = TextDocumentContentRefreshResponse(temp) return nil } -func (t *TextDocumentContentRefreshResponse) isMessage() {} -func (t *TextDocumentContentRefreshResponse) isResponse() {} +func (t TextDocumentContentRefreshResponse) isMessage() {} +func (t TextDocumentContentRefreshResponse) isResponse() {} type WillCreateFilesResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17311,8 +17311,8 @@ func (t *WillCreateFilesResponse) UnmarshalJSON(x []byte) error { *t = WillCreateFilesResponse(temp) return nil } -func (t *WillCreateFilesResponse) isMessage() {} -func (t *WillCreateFilesResponse) isResponse() {} +func (t WillCreateFilesResponse) isMessage() {} +func (t WillCreateFilesResponse) isResponse() {} type WillDeleteFilesResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17337,8 +17337,8 @@ func (t *WillDeleteFilesResponse) UnmarshalJSON(x []byte) error { *t = WillDeleteFilesResponse(temp) return nil } -func (t *WillDeleteFilesResponse) isMessage() {} -func (t *WillDeleteFilesResponse) isResponse() {} +func (t WillDeleteFilesResponse) isMessage() {} +func (t WillDeleteFilesResponse) isResponse() {} type WillRenameFilesResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17363,8 +17363,8 @@ func (t *WillRenameFilesResponse) UnmarshalJSON(x []byte) error { *t = WillRenameFilesResponse(temp) return nil } -func (t *WillRenameFilesResponse) isMessage() {} -func (t *WillRenameFilesResponse) isResponse() {} +func (t WillRenameFilesResponse) isMessage() {} +func (t WillRenameFilesResponse) isResponse() {} type WorkspaceFoldersResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17389,8 +17389,8 @@ func (t *WorkspaceFoldersResponse) UnmarshalJSON(x []byte) error { *t = WorkspaceFoldersResponse(temp) return nil } -func (t *WorkspaceFoldersResponse) isMessage() {} -func (t *WorkspaceFoldersResponse) isResponse() {} +func (t WorkspaceFoldersResponse) isMessage() {} +func (t WorkspaceFoldersResponse) isResponse() {} type WorkspaceSymbolResolveResponse struct { JsonRPC string `json:"jsonrpc"` Id Or2[int32, string] `json:"id"` @@ -17415,8 +17415,8 @@ func (t *WorkspaceSymbolResolveResponse) UnmarshalJSON(x []byte) error { *t = WorkspaceSymbolResolveResponse(temp) return nil } -func (t *WorkspaceSymbolResolveResponse) isMessage() {} -func (t *WorkspaceSymbolResolveResponse) isResponse() {} +func (t WorkspaceSymbolResolveResponse) isMessage() {} +func (t WorkspaceSymbolResolveResponse) isResponse() {} type NotificationMethod string const ( @@ -17484,8 +17484,8 @@ type CancelNotification struct { Method string `json:"method"` Params CancelParams `json:"params"` } -func (t *CancelNotification) isMessage() {} -func (t *CancelNotification) isNotification() {} +func (t CancelNotification) isMessage() {} +func (t CancelNotification) isNotification() {} func (t *CancelNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17513,8 +17513,8 @@ type LogTraceNotification struct { Method string `json:"method"` Params LogTraceParams `json:"params"` } -func (t *LogTraceNotification) isMessage() {} -func (t *LogTraceNotification) isNotification() {} +func (t LogTraceNotification) isMessage() {} +func (t LogTraceNotification) isNotification() {} func (t *LogTraceNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17542,8 +17542,8 @@ type ProgressNotification struct { Method string `json:"method"` Params ProgressParams `json:"params"` } -func (t *ProgressNotification) isMessage() {} -func (t *ProgressNotification) isNotification() {} +func (t ProgressNotification) isMessage() {} +func (t ProgressNotification) isNotification() {} func (t *ProgressNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17571,8 +17571,8 @@ type SetTraceNotification struct { Method string `json:"method"` Params SetTraceParams `json:"params"` } -func (t *SetTraceNotification) isMessage() {} -func (t *SetTraceNotification) isNotification() {} +func (t SetTraceNotification) isMessage() {} +func (t SetTraceNotification) isNotification() {} func (t *SetTraceNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17601,8 +17601,8 @@ type ExitNotification struct { Method string `json:"method"` Params any `json:"params"` } -func (t *ExitNotification) isMessage() {} -func (t *ExitNotification) isNotification() {} +func (t ExitNotification) isMessage() {} +func (t ExitNotification) isNotification() {} func (t *ExitNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17632,8 +17632,8 @@ type InitializedNotification struct { Method string `json:"method"` Params InitializedParams `json:"params"` } -func (t *InitializedNotification) isMessage() {} -func (t *InitializedNotification) isNotification() {} +func (t InitializedNotification) isMessage() {} +func (t InitializedNotification) isNotification() {} func (t *InitializedNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17661,8 +17661,8 @@ type DidChangeNotebookDocumentNotification struct { Method string `json:"method"` Params DidChangeNotebookDocumentParams `json:"params"` } -func (t *DidChangeNotebookDocumentNotification) isMessage() {} -func (t *DidChangeNotebookDocumentNotification) isNotification() {} +func (t DidChangeNotebookDocumentNotification) isMessage() {} +func (t DidChangeNotebookDocumentNotification) isNotification() {} func (t *DidChangeNotebookDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17692,8 +17692,8 @@ type DidCloseNotebookDocumentNotification struct { Method string `json:"method"` Params DidCloseNotebookDocumentParams `json:"params"` } -func (t *DidCloseNotebookDocumentNotification) isMessage() {} -func (t *DidCloseNotebookDocumentNotification) isNotification() {} +func (t DidCloseNotebookDocumentNotification) isMessage() {} +func (t DidCloseNotebookDocumentNotification) isNotification() {} func (t *DidCloseNotebookDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17723,8 +17723,8 @@ type DidOpenNotebookDocumentNotification struct { Method string `json:"method"` Params DidOpenNotebookDocumentParams `json:"params"` } -func (t *DidOpenNotebookDocumentNotification) isMessage() {} -func (t *DidOpenNotebookDocumentNotification) isNotification() {} +func (t DidOpenNotebookDocumentNotification) isMessage() {} +func (t DidOpenNotebookDocumentNotification) isNotification() {} func (t *DidOpenNotebookDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17754,8 +17754,8 @@ type DidSaveNotebookDocumentNotification struct { Method string `json:"method"` Params DidSaveNotebookDocumentParams `json:"params"` } -func (t *DidSaveNotebookDocumentNotification) isMessage() {} -func (t *DidSaveNotebookDocumentNotification) isNotification() {} +func (t DidSaveNotebookDocumentNotification) isMessage() {} +func (t DidSaveNotebookDocumentNotification) isNotification() {} func (t *DidSaveNotebookDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17784,8 +17784,8 @@ type TelemetryEventNotification struct { Method string `json:"method"` Params any `json:"params"` } -func (t *TelemetryEventNotification) isMessage() {} -func (t *TelemetryEventNotification) isNotification() {} +func (t TelemetryEventNotification) isMessage() {} +func (t TelemetryEventNotification) isNotification() {} func (t *TelemetryEventNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17814,8 +17814,8 @@ type DidChangeTextDocumentNotification struct { Method string `json:"method"` Params DidChangeTextDocumentParams `json:"params"` } -func (t *DidChangeTextDocumentNotification) isMessage() {} -func (t *DidChangeTextDocumentNotification) isNotification() {} +func (t DidChangeTextDocumentNotification) isMessage() {} +func (t DidChangeTextDocumentNotification) isNotification() {} func (t *DidChangeTextDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17849,8 +17849,8 @@ type DidCloseTextDocumentNotification struct { Method string `json:"method"` Params DidCloseTextDocumentParams `json:"params"` } -func (t *DidCloseTextDocumentNotification) isMessage() {} -func (t *DidCloseTextDocumentNotification) isNotification() {} +func (t DidCloseTextDocumentNotification) isMessage() {} +func (t DidCloseTextDocumentNotification) isNotification() {} func (t *DidCloseTextDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17885,8 +17885,8 @@ type DidOpenTextDocumentNotification struct { Method string `json:"method"` Params DidOpenTextDocumentParams `json:"params"` } -func (t *DidOpenTextDocumentNotification) isMessage() {} -func (t *DidOpenTextDocumentNotification) isNotification() {} +func (t DidOpenTextDocumentNotification) isMessage() {} +func (t DidOpenTextDocumentNotification) isNotification() {} func (t *DidOpenTextDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17915,8 +17915,8 @@ type DidSaveTextDocumentNotification struct { Method string `json:"method"` Params DidSaveTextDocumentParams `json:"params"` } -func (t *DidSaveTextDocumentNotification) isMessage() {} -func (t *DidSaveTextDocumentNotification) isNotification() {} +func (t DidSaveTextDocumentNotification) isMessage() {} +func (t DidSaveTextDocumentNotification) isNotification() {} func (t *DidSaveTextDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17945,8 +17945,8 @@ type PublishDiagnosticsNotification struct { Method string `json:"method"` Params PublishDiagnosticsParams `json:"params"` } -func (t *PublishDiagnosticsNotification) isMessage() {} -func (t *PublishDiagnosticsNotification) isNotification() {} +func (t PublishDiagnosticsNotification) isMessage() {} +func (t PublishDiagnosticsNotification) isNotification() {} func (t *PublishDiagnosticsNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -17975,8 +17975,8 @@ type WillSaveTextDocumentNotification struct { Method string `json:"method"` Params WillSaveTextDocumentParams `json:"params"` } -func (t *WillSaveTextDocumentNotification) isMessage() {} -func (t *WillSaveTextDocumentNotification) isNotification() {} +func (t WillSaveTextDocumentNotification) isMessage() {} +func (t WillSaveTextDocumentNotification) isNotification() {} func (t *WillSaveTextDocumentNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18005,8 +18005,8 @@ type LogMessageNotification struct { Method string `json:"method"` Params LogMessageParams `json:"params"` } -func (t *LogMessageNotification) isMessage() {} -func (t *LogMessageNotification) isNotification() {} +func (t LogMessageNotification) isMessage() {} +func (t LogMessageNotification) isNotification() {} func (t *LogMessageNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18035,8 +18035,8 @@ type ShowMessageNotification struct { Method string `json:"method"` Params ShowMessageParams `json:"params"` } -func (t *ShowMessageNotification) isMessage() {} -func (t *ShowMessageNotification) isNotification() {} +func (t ShowMessageNotification) isMessage() {} +func (t ShowMessageNotification) isNotification() {} func (t *ShowMessageNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18065,8 +18065,8 @@ type WorkDoneProgressCancelNotification struct { Method string `json:"method"` Params WorkDoneProgressCancelParams `json:"params"` } -func (t *WorkDoneProgressCancelNotification) isMessage() {} -func (t *WorkDoneProgressCancelNotification) isNotification() {} +func (t WorkDoneProgressCancelNotification) isMessage() {} +func (t WorkDoneProgressCancelNotification) isNotification() {} func (t *WorkDoneProgressCancelNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18096,8 +18096,8 @@ type DidChangeConfigurationNotification struct { Method string `json:"method"` Params DidChangeConfigurationParams `json:"params"` } -func (t *DidChangeConfigurationNotification) isMessage() {} -func (t *DidChangeConfigurationNotification) isNotification() {} +func (t DidChangeConfigurationNotification) isMessage() {} +func (t DidChangeConfigurationNotification) isNotification() {} func (t *DidChangeConfigurationNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18126,8 +18126,8 @@ type DidChangeWatchedFilesNotification struct { Method string `json:"method"` Params DidChangeWatchedFilesParams `json:"params"` } -func (t *DidChangeWatchedFilesNotification) isMessage() {} -func (t *DidChangeWatchedFilesNotification) isNotification() {} +func (t DidChangeWatchedFilesNotification) isMessage() {} +func (t DidChangeWatchedFilesNotification) isNotification() {} func (t *DidChangeWatchedFilesNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18156,8 +18156,8 @@ type DidChangeWorkspaceFoldersNotification struct { Method string `json:"method"` Params DidChangeWorkspaceFoldersParams `json:"params"` } -func (t *DidChangeWorkspaceFoldersNotification) isMessage() {} -func (t *DidChangeWorkspaceFoldersNotification) isNotification() {} +func (t DidChangeWorkspaceFoldersNotification) isMessage() {} +func (t DidChangeWorkspaceFoldersNotification) isNotification() {} func (t *DidChangeWorkspaceFoldersNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18188,8 +18188,8 @@ type DidCreateFilesNotification struct { Method string `json:"method"` Params CreateFilesParams `json:"params"` } -func (t *DidCreateFilesNotification) isMessage() {} -func (t *DidCreateFilesNotification) isNotification() {} +func (t DidCreateFilesNotification) isMessage() {} +func (t DidCreateFilesNotification) isNotification() {} func (t *DidCreateFilesNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18220,8 +18220,8 @@ type DidDeleteFilesNotification struct { Method string `json:"method"` Params DeleteFilesParams `json:"params"` } -func (t *DidDeleteFilesNotification) isMessage() {} -func (t *DidDeleteFilesNotification) isNotification() {} +func (t DidDeleteFilesNotification) isMessage() {} +func (t DidDeleteFilesNotification) isNotification() {} func (t *DidDeleteFilesNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18252,8 +18252,8 @@ type DidRenameFilesNotification struct { Method string `json:"method"` Params RenameFilesParams `json:"params"` } -func (t *DidRenameFilesNotification) isMessage() {} -func (t *DidRenameFilesNotification) isNotification() {} +func (t DidRenameFilesNotification) isMessage() {} +func (t DidRenameFilesNotification) isNotification() {} func (t *DidRenameFilesNotification) UnmarshalJSON(x []byte) error { var m map[string]any if err := json.Unmarshal(x, &m); err != nil { @@ -18288,7 +18288,7 @@ const ( ) func (t ApplyKind) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid ApplyKind: %v", t) @@ -18373,7 +18373,7 @@ const ( ) func (t CodeActionTriggerKind) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid CodeActionTriggerKind: %v", t) @@ -18429,7 +18429,7 @@ const ( ) func (t CompletionItemKind) validate() error { switch t { - case 21,15,6,19,22,10,16,17,12,11,7,14,13,20,8,4,2,18,1,5,25,23,9,3,24: + case 7,17,3,8,20,9,1,2,4,22,15,14,23,13,21,11,25,19,12,6,24,5,16,10,18: return nil } return fmt.Errorf("invalid CompletionItemKind: %v", t) @@ -18498,7 +18498,7 @@ const ( ) func (t CompletionTriggerKind) validate() error { switch t { - case 1,2,3: + case 3,2,1: return nil } return fmt.Errorf("invalid CompletionTriggerKind: %v", t) @@ -18533,7 +18533,7 @@ const ( ) func (t DiagnosticSeverity) validate() error { switch t { - case 1,2,4,3: + case 3,2,4,1: return nil } return fmt.Errorf("invalid DiagnosticSeverity: %v", t) @@ -18568,7 +18568,7 @@ const ( ) func (t DiagnosticTag) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid DiagnosticTag: %v", t) @@ -18603,7 +18603,7 @@ const ( ) func (t DocumentDiagnosticReportKind) validate() error { switch t { - case "unchanged","full": + case "full","unchanged": return nil } return fmt.Errorf("invalid DocumentDiagnosticReportKind: %v", t) @@ -18637,7 +18637,7 @@ const ( ) func (t DocumentHighlightKind) validate() error { switch t { - case 1,2,3: + case 3,2,1: return nil } return fmt.Errorf("invalid DocumentHighlightKind: %v", t) @@ -18683,7 +18683,7 @@ const ( ) func (t FailureHandlingKind) validate() error { switch t { - case "textOnlyTransactional","undo","transactional","abort": + case "textOnlyTransactional","abort","undo","transactional": return nil } return fmt.Errorf("invalid FailureHandlingKind: %v", t) @@ -18717,7 +18717,7 @@ const ( ) func (t FileChangeType) validate() error { switch t { - case 1,2,3: + case 3,2,1: return nil } return fmt.Errorf("invalid FileChangeType: %v", t) @@ -18753,7 +18753,7 @@ const ( ) func (t FileOperationPatternKind) validate() error { switch t { - case "folder","file": + case "file","folder": return nil } return fmt.Errorf("invalid FileOperationPatternKind: %v", t) @@ -18796,7 +18796,7 @@ const ( ) func (t InlayHintKind) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid InlayHintKind: %v", t) @@ -18832,7 +18832,7 @@ const ( ) func (t InlineCompletionTriggerKind) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid InlineCompletionTriggerKind: %v", t) @@ -18866,7 +18866,7 @@ const ( ) func (t InsertTextFormat) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid InsertTextFormat: %v", t) @@ -18902,7 +18902,7 @@ const ( ) func (t InsertTextMode) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid InsertTextMode: %v", t) @@ -19014,7 +19014,7 @@ const ( ) func (t MarkupKind) validate() error { switch t { - case "plaintext","markdown": + case "markdown","plaintext": return nil } return fmt.Errorf("invalid MarkupKind: %v", t) @@ -19050,7 +19050,7 @@ const ( ) func (t MessageType) validate() error { switch t { - case 1,5,4,3,2: + case 4,3,5,1,2: return nil } return fmt.Errorf("invalid MessageType: %v", t) @@ -19086,7 +19086,7 @@ const ( ) func (t MonikerKind) validate() error { switch t { - case "local","import","export": + case "import","export","local": return nil } return fmt.Errorf("invalid MonikerKind: %v", t) @@ -19121,7 +19121,7 @@ const ( ) func (t NotebookCellKind) validate() error { switch t { - case 1,2: + case 2,1: return nil } return fmt.Errorf("invalid NotebookCellKind: %v", t) @@ -19195,7 +19195,7 @@ const ( ) func (t ResourceOperationKind) validate() error { switch t { - case "create","rename","delete": + case "rename","delete","create": return nil } return fmt.Errorf("invalid ResourceOperationKind: %v", t) @@ -19283,7 +19283,7 @@ const ( ) func (t SignatureHelpTriggerKind) validate() error { switch t { - case 1,2,3: + case 3,2,1: return nil } return fmt.Errorf("invalid SignatureHelpTriggerKind: %v", t) @@ -19340,7 +19340,7 @@ const ( ) func (t SymbolKind) validate() error { switch t { - case 21,15,6,19,22,10,16,17,12,11,7,14,26,13,20,8,4,2,18,1,5,25,23,9,3,24: + case 17,3,7,8,20,9,1,2,4,26,22,15,14,23,13,21,11,25,19,12,6,24,5,16,10,18: return nil } return fmt.Errorf("invalid SymbolKind: %v", t) @@ -19408,7 +19408,7 @@ const ( ) func (t TextDocumentSaveReason) validate() error { switch t { - case 1,2,3: + case 3,2,1: return nil } return fmt.Errorf("invalid TextDocumentSaveReason: %v", t) @@ -19443,7 +19443,7 @@ const ( ) func (t TextDocumentSyncKind) validate() error { switch t { - case 0,1,2: + case 0,2,1: return nil } return fmt.Errorf("invalid TextDocumentSyncKind: %v", t) @@ -19507,7 +19507,7 @@ const ( ) func (t TraceValue) validate() error { switch t { - case "messages","off","verbose": + case "verbose","off","messages": return nil } return fmt.Errorf("invalid TraceValue: %v", t) @@ -19545,7 +19545,7 @@ const ( ) func (t UniquenessLevel) validate() error { switch t { - case "document","global","scheme","project","group": + case "scheme","document","project","group","global": return nil } return fmt.Errorf("invalid UniquenessLevel: %v", t) diff --git a/protocol/utils.go b/protocol/utils.go new file mode 100644 index 0000000..866a1e1 --- /dev/null +++ b/protocol/utils.go @@ -0,0 +1,93 @@ +package protocol + +import ( + "bytes" + "encoding/json" + "fmt" + "strconv" +) + +// Helper function that takes in a full jsonrpc message, and returns +// the corresponding message struct +func DecodeMessage(message []byte) (Message, error) { + _, contentLength, content, err := SplitMessage(message) + + if err != nil { + return nil, err + } + var temp map[string]any + + if err := json.Unmarshal(content[:contentLength], &temp); err != nil { + return nil, err + } + + method, exists := temp["method"] + + if !exists { + return nil, fmt.Errorf("Missing method from request") + } + + result, err := MessageRegistry[method.(string)](content) + + if err != nil { + return nil, err + } + + return result, nil +} + +// Helper function that can be used as a split function in a scanner +func Split(data []byte, atEOF bool) (advance int, token []byte, err error) { + totalLength, contentLength, content, err := SplitMessage(data) + + if err != nil { + return 0, nil, err + } + + if contentLength < len(content) { + return 0, nil, nil + } + + return totalLength, data[:totalLength], nil +} + +// Helper function that produces a ResponseError +func Error(code int32, err error) ResponseError { + return ResponseError{ + Code: code, + Message: err.Error(), + } +} + +// Helper function that takes in a jsonrpc message, and returns +// the following: +// [ +// +// full length of the message, +// the content length, +// the content itself as an array of bytes, +// an error if something went wrong +// +// ] +func SplitMessage(data []byte) (int, int, []byte, error) { + headerPart, content, found := bytes.Cut(data, []byte{'\r', '\n', '\r', '\n'}) + + if !found { + return -1, -1, nil, fmt.Errorf("invalid message format") + } + + var contentLength int + for header := range bytes.SplitSeq(headerPart, []byte{'\r', '\n'}) { + if bytes.HasPrefix(header, []byte("Content-Type: ")) { + continue + } + + length, err := strconv.Atoi(string(header[len("Content-Length: "):])) + if err != nil { + return -1, -1, nil, fmt.Errorf("invalid content length: %s", err) + } + contentLength = length + } + + return len(data), contentLength, content, nil +} diff --git a/protocol/utils_test.go b/protocol/utils_test.go new file mode 100644 index 0000000..2c41c77 --- /dev/null +++ b/protocol/utils_test.go @@ -0,0 +1,39 @@ +package protocol + +import ( + "fmt" + "strconv" + "testing" +) + +func TestDecodeNotification(t *testing.T) { + content := []byte("{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"workspace/codeLens/refresh\", \"params\": null}") + requestMessage := []byte("Content-Length: " + strconv.Itoa(len(content)) + "\r\n\r\n" + string(content)) + + message, err := DecodeMessage(requestMessage) + + if err != nil { + t.Fatal(err) + } + + if _, check := message.(CodeLensRefreshRequest); !check { + fmt.Printf("Unexpected message type: %T", message) + t.Fatal("Expected CodeLensRefreshRequest") + } +} + +func TestDecodeRequest(t *testing.T) { + content := []byte("{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"workspace/diagnostic\", \"params\": {\"previousResultIds\": []}}") + requestMessage := []byte("Content-Length: " + strconv.Itoa(len(content)) + "\r\n\r\n" + string(content)) + + message, err := DecodeMessage(requestMessage) + + if err != nil { + t.Fatal(err) + } + + if _, check := message.(WorkspaceDiagnosticRequest); !check { + fmt.Printf("Unexpected message type: %T", message) + t.Fatal("Expected WorkspaceDiagnosticRequest") + } +}