golang.org/x/tools/gopls@v0.15.3/internal/protocol/tsserver.go (about)

     1  // Copyright 2023 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated for LSP. DO NOT EDIT.
     6  
     7  package protocol
     8  
     9  // Code generated from protocol/metaModel.json at ref release/protocol/3.17.6-next.1 (hash d2c907f450cb6d3baff74b31b432b90786d2c3b0).
    10  // https://github.com/microsoft/vscode-languageserver-node/blob/release/protocol/3.17.6-next.1/protocol/metaModel.json
    11  // LSP metaData.version = 3.17.0.
    12  
    13  import (
    14  	"context"
    15  
    16  	"golang.org/x/tools/internal/jsonrpc2"
    17  )
    18  
    19  type Server interface {
    20  	Progress(context.Context, *ProgressParams) error                                                             // $/progress
    21  	SetTrace(context.Context, *SetTraceParams) error                                                             // $/setTrace
    22  	IncomingCalls(context.Context, *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall, error)       // callHierarchy/incomingCalls
    23  	OutgoingCalls(context.Context, *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall, error)       // callHierarchy/outgoingCalls
    24  	ResolveCodeAction(context.Context, *CodeAction) (*CodeAction, error)                                         // codeAction/resolve
    25  	ResolveCodeLens(context.Context, *CodeLens) (*CodeLens, error)                                               // codeLens/resolve
    26  	ResolveCompletionItem(context.Context, *CompletionItem) (*CompletionItem, error)                             // completionItem/resolve
    27  	ResolveDocumentLink(context.Context, *DocumentLink) (*DocumentLink, error)                                   // documentLink/resolve
    28  	Exit(context.Context) error                                                                                  // exit
    29  	Initialize(context.Context, *ParamInitialize) (*InitializeResult, error)                                     // initialize
    30  	Initialized(context.Context, *InitializedParams) error                                                       // initialized
    31  	Resolve(context.Context, *InlayHint) (*InlayHint, error)                                                     // inlayHint/resolve
    32  	DidChangeNotebookDocument(context.Context, *DidChangeNotebookDocumentParams) error                           // notebookDocument/didChange
    33  	DidCloseNotebookDocument(context.Context, *DidCloseNotebookDocumentParams) error                             // notebookDocument/didClose
    34  	DidOpenNotebookDocument(context.Context, *DidOpenNotebookDocumentParams) error                               // notebookDocument/didOpen
    35  	DidSaveNotebookDocument(context.Context, *DidSaveNotebookDocumentParams) error                               // notebookDocument/didSave
    36  	Shutdown(context.Context) error                                                                              // shutdown
    37  	CodeAction(context.Context, *CodeActionParams) ([]CodeAction, error)                                         // textDocument/codeAction
    38  	CodeLens(context.Context, *CodeLensParams) ([]CodeLens, error)                                               // textDocument/codeLens
    39  	ColorPresentation(context.Context, *ColorPresentationParams) ([]ColorPresentation, error)                    // textDocument/colorPresentation
    40  	Completion(context.Context, *CompletionParams) (*CompletionList, error)                                      // textDocument/completion
    41  	Declaration(context.Context, *DeclarationParams) (*Or_textDocument_declaration, error)                       // textDocument/declaration
    42  	Definition(context.Context, *DefinitionParams) ([]Location, error)                                           // textDocument/definition
    43  	Diagnostic(context.Context, *string) (*string, error)                                                        // textDocument/diagnostic
    44  	DidChange(context.Context, *DidChangeTextDocumentParams) error                                               // textDocument/didChange
    45  	DidClose(context.Context, *DidCloseTextDocumentParams) error                                                 // textDocument/didClose
    46  	DidOpen(context.Context, *DidOpenTextDocumentParams) error                                                   // textDocument/didOpen
    47  	DidSave(context.Context, *DidSaveTextDocumentParams) error                                                   // textDocument/didSave
    48  	DocumentColor(context.Context, *DocumentColorParams) ([]ColorInformation, error)                             // textDocument/documentColor
    49  	DocumentHighlight(context.Context, *DocumentHighlightParams) ([]DocumentHighlight, error)                    // textDocument/documentHighlight
    50  	DocumentLink(context.Context, *DocumentLinkParams) ([]DocumentLink, error)                                   // textDocument/documentLink
    51  	DocumentSymbol(context.Context, *DocumentSymbolParams) ([]interface{}, error)                                // textDocument/documentSymbol
    52  	FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange, error)                                   // textDocument/foldingRange
    53  	Formatting(context.Context, *DocumentFormattingParams) ([]TextEdit, error)                                   // textDocument/formatting
    54  	Hover(context.Context, *HoverParams) (*Hover, error)                                                         // textDocument/hover
    55  	Implementation(context.Context, *ImplementationParams) ([]Location, error)                                   // textDocument/implementation
    56  	InlayHint(context.Context, *InlayHintParams) ([]InlayHint, error)                                            // textDocument/inlayHint
    57  	InlineCompletion(context.Context, *InlineCompletionParams) (*Or_Result_textDocument_inlineCompletion, error) // textDocument/inlineCompletion
    58  	InlineValue(context.Context, *InlineValueParams) ([]InlineValue, error)                                      // textDocument/inlineValue
    59  	LinkedEditingRange(context.Context, *LinkedEditingRangeParams) (*LinkedEditingRanges, error)                 // textDocument/linkedEditingRange
    60  	Moniker(context.Context, *MonikerParams) ([]Moniker, error)                                                  // textDocument/moniker
    61  	OnTypeFormatting(context.Context, *DocumentOnTypeFormattingParams) ([]TextEdit, error)                       // textDocument/onTypeFormatting
    62  	PrepareCallHierarchy(context.Context, *CallHierarchyPrepareParams) ([]CallHierarchyItem, error)              // textDocument/prepareCallHierarchy
    63  	PrepareRename(context.Context, *PrepareRenameParams) (*PrepareRenameResult, error)                           // textDocument/prepareRename
    64  	PrepareTypeHierarchy(context.Context, *TypeHierarchyPrepareParams) ([]TypeHierarchyItem, error)              // textDocument/prepareTypeHierarchy
    65  	RangeFormatting(context.Context, *DocumentRangeFormattingParams) ([]TextEdit, error)                         // textDocument/rangeFormatting
    66  	RangesFormatting(context.Context, *DocumentRangesFormattingParams) ([]TextEdit, error)                       // textDocument/rangesFormatting
    67  	References(context.Context, *ReferenceParams) ([]Location, error)                                            // textDocument/references
    68  	Rename(context.Context, *RenameParams) (*WorkspaceEdit, error)                                               // textDocument/rename
    69  	SelectionRange(context.Context, *SelectionRangeParams) ([]SelectionRange, error)                             // textDocument/selectionRange
    70  	SemanticTokensFull(context.Context, *SemanticTokensParams) (*SemanticTokens, error)                          // textDocument/semanticTokens/full
    71  	SemanticTokensFullDelta(context.Context, *SemanticTokensDeltaParams) (interface{}, error)                    // textDocument/semanticTokens/full/delta
    72  	SemanticTokensRange(context.Context, *SemanticTokensRangeParams) (*SemanticTokens, error)                    // textDocument/semanticTokens/range
    73  	SignatureHelp(context.Context, *SignatureHelpParams) (*SignatureHelp, error)                                 // textDocument/signatureHelp
    74  	TypeDefinition(context.Context, *TypeDefinitionParams) ([]Location, error)                                   // textDocument/typeDefinition
    75  	WillSave(context.Context, *WillSaveTextDocumentParams) error                                                 // textDocument/willSave
    76  	WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit, error)                          // textDocument/willSaveWaitUntil
    77  	Subtypes(context.Context, *TypeHierarchySubtypesParams) ([]TypeHierarchyItem, error)                         // typeHierarchy/subtypes
    78  	Supertypes(context.Context, *TypeHierarchySupertypesParams) ([]TypeHierarchyItem, error)                     // typeHierarchy/supertypes
    79  	WorkDoneProgressCancel(context.Context, *WorkDoneProgressCancelParams) error                                 // window/workDoneProgress/cancel
    80  	DiagnosticWorkspace(context.Context, *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error)         // workspace/diagnostic
    81  	DidChangeConfiguration(context.Context, *DidChangeConfigurationParams) error                                 // workspace/didChangeConfiguration
    82  	DidChangeWatchedFiles(context.Context, *DidChangeWatchedFilesParams) error                                   // workspace/didChangeWatchedFiles
    83  	DidChangeWorkspaceFolders(context.Context, *DidChangeWorkspaceFoldersParams) error                           // workspace/didChangeWorkspaceFolders
    84  	DidCreateFiles(context.Context, *CreateFilesParams) error                                                    // workspace/didCreateFiles
    85  	DidDeleteFiles(context.Context, *DeleteFilesParams) error                                                    // workspace/didDeleteFiles
    86  	DidRenameFiles(context.Context, *RenameFilesParams) error                                                    // workspace/didRenameFiles
    87  	ExecuteCommand(context.Context, *ExecuteCommandParams) (interface{}, error)                                  // workspace/executeCommand
    88  	Symbol(context.Context, *WorkspaceSymbolParams) ([]SymbolInformation, error)                                 // workspace/symbol
    89  	WillCreateFiles(context.Context, *CreateFilesParams) (*WorkspaceEdit, error)                                 // workspace/willCreateFiles
    90  	WillDeleteFiles(context.Context, *DeleteFilesParams) (*WorkspaceEdit, error)                                 // workspace/willDeleteFiles
    91  	WillRenameFiles(context.Context, *RenameFilesParams) (*WorkspaceEdit, error)                                 // workspace/willRenameFiles
    92  	ResolveWorkspaceSymbol(context.Context, *WorkspaceSymbol) (*WorkspaceSymbol, error)                          // workspaceSymbol/resolve
    93  
    94  }
    95  
    96  func serverDispatch(ctx context.Context, server Server, reply jsonrpc2.Replier, r jsonrpc2.Request) (bool, error) {
    97  	defer recoverHandlerPanic(r.Method())
    98  	switch r.Method() {
    99  	case "$/progress":
   100  		var params ProgressParams
   101  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   102  			return true, sendParseError(ctx, reply, err)
   103  		}
   104  		err := server.Progress(ctx, &params)
   105  		return true, reply(ctx, nil, err)
   106  
   107  	case "$/setTrace":
   108  		var params SetTraceParams
   109  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   110  			return true, sendParseError(ctx, reply, err)
   111  		}
   112  		err := server.SetTrace(ctx, &params)
   113  		return true, reply(ctx, nil, err)
   114  
   115  	case "callHierarchy/incomingCalls":
   116  		var params CallHierarchyIncomingCallsParams
   117  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   118  			return true, sendParseError(ctx, reply, err)
   119  		}
   120  		resp, err := server.IncomingCalls(ctx, &params)
   121  		if err != nil {
   122  			return true, reply(ctx, nil, err)
   123  		}
   124  		return true, reply(ctx, resp, nil)
   125  
   126  	case "callHierarchy/outgoingCalls":
   127  		var params CallHierarchyOutgoingCallsParams
   128  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   129  			return true, sendParseError(ctx, reply, err)
   130  		}
   131  		resp, err := server.OutgoingCalls(ctx, &params)
   132  		if err != nil {
   133  			return true, reply(ctx, nil, err)
   134  		}
   135  		return true, reply(ctx, resp, nil)
   136  
   137  	case "codeAction/resolve":
   138  		var params CodeAction
   139  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   140  			return true, sendParseError(ctx, reply, err)
   141  		}
   142  		resp, err := server.ResolveCodeAction(ctx, &params)
   143  		if err != nil {
   144  			return true, reply(ctx, nil, err)
   145  		}
   146  		return true, reply(ctx, resp, nil)
   147  
   148  	case "codeLens/resolve":
   149  		var params CodeLens
   150  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   151  			return true, sendParseError(ctx, reply, err)
   152  		}
   153  		resp, err := server.ResolveCodeLens(ctx, &params)
   154  		if err != nil {
   155  			return true, reply(ctx, nil, err)
   156  		}
   157  		return true, reply(ctx, resp, nil)
   158  
   159  	case "completionItem/resolve":
   160  		var params CompletionItem
   161  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   162  			return true, sendParseError(ctx, reply, err)
   163  		}
   164  		resp, err := server.ResolveCompletionItem(ctx, &params)
   165  		if err != nil {
   166  			return true, reply(ctx, nil, err)
   167  		}
   168  		return true, reply(ctx, resp, nil)
   169  
   170  	case "documentLink/resolve":
   171  		var params DocumentLink
   172  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   173  			return true, sendParseError(ctx, reply, err)
   174  		}
   175  		resp, err := server.ResolveDocumentLink(ctx, &params)
   176  		if err != nil {
   177  			return true, reply(ctx, nil, err)
   178  		}
   179  		return true, reply(ctx, resp, nil)
   180  
   181  	case "exit":
   182  		err := server.Exit(ctx)
   183  		return true, reply(ctx, nil, err)
   184  
   185  	case "initialize":
   186  		var params ParamInitialize
   187  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   188  			return true, sendParseError(ctx, reply, err)
   189  		}
   190  		resp, err := server.Initialize(ctx, &params)
   191  		if err != nil {
   192  			return true, reply(ctx, nil, err)
   193  		}
   194  		return true, reply(ctx, resp, nil)
   195  
   196  	case "initialized":
   197  		var params InitializedParams
   198  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   199  			return true, sendParseError(ctx, reply, err)
   200  		}
   201  		err := server.Initialized(ctx, &params)
   202  		return true, reply(ctx, nil, err)
   203  
   204  	case "inlayHint/resolve":
   205  		var params InlayHint
   206  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   207  			return true, sendParseError(ctx, reply, err)
   208  		}
   209  		resp, err := server.Resolve(ctx, &params)
   210  		if err != nil {
   211  			return true, reply(ctx, nil, err)
   212  		}
   213  		return true, reply(ctx, resp, nil)
   214  
   215  	case "notebookDocument/didChange":
   216  		var params DidChangeNotebookDocumentParams
   217  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   218  			return true, sendParseError(ctx, reply, err)
   219  		}
   220  		err := server.DidChangeNotebookDocument(ctx, &params)
   221  		return true, reply(ctx, nil, err)
   222  
   223  	case "notebookDocument/didClose":
   224  		var params DidCloseNotebookDocumentParams
   225  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   226  			return true, sendParseError(ctx, reply, err)
   227  		}
   228  		err := server.DidCloseNotebookDocument(ctx, &params)
   229  		return true, reply(ctx, nil, err)
   230  
   231  	case "notebookDocument/didOpen":
   232  		var params DidOpenNotebookDocumentParams
   233  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   234  			return true, sendParseError(ctx, reply, err)
   235  		}
   236  		err := server.DidOpenNotebookDocument(ctx, &params)
   237  		return true, reply(ctx, nil, err)
   238  
   239  	case "notebookDocument/didSave":
   240  		var params DidSaveNotebookDocumentParams
   241  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   242  			return true, sendParseError(ctx, reply, err)
   243  		}
   244  		err := server.DidSaveNotebookDocument(ctx, &params)
   245  		return true, reply(ctx, nil, err)
   246  
   247  	case "shutdown":
   248  		err := server.Shutdown(ctx)
   249  		return true, reply(ctx, nil, err)
   250  
   251  	case "textDocument/codeAction":
   252  		var params CodeActionParams
   253  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   254  			return true, sendParseError(ctx, reply, err)
   255  		}
   256  		resp, err := server.CodeAction(ctx, &params)
   257  		if err != nil {
   258  			return true, reply(ctx, nil, err)
   259  		}
   260  		return true, reply(ctx, resp, nil)
   261  
   262  	case "textDocument/codeLens":
   263  		var params CodeLensParams
   264  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   265  			return true, sendParseError(ctx, reply, err)
   266  		}
   267  		resp, err := server.CodeLens(ctx, &params)
   268  		if err != nil {
   269  			return true, reply(ctx, nil, err)
   270  		}
   271  		return true, reply(ctx, resp, nil)
   272  
   273  	case "textDocument/colorPresentation":
   274  		var params ColorPresentationParams
   275  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   276  			return true, sendParseError(ctx, reply, err)
   277  		}
   278  		resp, err := server.ColorPresentation(ctx, &params)
   279  		if err != nil {
   280  			return true, reply(ctx, nil, err)
   281  		}
   282  		return true, reply(ctx, resp, nil)
   283  
   284  	case "textDocument/completion":
   285  		var params CompletionParams
   286  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   287  			return true, sendParseError(ctx, reply, err)
   288  		}
   289  		resp, err := server.Completion(ctx, &params)
   290  		if err != nil {
   291  			return true, reply(ctx, nil, err)
   292  		}
   293  		return true, reply(ctx, resp, nil)
   294  
   295  	case "textDocument/declaration":
   296  		var params DeclarationParams
   297  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   298  			return true, sendParseError(ctx, reply, err)
   299  		}
   300  		resp, err := server.Declaration(ctx, &params)
   301  		if err != nil {
   302  			return true, reply(ctx, nil, err)
   303  		}
   304  		return true, reply(ctx, resp, nil)
   305  
   306  	case "textDocument/definition":
   307  		var params DefinitionParams
   308  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   309  			return true, sendParseError(ctx, reply, err)
   310  		}
   311  		resp, err := server.Definition(ctx, &params)
   312  		if err != nil {
   313  			return true, reply(ctx, nil, err)
   314  		}
   315  		return true, reply(ctx, resp, nil)
   316  
   317  	case "textDocument/diagnostic":
   318  		var params string
   319  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   320  			return true, sendParseError(ctx, reply, err)
   321  		}
   322  		resp, err := server.Diagnostic(ctx, &params)
   323  		if err != nil {
   324  			return true, reply(ctx, nil, err)
   325  		}
   326  		return true, reply(ctx, resp, nil)
   327  
   328  	case "textDocument/didChange":
   329  		var params DidChangeTextDocumentParams
   330  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   331  			return true, sendParseError(ctx, reply, err)
   332  		}
   333  		err := server.DidChange(ctx, &params)
   334  		return true, reply(ctx, nil, err)
   335  
   336  	case "textDocument/didClose":
   337  		var params DidCloseTextDocumentParams
   338  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   339  			return true, sendParseError(ctx, reply, err)
   340  		}
   341  		err := server.DidClose(ctx, &params)
   342  		return true, reply(ctx, nil, err)
   343  
   344  	case "textDocument/didOpen":
   345  		var params DidOpenTextDocumentParams
   346  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   347  			return true, sendParseError(ctx, reply, err)
   348  		}
   349  		err := server.DidOpen(ctx, &params)
   350  		return true, reply(ctx, nil, err)
   351  
   352  	case "textDocument/didSave":
   353  		var params DidSaveTextDocumentParams
   354  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   355  			return true, sendParseError(ctx, reply, err)
   356  		}
   357  		err := server.DidSave(ctx, &params)
   358  		return true, reply(ctx, nil, err)
   359  
   360  	case "textDocument/documentColor":
   361  		var params DocumentColorParams
   362  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   363  			return true, sendParseError(ctx, reply, err)
   364  		}
   365  		resp, err := server.DocumentColor(ctx, &params)
   366  		if err != nil {
   367  			return true, reply(ctx, nil, err)
   368  		}
   369  		return true, reply(ctx, resp, nil)
   370  
   371  	case "textDocument/documentHighlight":
   372  		var params DocumentHighlightParams
   373  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   374  			return true, sendParseError(ctx, reply, err)
   375  		}
   376  		resp, err := server.DocumentHighlight(ctx, &params)
   377  		if err != nil {
   378  			return true, reply(ctx, nil, err)
   379  		}
   380  		return true, reply(ctx, resp, nil)
   381  
   382  	case "textDocument/documentLink":
   383  		var params DocumentLinkParams
   384  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   385  			return true, sendParseError(ctx, reply, err)
   386  		}
   387  		resp, err := server.DocumentLink(ctx, &params)
   388  		if err != nil {
   389  			return true, reply(ctx, nil, err)
   390  		}
   391  		return true, reply(ctx, resp, nil)
   392  
   393  	case "textDocument/documentSymbol":
   394  		var params DocumentSymbolParams
   395  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   396  			return true, sendParseError(ctx, reply, err)
   397  		}
   398  		resp, err := server.DocumentSymbol(ctx, &params)
   399  		if err != nil {
   400  			return true, reply(ctx, nil, err)
   401  		}
   402  		return true, reply(ctx, resp, nil)
   403  
   404  	case "textDocument/foldingRange":
   405  		var params FoldingRangeParams
   406  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   407  			return true, sendParseError(ctx, reply, err)
   408  		}
   409  		resp, err := server.FoldingRange(ctx, &params)
   410  		if err != nil {
   411  			return true, reply(ctx, nil, err)
   412  		}
   413  		return true, reply(ctx, resp, nil)
   414  
   415  	case "textDocument/formatting":
   416  		var params DocumentFormattingParams
   417  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   418  			return true, sendParseError(ctx, reply, err)
   419  		}
   420  		resp, err := server.Formatting(ctx, &params)
   421  		if err != nil {
   422  			return true, reply(ctx, nil, err)
   423  		}
   424  		return true, reply(ctx, resp, nil)
   425  
   426  	case "textDocument/hover":
   427  		var params HoverParams
   428  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   429  			return true, sendParseError(ctx, reply, err)
   430  		}
   431  		resp, err := server.Hover(ctx, &params)
   432  		if err != nil {
   433  			return true, reply(ctx, nil, err)
   434  		}
   435  		return true, reply(ctx, resp, nil)
   436  
   437  	case "textDocument/implementation":
   438  		var params ImplementationParams
   439  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   440  			return true, sendParseError(ctx, reply, err)
   441  		}
   442  		resp, err := server.Implementation(ctx, &params)
   443  		if err != nil {
   444  			return true, reply(ctx, nil, err)
   445  		}
   446  		return true, reply(ctx, resp, nil)
   447  
   448  	case "textDocument/inlayHint":
   449  		var params InlayHintParams
   450  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   451  			return true, sendParseError(ctx, reply, err)
   452  		}
   453  		resp, err := server.InlayHint(ctx, &params)
   454  		if err != nil {
   455  			return true, reply(ctx, nil, err)
   456  		}
   457  		return true, reply(ctx, resp, nil)
   458  
   459  	case "textDocument/inlineCompletion":
   460  		var params InlineCompletionParams
   461  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   462  			return true, sendParseError(ctx, reply, err)
   463  		}
   464  		resp, err := server.InlineCompletion(ctx, &params)
   465  		if err != nil {
   466  			return true, reply(ctx, nil, err)
   467  		}
   468  		return true, reply(ctx, resp, nil)
   469  
   470  	case "textDocument/inlineValue":
   471  		var params InlineValueParams
   472  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   473  			return true, sendParseError(ctx, reply, err)
   474  		}
   475  		resp, err := server.InlineValue(ctx, &params)
   476  		if err != nil {
   477  			return true, reply(ctx, nil, err)
   478  		}
   479  		return true, reply(ctx, resp, nil)
   480  
   481  	case "textDocument/linkedEditingRange":
   482  		var params LinkedEditingRangeParams
   483  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   484  			return true, sendParseError(ctx, reply, err)
   485  		}
   486  		resp, err := server.LinkedEditingRange(ctx, &params)
   487  		if err != nil {
   488  			return true, reply(ctx, nil, err)
   489  		}
   490  		return true, reply(ctx, resp, nil)
   491  
   492  	case "textDocument/moniker":
   493  		var params MonikerParams
   494  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   495  			return true, sendParseError(ctx, reply, err)
   496  		}
   497  		resp, err := server.Moniker(ctx, &params)
   498  		if err != nil {
   499  			return true, reply(ctx, nil, err)
   500  		}
   501  		return true, reply(ctx, resp, nil)
   502  
   503  	case "textDocument/onTypeFormatting":
   504  		var params DocumentOnTypeFormattingParams
   505  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   506  			return true, sendParseError(ctx, reply, err)
   507  		}
   508  		resp, err := server.OnTypeFormatting(ctx, &params)
   509  		if err != nil {
   510  			return true, reply(ctx, nil, err)
   511  		}
   512  		return true, reply(ctx, resp, nil)
   513  
   514  	case "textDocument/prepareCallHierarchy":
   515  		var params CallHierarchyPrepareParams
   516  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   517  			return true, sendParseError(ctx, reply, err)
   518  		}
   519  		resp, err := server.PrepareCallHierarchy(ctx, &params)
   520  		if err != nil {
   521  			return true, reply(ctx, nil, err)
   522  		}
   523  		return true, reply(ctx, resp, nil)
   524  
   525  	case "textDocument/prepareRename":
   526  		var params PrepareRenameParams
   527  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   528  			return true, sendParseError(ctx, reply, err)
   529  		}
   530  		resp, err := server.PrepareRename(ctx, &params)
   531  		if err != nil {
   532  			return true, reply(ctx, nil, err)
   533  		}
   534  		return true, reply(ctx, resp, nil)
   535  
   536  	case "textDocument/prepareTypeHierarchy":
   537  		var params TypeHierarchyPrepareParams
   538  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   539  			return true, sendParseError(ctx, reply, err)
   540  		}
   541  		resp, err := server.PrepareTypeHierarchy(ctx, &params)
   542  		if err != nil {
   543  			return true, reply(ctx, nil, err)
   544  		}
   545  		return true, reply(ctx, resp, nil)
   546  
   547  	case "textDocument/rangeFormatting":
   548  		var params DocumentRangeFormattingParams
   549  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   550  			return true, sendParseError(ctx, reply, err)
   551  		}
   552  		resp, err := server.RangeFormatting(ctx, &params)
   553  		if err != nil {
   554  			return true, reply(ctx, nil, err)
   555  		}
   556  		return true, reply(ctx, resp, nil)
   557  
   558  	case "textDocument/rangesFormatting":
   559  		var params DocumentRangesFormattingParams
   560  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   561  			return true, sendParseError(ctx, reply, err)
   562  		}
   563  		resp, err := server.RangesFormatting(ctx, &params)
   564  		if err != nil {
   565  			return true, reply(ctx, nil, err)
   566  		}
   567  		return true, reply(ctx, resp, nil)
   568  
   569  	case "textDocument/references":
   570  		var params ReferenceParams
   571  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   572  			return true, sendParseError(ctx, reply, err)
   573  		}
   574  		resp, err := server.References(ctx, &params)
   575  		if err != nil {
   576  			return true, reply(ctx, nil, err)
   577  		}
   578  		return true, reply(ctx, resp, nil)
   579  
   580  	case "textDocument/rename":
   581  		var params RenameParams
   582  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   583  			return true, sendParseError(ctx, reply, err)
   584  		}
   585  		resp, err := server.Rename(ctx, &params)
   586  		if err != nil {
   587  			return true, reply(ctx, nil, err)
   588  		}
   589  		return true, reply(ctx, resp, nil)
   590  
   591  	case "textDocument/selectionRange":
   592  		var params SelectionRangeParams
   593  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   594  			return true, sendParseError(ctx, reply, err)
   595  		}
   596  		resp, err := server.SelectionRange(ctx, &params)
   597  		if err != nil {
   598  			return true, reply(ctx, nil, err)
   599  		}
   600  		return true, reply(ctx, resp, nil)
   601  
   602  	case "textDocument/semanticTokens/full":
   603  		var params SemanticTokensParams
   604  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   605  			return true, sendParseError(ctx, reply, err)
   606  		}
   607  		resp, err := server.SemanticTokensFull(ctx, &params)
   608  		if err != nil {
   609  			return true, reply(ctx, nil, err)
   610  		}
   611  		return true, reply(ctx, resp, nil)
   612  
   613  	case "textDocument/semanticTokens/full/delta":
   614  		var params SemanticTokensDeltaParams
   615  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   616  			return true, sendParseError(ctx, reply, err)
   617  		}
   618  		resp, err := server.SemanticTokensFullDelta(ctx, &params)
   619  		if err != nil {
   620  			return true, reply(ctx, nil, err)
   621  		}
   622  		return true, reply(ctx, resp, nil)
   623  
   624  	case "textDocument/semanticTokens/range":
   625  		var params SemanticTokensRangeParams
   626  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   627  			return true, sendParseError(ctx, reply, err)
   628  		}
   629  		resp, err := server.SemanticTokensRange(ctx, &params)
   630  		if err != nil {
   631  			return true, reply(ctx, nil, err)
   632  		}
   633  		return true, reply(ctx, resp, nil)
   634  
   635  	case "textDocument/signatureHelp":
   636  		var params SignatureHelpParams
   637  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   638  			return true, sendParseError(ctx, reply, err)
   639  		}
   640  		resp, err := server.SignatureHelp(ctx, &params)
   641  		if err != nil {
   642  			return true, reply(ctx, nil, err)
   643  		}
   644  		return true, reply(ctx, resp, nil)
   645  
   646  	case "textDocument/typeDefinition":
   647  		var params TypeDefinitionParams
   648  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   649  			return true, sendParseError(ctx, reply, err)
   650  		}
   651  		resp, err := server.TypeDefinition(ctx, &params)
   652  		if err != nil {
   653  			return true, reply(ctx, nil, err)
   654  		}
   655  		return true, reply(ctx, resp, nil)
   656  
   657  	case "textDocument/willSave":
   658  		var params WillSaveTextDocumentParams
   659  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   660  			return true, sendParseError(ctx, reply, err)
   661  		}
   662  		err := server.WillSave(ctx, &params)
   663  		return true, reply(ctx, nil, err)
   664  
   665  	case "textDocument/willSaveWaitUntil":
   666  		var params WillSaveTextDocumentParams
   667  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   668  			return true, sendParseError(ctx, reply, err)
   669  		}
   670  		resp, err := server.WillSaveWaitUntil(ctx, &params)
   671  		if err != nil {
   672  			return true, reply(ctx, nil, err)
   673  		}
   674  		return true, reply(ctx, resp, nil)
   675  
   676  	case "typeHierarchy/subtypes":
   677  		var params TypeHierarchySubtypesParams
   678  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   679  			return true, sendParseError(ctx, reply, err)
   680  		}
   681  		resp, err := server.Subtypes(ctx, &params)
   682  		if err != nil {
   683  			return true, reply(ctx, nil, err)
   684  		}
   685  		return true, reply(ctx, resp, nil)
   686  
   687  	case "typeHierarchy/supertypes":
   688  		var params TypeHierarchySupertypesParams
   689  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   690  			return true, sendParseError(ctx, reply, err)
   691  		}
   692  		resp, err := server.Supertypes(ctx, &params)
   693  		if err != nil {
   694  			return true, reply(ctx, nil, err)
   695  		}
   696  		return true, reply(ctx, resp, nil)
   697  
   698  	case "window/workDoneProgress/cancel":
   699  		var params WorkDoneProgressCancelParams
   700  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   701  			return true, sendParseError(ctx, reply, err)
   702  		}
   703  		err := server.WorkDoneProgressCancel(ctx, &params)
   704  		return true, reply(ctx, nil, err)
   705  
   706  	case "workspace/diagnostic":
   707  		var params WorkspaceDiagnosticParams
   708  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   709  			return true, sendParseError(ctx, reply, err)
   710  		}
   711  		resp, err := server.DiagnosticWorkspace(ctx, &params)
   712  		if err != nil {
   713  			return true, reply(ctx, nil, err)
   714  		}
   715  		return true, reply(ctx, resp, nil)
   716  
   717  	case "workspace/didChangeConfiguration":
   718  		var params DidChangeConfigurationParams
   719  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   720  			return true, sendParseError(ctx, reply, err)
   721  		}
   722  		err := server.DidChangeConfiguration(ctx, &params)
   723  		return true, reply(ctx, nil, err)
   724  
   725  	case "workspace/didChangeWatchedFiles":
   726  		var params DidChangeWatchedFilesParams
   727  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   728  			return true, sendParseError(ctx, reply, err)
   729  		}
   730  		err := server.DidChangeWatchedFiles(ctx, &params)
   731  		return true, reply(ctx, nil, err)
   732  
   733  	case "workspace/didChangeWorkspaceFolders":
   734  		var params DidChangeWorkspaceFoldersParams
   735  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   736  			return true, sendParseError(ctx, reply, err)
   737  		}
   738  		err := server.DidChangeWorkspaceFolders(ctx, &params)
   739  		return true, reply(ctx, nil, err)
   740  
   741  	case "workspace/didCreateFiles":
   742  		var params CreateFilesParams
   743  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   744  			return true, sendParseError(ctx, reply, err)
   745  		}
   746  		err := server.DidCreateFiles(ctx, &params)
   747  		return true, reply(ctx, nil, err)
   748  
   749  	case "workspace/didDeleteFiles":
   750  		var params DeleteFilesParams
   751  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   752  			return true, sendParseError(ctx, reply, err)
   753  		}
   754  		err := server.DidDeleteFiles(ctx, &params)
   755  		return true, reply(ctx, nil, err)
   756  
   757  	case "workspace/didRenameFiles":
   758  		var params RenameFilesParams
   759  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   760  			return true, sendParseError(ctx, reply, err)
   761  		}
   762  		err := server.DidRenameFiles(ctx, &params)
   763  		return true, reply(ctx, nil, err)
   764  
   765  	case "workspace/executeCommand":
   766  		var params ExecuteCommandParams
   767  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   768  			return true, sendParseError(ctx, reply, err)
   769  		}
   770  		resp, err := server.ExecuteCommand(ctx, &params)
   771  		if err != nil {
   772  			return true, reply(ctx, nil, err)
   773  		}
   774  		return true, reply(ctx, resp, nil)
   775  
   776  	case "workspace/symbol":
   777  		var params WorkspaceSymbolParams
   778  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   779  			return true, sendParseError(ctx, reply, err)
   780  		}
   781  		resp, err := server.Symbol(ctx, &params)
   782  		if err != nil {
   783  			return true, reply(ctx, nil, err)
   784  		}
   785  		return true, reply(ctx, resp, nil)
   786  
   787  	case "workspace/willCreateFiles":
   788  		var params CreateFilesParams
   789  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   790  			return true, sendParseError(ctx, reply, err)
   791  		}
   792  		resp, err := server.WillCreateFiles(ctx, &params)
   793  		if err != nil {
   794  			return true, reply(ctx, nil, err)
   795  		}
   796  		return true, reply(ctx, resp, nil)
   797  
   798  	case "workspace/willDeleteFiles":
   799  		var params DeleteFilesParams
   800  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   801  			return true, sendParseError(ctx, reply, err)
   802  		}
   803  		resp, err := server.WillDeleteFiles(ctx, &params)
   804  		if err != nil {
   805  			return true, reply(ctx, nil, err)
   806  		}
   807  		return true, reply(ctx, resp, nil)
   808  
   809  	case "workspace/willRenameFiles":
   810  		var params RenameFilesParams
   811  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   812  			return true, sendParseError(ctx, reply, err)
   813  		}
   814  		resp, err := server.WillRenameFiles(ctx, &params)
   815  		if err != nil {
   816  			return true, reply(ctx, nil, err)
   817  		}
   818  		return true, reply(ctx, resp, nil)
   819  
   820  	case "workspaceSymbol/resolve":
   821  		var params WorkspaceSymbol
   822  		if err := UnmarshalJSON(r.Params(), &params); err != nil {
   823  			return true, sendParseError(ctx, reply, err)
   824  		}
   825  		resp, err := server.ResolveWorkspaceSymbol(ctx, &params)
   826  		if err != nil {
   827  			return true, reply(ctx, nil, err)
   828  		}
   829  		return true, reply(ctx, resp, nil)
   830  
   831  	default:
   832  		return false, nil
   833  	}
   834  }
   835  
   836  func (s *serverDispatcher) Progress(ctx context.Context, params *ProgressParams) error {
   837  	return s.sender.Notify(ctx, "$/progress", params)
   838  }
   839  func (s *serverDispatcher) SetTrace(ctx context.Context, params *SetTraceParams) error {
   840  	return s.sender.Notify(ctx, "$/setTrace", params)
   841  }
   842  func (s *serverDispatcher) IncomingCalls(ctx context.Context, params *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall, error) {
   843  	var result []CallHierarchyIncomingCall
   844  	if err := s.sender.Call(ctx, "callHierarchy/incomingCalls", params, &result); err != nil {
   845  		return nil, err
   846  	}
   847  	return result, nil
   848  }
   849  func (s *serverDispatcher) OutgoingCalls(ctx context.Context, params *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall, error) {
   850  	var result []CallHierarchyOutgoingCall
   851  	if err := s.sender.Call(ctx, "callHierarchy/outgoingCalls", params, &result); err != nil {
   852  		return nil, err
   853  	}
   854  	return result, nil
   855  }
   856  func (s *serverDispatcher) ResolveCodeAction(ctx context.Context, params *CodeAction) (*CodeAction, error) {
   857  	var result *CodeAction
   858  	if err := s.sender.Call(ctx, "codeAction/resolve", params, &result); err != nil {
   859  		return nil, err
   860  	}
   861  	return result, nil
   862  }
   863  func (s *serverDispatcher) ResolveCodeLens(ctx context.Context, params *CodeLens) (*CodeLens, error) {
   864  	var result *CodeLens
   865  	if err := s.sender.Call(ctx, "codeLens/resolve", params, &result); err != nil {
   866  		return nil, err
   867  	}
   868  	return result, nil
   869  }
   870  func (s *serverDispatcher) ResolveCompletionItem(ctx context.Context, params *CompletionItem) (*CompletionItem, error) {
   871  	var result *CompletionItem
   872  	if err := s.sender.Call(ctx, "completionItem/resolve", params, &result); err != nil {
   873  		return nil, err
   874  	}
   875  	return result, nil
   876  }
   877  func (s *serverDispatcher) ResolveDocumentLink(ctx context.Context, params *DocumentLink) (*DocumentLink, error) {
   878  	var result *DocumentLink
   879  	if err := s.sender.Call(ctx, "documentLink/resolve", params, &result); err != nil {
   880  		return nil, err
   881  	}
   882  	return result, nil
   883  }
   884  func (s *serverDispatcher) Exit(ctx context.Context) error {
   885  	return s.sender.Notify(ctx, "exit", nil)
   886  }
   887  func (s *serverDispatcher) Initialize(ctx context.Context, params *ParamInitialize) (*InitializeResult, error) {
   888  	var result *InitializeResult
   889  	if err := s.sender.Call(ctx, "initialize", params, &result); err != nil {
   890  		return nil, err
   891  	}
   892  	return result, nil
   893  }
   894  func (s *serverDispatcher) Initialized(ctx context.Context, params *InitializedParams) error {
   895  	return s.sender.Notify(ctx, "initialized", params)
   896  }
   897  func (s *serverDispatcher) Resolve(ctx context.Context, params *InlayHint) (*InlayHint, error) {
   898  	var result *InlayHint
   899  	if err := s.sender.Call(ctx, "inlayHint/resolve", params, &result); err != nil {
   900  		return nil, err
   901  	}
   902  	return result, nil
   903  }
   904  func (s *serverDispatcher) DidChangeNotebookDocument(ctx context.Context, params *DidChangeNotebookDocumentParams) error {
   905  	return s.sender.Notify(ctx, "notebookDocument/didChange", params)
   906  }
   907  func (s *serverDispatcher) DidCloseNotebookDocument(ctx context.Context, params *DidCloseNotebookDocumentParams) error {
   908  	return s.sender.Notify(ctx, "notebookDocument/didClose", params)
   909  }
   910  func (s *serverDispatcher) DidOpenNotebookDocument(ctx context.Context, params *DidOpenNotebookDocumentParams) error {
   911  	return s.sender.Notify(ctx, "notebookDocument/didOpen", params)
   912  }
   913  func (s *serverDispatcher) DidSaveNotebookDocument(ctx context.Context, params *DidSaveNotebookDocumentParams) error {
   914  	return s.sender.Notify(ctx, "notebookDocument/didSave", params)
   915  }
   916  func (s *serverDispatcher) Shutdown(ctx context.Context) error {
   917  	return s.sender.Call(ctx, "shutdown", nil, nil)
   918  }
   919  func (s *serverDispatcher) CodeAction(ctx context.Context, params *CodeActionParams) ([]CodeAction, error) {
   920  	var result []CodeAction
   921  	if err := s.sender.Call(ctx, "textDocument/codeAction", params, &result); err != nil {
   922  		return nil, err
   923  	}
   924  	return result, nil
   925  }
   926  func (s *serverDispatcher) CodeLens(ctx context.Context, params *CodeLensParams) ([]CodeLens, error) {
   927  	var result []CodeLens
   928  	if err := s.sender.Call(ctx, "textDocument/codeLens", params, &result); err != nil {
   929  		return nil, err
   930  	}
   931  	return result, nil
   932  }
   933  func (s *serverDispatcher) ColorPresentation(ctx context.Context, params *ColorPresentationParams) ([]ColorPresentation, error) {
   934  	var result []ColorPresentation
   935  	if err := s.sender.Call(ctx, "textDocument/colorPresentation", params, &result); err != nil {
   936  		return nil, err
   937  	}
   938  	return result, nil
   939  }
   940  func (s *serverDispatcher) Completion(ctx context.Context, params *CompletionParams) (*CompletionList, error) {
   941  	var result *CompletionList
   942  	if err := s.sender.Call(ctx, "textDocument/completion", params, &result); err != nil {
   943  		return nil, err
   944  	}
   945  	return result, nil
   946  }
   947  func (s *serverDispatcher) Declaration(ctx context.Context, params *DeclarationParams) (*Or_textDocument_declaration, error) {
   948  	var result *Or_textDocument_declaration
   949  	if err := s.sender.Call(ctx, "textDocument/declaration", params, &result); err != nil {
   950  		return nil, err
   951  	}
   952  	return result, nil
   953  }
   954  func (s *serverDispatcher) Definition(ctx context.Context, params *DefinitionParams) ([]Location, error) {
   955  	var result []Location
   956  	if err := s.sender.Call(ctx, "textDocument/definition", params, &result); err != nil {
   957  		return nil, err
   958  	}
   959  	return result, nil
   960  }
   961  func (s *serverDispatcher) Diagnostic(ctx context.Context, params *string) (*string, error) {
   962  	var result *string
   963  	if err := s.sender.Call(ctx, "textDocument/diagnostic", params, &result); err != nil {
   964  		return nil, err
   965  	}
   966  	return result, nil
   967  }
   968  func (s *serverDispatcher) DidChange(ctx context.Context, params *DidChangeTextDocumentParams) error {
   969  	return s.sender.Notify(ctx, "textDocument/didChange", params)
   970  }
   971  func (s *serverDispatcher) DidClose(ctx context.Context, params *DidCloseTextDocumentParams) error {
   972  	return s.sender.Notify(ctx, "textDocument/didClose", params)
   973  }
   974  func (s *serverDispatcher) DidOpen(ctx context.Context, params *DidOpenTextDocumentParams) error {
   975  	return s.sender.Notify(ctx, "textDocument/didOpen", params)
   976  }
   977  func (s *serverDispatcher) DidSave(ctx context.Context, params *DidSaveTextDocumentParams) error {
   978  	return s.sender.Notify(ctx, "textDocument/didSave", params)
   979  }
   980  func (s *serverDispatcher) DocumentColor(ctx context.Context, params *DocumentColorParams) ([]ColorInformation, error) {
   981  	var result []ColorInformation
   982  	if err := s.sender.Call(ctx, "textDocument/documentColor", params, &result); err != nil {
   983  		return nil, err
   984  	}
   985  	return result, nil
   986  }
   987  func (s *serverDispatcher) DocumentHighlight(ctx context.Context, params *DocumentHighlightParams) ([]DocumentHighlight, error) {
   988  	var result []DocumentHighlight
   989  	if err := s.sender.Call(ctx, "textDocument/documentHighlight", params, &result); err != nil {
   990  		return nil, err
   991  	}
   992  	return result, nil
   993  }
   994  func (s *serverDispatcher) DocumentLink(ctx context.Context, params *DocumentLinkParams) ([]DocumentLink, error) {
   995  	var result []DocumentLink
   996  	if err := s.sender.Call(ctx, "textDocument/documentLink", params, &result); err != nil {
   997  		return nil, err
   998  	}
   999  	return result, nil
  1000  }
  1001  func (s *serverDispatcher) DocumentSymbol(ctx context.Context, params *DocumentSymbolParams) ([]interface{}, error) {
  1002  	var result []interface{}
  1003  	if err := s.sender.Call(ctx, "textDocument/documentSymbol", params, &result); err != nil {
  1004  		return nil, err
  1005  	}
  1006  	return result, nil
  1007  }
  1008  func (s *serverDispatcher) FoldingRange(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange, error) {
  1009  	var result []FoldingRange
  1010  	if err := s.sender.Call(ctx, "textDocument/foldingRange", params, &result); err != nil {
  1011  		return nil, err
  1012  	}
  1013  	return result, nil
  1014  }
  1015  func (s *serverDispatcher) Formatting(ctx context.Context, params *DocumentFormattingParams) ([]TextEdit, error) {
  1016  	var result []TextEdit
  1017  	if err := s.sender.Call(ctx, "textDocument/formatting", params, &result); err != nil {
  1018  		return nil, err
  1019  	}
  1020  	return result, nil
  1021  }
  1022  func (s *serverDispatcher) Hover(ctx context.Context, params *HoverParams) (*Hover, error) {
  1023  	var result *Hover
  1024  	if err := s.sender.Call(ctx, "textDocument/hover", params, &result); err != nil {
  1025  		return nil, err
  1026  	}
  1027  	return result, nil
  1028  }
  1029  func (s *serverDispatcher) Implementation(ctx context.Context, params *ImplementationParams) ([]Location, error) {
  1030  	var result []Location
  1031  	if err := s.sender.Call(ctx, "textDocument/implementation", params, &result); err != nil {
  1032  		return nil, err
  1033  	}
  1034  	return result, nil
  1035  }
  1036  func (s *serverDispatcher) InlayHint(ctx context.Context, params *InlayHintParams) ([]InlayHint, error) {
  1037  	var result []InlayHint
  1038  	if err := s.sender.Call(ctx, "textDocument/inlayHint", params, &result); err != nil {
  1039  		return nil, err
  1040  	}
  1041  	return result, nil
  1042  }
  1043  func (s *serverDispatcher) InlineCompletion(ctx context.Context, params *InlineCompletionParams) (*Or_Result_textDocument_inlineCompletion, error) {
  1044  	var result *Or_Result_textDocument_inlineCompletion
  1045  	if err := s.sender.Call(ctx, "textDocument/inlineCompletion", params, &result); err != nil {
  1046  		return nil, err
  1047  	}
  1048  	return result, nil
  1049  }
  1050  func (s *serverDispatcher) InlineValue(ctx context.Context, params *InlineValueParams) ([]InlineValue, error) {
  1051  	var result []InlineValue
  1052  	if err := s.sender.Call(ctx, "textDocument/inlineValue", params, &result); err != nil {
  1053  		return nil, err
  1054  	}
  1055  	return result, nil
  1056  }
  1057  func (s *serverDispatcher) LinkedEditingRange(ctx context.Context, params *LinkedEditingRangeParams) (*LinkedEditingRanges, error) {
  1058  	var result *LinkedEditingRanges
  1059  	if err := s.sender.Call(ctx, "textDocument/linkedEditingRange", params, &result); err != nil {
  1060  		return nil, err
  1061  	}
  1062  	return result, nil
  1063  }
  1064  func (s *serverDispatcher) Moniker(ctx context.Context, params *MonikerParams) ([]Moniker, error) {
  1065  	var result []Moniker
  1066  	if err := s.sender.Call(ctx, "textDocument/moniker", params, &result); err != nil {
  1067  		return nil, err
  1068  	}
  1069  	return result, nil
  1070  }
  1071  func (s *serverDispatcher) OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) ([]TextEdit, error) {
  1072  	var result []TextEdit
  1073  	if err := s.sender.Call(ctx, "textDocument/onTypeFormatting", params, &result); err != nil {
  1074  		return nil, err
  1075  	}
  1076  	return result, nil
  1077  }
  1078  func (s *serverDispatcher) PrepareCallHierarchy(ctx context.Context, params *CallHierarchyPrepareParams) ([]CallHierarchyItem, error) {
  1079  	var result []CallHierarchyItem
  1080  	if err := s.sender.Call(ctx, "textDocument/prepareCallHierarchy", params, &result); err != nil {
  1081  		return nil, err
  1082  	}
  1083  	return result, nil
  1084  }
  1085  func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (*PrepareRenameResult, error) {
  1086  	var result *PrepareRenameResult
  1087  	if err := s.sender.Call(ctx, "textDocument/prepareRename", params, &result); err != nil {
  1088  		return nil, err
  1089  	}
  1090  	return result, nil
  1091  }
  1092  func (s *serverDispatcher) PrepareTypeHierarchy(ctx context.Context, params *TypeHierarchyPrepareParams) ([]TypeHierarchyItem, error) {
  1093  	var result []TypeHierarchyItem
  1094  	if err := s.sender.Call(ctx, "textDocument/prepareTypeHierarchy", params, &result); err != nil {
  1095  		return nil, err
  1096  	}
  1097  	return result, nil
  1098  }
  1099  func (s *serverDispatcher) RangeFormatting(ctx context.Context, params *DocumentRangeFormattingParams) ([]TextEdit, error) {
  1100  	var result []TextEdit
  1101  	if err := s.sender.Call(ctx, "textDocument/rangeFormatting", params, &result); err != nil {
  1102  		return nil, err
  1103  	}
  1104  	return result, nil
  1105  }
  1106  func (s *serverDispatcher) RangesFormatting(ctx context.Context, params *DocumentRangesFormattingParams) ([]TextEdit, error) {
  1107  	var result []TextEdit
  1108  	if err := s.sender.Call(ctx, "textDocument/rangesFormatting", params, &result); err != nil {
  1109  		return nil, err
  1110  	}
  1111  	return result, nil
  1112  }
  1113  func (s *serverDispatcher) References(ctx context.Context, params *ReferenceParams) ([]Location, error) {
  1114  	var result []Location
  1115  	if err := s.sender.Call(ctx, "textDocument/references", params, &result); err != nil {
  1116  		return nil, err
  1117  	}
  1118  	return result, nil
  1119  }
  1120  func (s *serverDispatcher) Rename(ctx context.Context, params *RenameParams) (*WorkspaceEdit, error) {
  1121  	var result *WorkspaceEdit
  1122  	if err := s.sender.Call(ctx, "textDocument/rename", params, &result); err != nil {
  1123  		return nil, err
  1124  	}
  1125  	return result, nil
  1126  }
  1127  func (s *serverDispatcher) SelectionRange(ctx context.Context, params *SelectionRangeParams) ([]SelectionRange, error) {
  1128  	var result []SelectionRange
  1129  	if err := s.sender.Call(ctx, "textDocument/selectionRange", params, &result); err != nil {
  1130  		return nil, err
  1131  	}
  1132  	return result, nil
  1133  }
  1134  func (s *serverDispatcher) SemanticTokensFull(ctx context.Context, params *SemanticTokensParams) (*SemanticTokens, error) {
  1135  	var result *SemanticTokens
  1136  	if err := s.sender.Call(ctx, "textDocument/semanticTokens/full", params, &result); err != nil {
  1137  		return nil, err
  1138  	}
  1139  	return result, nil
  1140  }
  1141  func (s *serverDispatcher) SemanticTokensFullDelta(ctx context.Context, params *SemanticTokensDeltaParams) (interface{}, error) {
  1142  	var result interface{}
  1143  	if err := s.sender.Call(ctx, "textDocument/semanticTokens/full/delta", params, &result); err != nil {
  1144  		return nil, err
  1145  	}
  1146  	return result, nil
  1147  }
  1148  func (s *serverDispatcher) SemanticTokensRange(ctx context.Context, params *SemanticTokensRangeParams) (*SemanticTokens, error) {
  1149  	var result *SemanticTokens
  1150  	if err := s.sender.Call(ctx, "textDocument/semanticTokens/range", params, &result); err != nil {
  1151  		return nil, err
  1152  	}
  1153  	return result, nil
  1154  }
  1155  func (s *serverDispatcher) SignatureHelp(ctx context.Context, params *SignatureHelpParams) (*SignatureHelp, error) {
  1156  	var result *SignatureHelp
  1157  	if err := s.sender.Call(ctx, "textDocument/signatureHelp", params, &result); err != nil {
  1158  		return nil, err
  1159  	}
  1160  	return result, nil
  1161  }
  1162  func (s *serverDispatcher) TypeDefinition(ctx context.Context, params *TypeDefinitionParams) ([]Location, error) {
  1163  	var result []Location
  1164  	if err := s.sender.Call(ctx, "textDocument/typeDefinition", params, &result); err != nil {
  1165  		return nil, err
  1166  	}
  1167  	return result, nil
  1168  }
  1169  func (s *serverDispatcher) WillSave(ctx context.Context, params *WillSaveTextDocumentParams) error {
  1170  	return s.sender.Notify(ctx, "textDocument/willSave", params)
  1171  }
  1172  func (s *serverDispatcher) WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) ([]TextEdit, error) {
  1173  	var result []TextEdit
  1174  	if err := s.sender.Call(ctx, "textDocument/willSaveWaitUntil", params, &result); err != nil {
  1175  		return nil, err
  1176  	}
  1177  	return result, nil
  1178  }
  1179  func (s *serverDispatcher) Subtypes(ctx context.Context, params *TypeHierarchySubtypesParams) ([]TypeHierarchyItem, error) {
  1180  	var result []TypeHierarchyItem
  1181  	if err := s.sender.Call(ctx, "typeHierarchy/subtypes", params, &result); err != nil {
  1182  		return nil, err
  1183  	}
  1184  	return result, nil
  1185  }
  1186  func (s *serverDispatcher) Supertypes(ctx context.Context, params *TypeHierarchySupertypesParams) ([]TypeHierarchyItem, error) {
  1187  	var result []TypeHierarchyItem
  1188  	if err := s.sender.Call(ctx, "typeHierarchy/supertypes", params, &result); err != nil {
  1189  		return nil, err
  1190  	}
  1191  	return result, nil
  1192  }
  1193  func (s *serverDispatcher) WorkDoneProgressCancel(ctx context.Context, params *WorkDoneProgressCancelParams) error {
  1194  	return s.sender.Notify(ctx, "window/workDoneProgress/cancel", params)
  1195  }
  1196  func (s *serverDispatcher) DiagnosticWorkspace(ctx context.Context, params *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error) {
  1197  	var result *WorkspaceDiagnosticReport
  1198  	if err := s.sender.Call(ctx, "workspace/diagnostic", params, &result); err != nil {
  1199  		return nil, err
  1200  	}
  1201  	return result, nil
  1202  }
  1203  func (s *serverDispatcher) DidChangeConfiguration(ctx context.Context, params *DidChangeConfigurationParams) error {
  1204  	return s.sender.Notify(ctx, "workspace/didChangeConfiguration", params)
  1205  }
  1206  func (s *serverDispatcher) DidChangeWatchedFiles(ctx context.Context, params *DidChangeWatchedFilesParams) error {
  1207  	return s.sender.Notify(ctx, "workspace/didChangeWatchedFiles", params)
  1208  }
  1209  func (s *serverDispatcher) DidChangeWorkspaceFolders(ctx context.Context, params *DidChangeWorkspaceFoldersParams) error {
  1210  	return s.sender.Notify(ctx, "workspace/didChangeWorkspaceFolders", params)
  1211  }
  1212  func (s *serverDispatcher) DidCreateFiles(ctx context.Context, params *CreateFilesParams) error {
  1213  	return s.sender.Notify(ctx, "workspace/didCreateFiles", params)
  1214  }
  1215  func (s *serverDispatcher) DidDeleteFiles(ctx context.Context, params *DeleteFilesParams) error {
  1216  	return s.sender.Notify(ctx, "workspace/didDeleteFiles", params)
  1217  }
  1218  func (s *serverDispatcher) DidRenameFiles(ctx context.Context, params *RenameFilesParams) error {
  1219  	return s.sender.Notify(ctx, "workspace/didRenameFiles", params)
  1220  }
  1221  func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (interface{}, error) {
  1222  	var result interface{}
  1223  	if err := s.sender.Call(ctx, "workspace/executeCommand", params, &result); err != nil {
  1224  		return nil, err
  1225  	}
  1226  	return result, nil
  1227  }
  1228  func (s *serverDispatcher) Symbol(ctx context.Context, params *WorkspaceSymbolParams) ([]SymbolInformation, error) {
  1229  	var result []SymbolInformation
  1230  	if err := s.sender.Call(ctx, "workspace/symbol", params, &result); err != nil {
  1231  		return nil, err
  1232  	}
  1233  	return result, nil
  1234  }
  1235  func (s *serverDispatcher) WillCreateFiles(ctx context.Context, params *CreateFilesParams) (*WorkspaceEdit, error) {
  1236  	var result *WorkspaceEdit
  1237  	if err := s.sender.Call(ctx, "workspace/willCreateFiles", params, &result); err != nil {
  1238  		return nil, err
  1239  	}
  1240  	return result, nil
  1241  }
  1242  func (s *serverDispatcher) WillDeleteFiles(ctx context.Context, params *DeleteFilesParams) (*WorkspaceEdit, error) {
  1243  	var result *WorkspaceEdit
  1244  	if err := s.sender.Call(ctx, "workspace/willDeleteFiles", params, &result); err != nil {
  1245  		return nil, err
  1246  	}
  1247  	return result, nil
  1248  }
  1249  func (s *serverDispatcher) WillRenameFiles(ctx context.Context, params *RenameFilesParams) (*WorkspaceEdit, error) {
  1250  	var result *WorkspaceEdit
  1251  	if err := s.sender.Call(ctx, "workspace/willRenameFiles", params, &result); err != nil {
  1252  		return nil, err
  1253  	}
  1254  	return result, nil
  1255  }
  1256  func (s *serverDispatcher) ResolveWorkspaceSymbol(ctx context.Context, params *WorkspaceSymbol) (*WorkspaceSymbol, error) {
  1257  	var result *WorkspaceSymbol
  1258  	if err := s.sender.Call(ctx, "workspaceSymbol/resolve", params, &result); err != nil {
  1259  		return nil, err
  1260  	}
  1261  	return result, nil
  1262  }