github.com/v2fly/tools@v0.100.0/internal/lsp/protocol/tsserver.go (about)

     1  // Copyright 2019 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  package protocol
     6  
     7  // Package protocol contains data types and code for LSP jsonrpcs
     8  // generated automatically from vscode-languageserver-node
     9  // commit: d58c00bbf8837b9fd0144924db5e7b1c543d839e
    10  // last fetched Sat Apr 17 2021 08:26:29 GMT-0400 (Eastern Daylight Time)
    11  
    12  // Code generated (see typescript/README.md) DO NOT EDIT.
    13  
    14  import (
    15  	"context"
    16  	"encoding/json"
    17  
    18  	"github.com/v2fly/tools/internal/jsonrpc2"
    19  	errors "golang.org/x/xerrors"
    20  )
    21  
    22  type Server interface {
    23  	DidChangeWorkspaceFolders(context.Context, *DidChangeWorkspaceFoldersParams) error
    24  	WorkDoneProgressCancel(context.Context, *WorkDoneProgressCancelParams) error
    25  	DidCreateFiles(context.Context, *CreateFilesParams) error
    26  	DidRenameFiles(context.Context, *RenameFilesParams) error
    27  	DidDeleteFiles(context.Context, *DeleteFilesParams) error
    28  	Initialized(context.Context, *InitializedParams) error
    29  	Exit(context.Context) error
    30  	DidChangeConfiguration(context.Context, *DidChangeConfigurationParams) error
    31  	DidOpen(context.Context, *DidOpenTextDocumentParams) error
    32  	DidChange(context.Context, *DidChangeTextDocumentParams) error
    33  	DidClose(context.Context, *DidCloseTextDocumentParams) error
    34  	DidSave(context.Context, *DidSaveTextDocumentParams) error
    35  	WillSave(context.Context, *WillSaveTextDocumentParams) error
    36  	DidChangeWatchedFiles(context.Context, *DidChangeWatchedFilesParams) error
    37  	SetTrace(context.Context, *SetTraceParams) error
    38  	LogTrace(context.Context, *LogTraceParams) error
    39  	Implementation(context.Context, *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
    40  	TypeDefinition(context.Context, *TypeDefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
    41  	DocumentColor(context.Context, *DocumentColorParams) ([]ColorInformation, error)
    42  	ColorPresentation(context.Context, *ColorPresentationParams) ([]ColorPresentation, error)
    43  	FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange /*FoldingRange[] | null*/, error)
    44  	Declaration(context.Context, *DeclarationParams) (Declaration /*Declaration | DeclarationLink[] | null*/, error)
    45  	SelectionRange(context.Context, *SelectionRangeParams) ([]SelectionRange /*SelectionRange[] | null*/, error)
    46  	PrepareCallHierarchy(context.Context, *CallHierarchyPrepareParams) ([]CallHierarchyItem /*CallHierarchyItem[] | null*/, error)
    47  	IncomingCalls(context.Context, *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall /*CallHierarchyIncomingCall[] | null*/, error)
    48  	OutgoingCalls(context.Context, *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall /*CallHierarchyOutgoingCall[] | null*/, error)
    49  	SemanticTokensFull(context.Context, *SemanticTokensParams) (*SemanticTokens /*SemanticTokens | null*/, error)
    50  	SemanticTokensFullDelta(context.Context, *SemanticTokensDeltaParams) (interface{} /* SemanticTokens | SemanticTokensDelta | float64*/, error)
    51  	SemanticTokensRange(context.Context, *SemanticTokensRangeParams) (*SemanticTokens /*SemanticTokens | null*/, error)
    52  	SemanticTokensRefresh(context.Context) error
    53  	ShowDocument(context.Context, *ShowDocumentParams) (*ShowDocumentResult, error)
    54  	LinkedEditingRange(context.Context, *LinkedEditingRangeParams) (*LinkedEditingRanges /*LinkedEditingRanges | null*/, error)
    55  	WillCreateFiles(context.Context, *CreateFilesParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error)
    56  	WillRenameFiles(context.Context, *RenameFilesParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error)
    57  	WillDeleteFiles(context.Context, *DeleteFilesParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error)
    58  	Moniker(context.Context, *MonikerParams) ([]Moniker /*Moniker[] | null*/, error)
    59  	Initialize(context.Context, *ParamInitialize) (*InitializeResult, error)
    60  	Shutdown(context.Context) error
    61  	WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error)
    62  	Completion(context.Context, *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error)
    63  	Resolve(context.Context, *CompletionItem) (*CompletionItem, error)
    64  	Hover(context.Context, *HoverParams) (*Hover /*Hover | null*/, error)
    65  	SignatureHelp(context.Context, *SignatureHelpParams) (*SignatureHelp /*SignatureHelp | null*/, error)
    66  	Definition(context.Context, *DefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
    67  	References(context.Context, *ReferenceParams) ([]Location /*Location[] | null*/, error)
    68  	DocumentHighlight(context.Context, *DocumentHighlightParams) ([]DocumentHighlight /*DocumentHighlight[] | null*/, error)
    69  	DocumentSymbol(context.Context, *DocumentSymbolParams) ([]interface{} /*SymbolInformation[] | DocumentSymbol[] | null*/, error)
    70  	CodeAction(context.Context, *CodeActionParams) ([]CodeAction /*(Command | CodeAction)[] | null*/, error)
    71  	ResolveCodeAction(context.Context, *CodeAction) (*CodeAction, error)
    72  	Symbol(context.Context, *WorkspaceSymbolParams) ([]SymbolInformation /*SymbolInformation[] | null*/, error)
    73  	CodeLens(context.Context, *CodeLensParams) ([]CodeLens /*CodeLens[] | null*/, error)
    74  	ResolveCodeLens(context.Context, *CodeLens) (*CodeLens, error)
    75  	CodeLensRefresh(context.Context) error
    76  	DocumentLink(context.Context, *DocumentLinkParams) ([]DocumentLink /*DocumentLink[] | null*/, error)
    77  	ResolveDocumentLink(context.Context, *DocumentLink) (*DocumentLink, error)
    78  	Formatting(context.Context, *DocumentFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error)
    79  	RangeFormatting(context.Context, *DocumentRangeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error)
    80  	OnTypeFormatting(context.Context, *DocumentOnTypeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error)
    81  	Rename(context.Context, *RenameParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error)
    82  	PrepareRename(context.Context, *PrepareRenameParams) (*Range /*Range | { range: Range, placeholder: string } | { defaultBehavior: boolean } | null*/, error)
    83  	ExecuteCommand(context.Context, *ExecuteCommandParams) (interface{} /*any | null*/, error)
    84  	Diagnostic(context.Context, *string) (*string, error)
    85  	DiagnosticWorkspace(context.Context, *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error)
    86  	DiagnosticRefresh(context.Context) error
    87  	NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)
    88  }
    89  
    90  func serverDispatch(ctx context.Context, server Server, reply jsonrpc2.Replier, r jsonrpc2.Request) (bool, error) {
    91  	switch r.Method() {
    92  	case "workspace/didChangeWorkspaceFolders": // notif
    93  		var params DidChangeWorkspaceFoldersParams
    94  		if err := json.Unmarshal(r.Params(), &params); err != nil {
    95  			return true, sendParseError(ctx, reply, err)
    96  		}
    97  		err := server.DidChangeWorkspaceFolders(ctx, &params)
    98  		return true, reply(ctx, nil, err)
    99  	case "window/workDoneProgress/cancel": // notif
   100  		var params WorkDoneProgressCancelParams
   101  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   102  			return true, sendParseError(ctx, reply, err)
   103  		}
   104  		err := server.WorkDoneProgressCancel(ctx, &params)
   105  		return true, reply(ctx, nil, err)
   106  	case "workspace/didCreateFiles": // notif
   107  		var params CreateFilesParams
   108  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   109  			return true, sendParseError(ctx, reply, err)
   110  		}
   111  		err := server.DidCreateFiles(ctx, &params)
   112  		return true, reply(ctx, nil, err)
   113  	case "workspace/didRenameFiles": // notif
   114  		var params RenameFilesParams
   115  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   116  			return true, sendParseError(ctx, reply, err)
   117  		}
   118  		err := server.DidRenameFiles(ctx, &params)
   119  		return true, reply(ctx, nil, err)
   120  	case "workspace/didDeleteFiles": // notif
   121  		var params DeleteFilesParams
   122  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   123  			return true, sendParseError(ctx, reply, err)
   124  		}
   125  		err := server.DidDeleteFiles(ctx, &params)
   126  		return true, reply(ctx, nil, err)
   127  	case "initialized": // notif
   128  		var params InitializedParams
   129  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   130  			return true, sendParseError(ctx, reply, err)
   131  		}
   132  		err := server.Initialized(ctx, &params)
   133  		return true, reply(ctx, nil, err)
   134  	case "exit": // notif
   135  		err := server.Exit(ctx)
   136  		return true, reply(ctx, nil, err)
   137  	case "workspace/didChangeConfiguration": // notif
   138  		var params DidChangeConfigurationParams
   139  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   140  			return true, sendParseError(ctx, reply, err)
   141  		}
   142  		err := server.DidChangeConfiguration(ctx, &params)
   143  		return true, reply(ctx, nil, err)
   144  	case "textDocument/didOpen": // notif
   145  		var params DidOpenTextDocumentParams
   146  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   147  			return true, sendParseError(ctx, reply, err)
   148  		}
   149  		err := server.DidOpen(ctx, &params)
   150  		return true, reply(ctx, nil, err)
   151  	case "textDocument/didChange": // notif
   152  		var params DidChangeTextDocumentParams
   153  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   154  			return true, sendParseError(ctx, reply, err)
   155  		}
   156  		err := server.DidChange(ctx, &params)
   157  		return true, reply(ctx, nil, err)
   158  	case "textDocument/didClose": // notif
   159  		var params DidCloseTextDocumentParams
   160  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   161  			return true, sendParseError(ctx, reply, err)
   162  		}
   163  		err := server.DidClose(ctx, &params)
   164  		return true, reply(ctx, nil, err)
   165  	case "textDocument/didSave": // notif
   166  		var params DidSaveTextDocumentParams
   167  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   168  			return true, sendParseError(ctx, reply, err)
   169  		}
   170  		err := server.DidSave(ctx, &params)
   171  		return true, reply(ctx, nil, err)
   172  	case "textDocument/willSave": // notif
   173  		var params WillSaveTextDocumentParams
   174  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   175  			return true, sendParseError(ctx, reply, err)
   176  		}
   177  		err := server.WillSave(ctx, &params)
   178  		return true, reply(ctx, nil, err)
   179  	case "workspace/didChangeWatchedFiles": // notif
   180  		var params DidChangeWatchedFilesParams
   181  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   182  			return true, sendParseError(ctx, reply, err)
   183  		}
   184  		err := server.DidChangeWatchedFiles(ctx, &params)
   185  		return true, reply(ctx, nil, err)
   186  	case "$/setTrace": // notif
   187  		var params SetTraceParams
   188  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   189  			return true, sendParseError(ctx, reply, err)
   190  		}
   191  		err := server.SetTrace(ctx, &params)
   192  		return true, reply(ctx, nil, err)
   193  	case "$/logTrace": // notif
   194  		var params LogTraceParams
   195  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   196  			return true, sendParseError(ctx, reply, err)
   197  		}
   198  		err := server.LogTrace(ctx, &params)
   199  		return true, reply(ctx, nil, err)
   200  	case "textDocument/implementation": // req
   201  		var params ImplementationParams
   202  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   203  			return true, sendParseError(ctx, reply, err)
   204  		}
   205  		resp, err := server.Implementation(ctx, &params)
   206  		return true, reply(ctx, resp, err)
   207  	case "textDocument/typeDefinition": // req
   208  		var params TypeDefinitionParams
   209  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   210  			return true, sendParseError(ctx, reply, err)
   211  		}
   212  		resp, err := server.TypeDefinition(ctx, &params)
   213  		return true, reply(ctx, resp, err)
   214  	case "textDocument/documentColor": // req
   215  		var params DocumentColorParams
   216  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   217  			return true, sendParseError(ctx, reply, err)
   218  		}
   219  		resp, err := server.DocumentColor(ctx, &params)
   220  		return true, reply(ctx, resp, err)
   221  	case "textDocument/colorPresentation": // req
   222  		var params ColorPresentationParams
   223  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   224  			return true, sendParseError(ctx, reply, err)
   225  		}
   226  		resp, err := server.ColorPresentation(ctx, &params)
   227  		return true, reply(ctx, resp, err)
   228  	case "textDocument/foldingRange": // req
   229  		var params FoldingRangeParams
   230  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   231  			return true, sendParseError(ctx, reply, err)
   232  		}
   233  		resp, err := server.FoldingRange(ctx, &params)
   234  		return true, reply(ctx, resp, err)
   235  	case "textDocument/declaration": // req
   236  		var params DeclarationParams
   237  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   238  			return true, sendParseError(ctx, reply, err)
   239  		}
   240  		resp, err := server.Declaration(ctx, &params)
   241  		return true, reply(ctx, resp, err)
   242  	case "textDocument/selectionRange": // req
   243  		var params SelectionRangeParams
   244  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   245  			return true, sendParseError(ctx, reply, err)
   246  		}
   247  		resp, err := server.SelectionRange(ctx, &params)
   248  		return true, reply(ctx, resp, err)
   249  	case "textDocument/prepareCallHierarchy": // req
   250  		var params CallHierarchyPrepareParams
   251  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   252  			return true, sendParseError(ctx, reply, err)
   253  		}
   254  		resp, err := server.PrepareCallHierarchy(ctx, &params)
   255  		return true, reply(ctx, resp, err)
   256  	case "callHierarchy/incomingCalls": // req
   257  		var params CallHierarchyIncomingCallsParams
   258  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   259  			return true, sendParseError(ctx, reply, err)
   260  		}
   261  		resp, err := server.IncomingCalls(ctx, &params)
   262  		return true, reply(ctx, resp, err)
   263  	case "callHierarchy/outgoingCalls": // req
   264  		var params CallHierarchyOutgoingCallsParams
   265  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   266  			return true, sendParseError(ctx, reply, err)
   267  		}
   268  		resp, err := server.OutgoingCalls(ctx, &params)
   269  		return true, reply(ctx, resp, err)
   270  	case "textDocument/semanticTokens/full": // req
   271  		var params SemanticTokensParams
   272  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   273  			return true, sendParseError(ctx, reply, err)
   274  		}
   275  		resp, err := server.SemanticTokensFull(ctx, &params)
   276  		return true, reply(ctx, resp, err)
   277  	case "textDocument/semanticTokens/full/delta": // req
   278  		var params SemanticTokensDeltaParams
   279  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   280  			return true, sendParseError(ctx, reply, err)
   281  		}
   282  		resp, err := server.SemanticTokensFullDelta(ctx, &params)
   283  		return true, reply(ctx, resp, err)
   284  	case "textDocument/semanticTokens/range": // req
   285  		var params SemanticTokensRangeParams
   286  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   287  			return true, sendParseError(ctx, reply, err)
   288  		}
   289  		resp, err := server.SemanticTokensRange(ctx, &params)
   290  		return true, reply(ctx, resp, err)
   291  	case "workspace/semanticTokens/refresh": // req
   292  		if len(r.Params()) > 0 {
   293  			return true, reply(ctx, nil, errors.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
   294  		}
   295  		err := server.SemanticTokensRefresh(ctx)
   296  		return true, reply(ctx, nil, err)
   297  	case "window/showDocument": // req
   298  		var params ShowDocumentParams
   299  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   300  			return true, sendParseError(ctx, reply, err)
   301  		}
   302  		resp, err := server.ShowDocument(ctx, &params)
   303  		return true, reply(ctx, resp, err)
   304  	case "textDocument/linkedEditingRange": // req
   305  		var params LinkedEditingRangeParams
   306  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   307  			return true, sendParseError(ctx, reply, err)
   308  		}
   309  		resp, err := server.LinkedEditingRange(ctx, &params)
   310  		return true, reply(ctx, resp, err)
   311  	case "workspace/willCreateFiles": // req
   312  		var params CreateFilesParams
   313  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   314  			return true, sendParseError(ctx, reply, err)
   315  		}
   316  		resp, err := server.WillCreateFiles(ctx, &params)
   317  		return true, reply(ctx, resp, err)
   318  	case "workspace/willRenameFiles": // req
   319  		var params RenameFilesParams
   320  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   321  			return true, sendParseError(ctx, reply, err)
   322  		}
   323  		resp, err := server.WillRenameFiles(ctx, &params)
   324  		return true, reply(ctx, resp, err)
   325  	case "workspace/willDeleteFiles": // req
   326  		var params DeleteFilesParams
   327  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   328  			return true, sendParseError(ctx, reply, err)
   329  		}
   330  		resp, err := server.WillDeleteFiles(ctx, &params)
   331  		return true, reply(ctx, resp, err)
   332  	case "textDocument/moniker": // req
   333  		var params MonikerParams
   334  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   335  			return true, sendParseError(ctx, reply, err)
   336  		}
   337  		resp, err := server.Moniker(ctx, &params)
   338  		return true, reply(ctx, resp, err)
   339  	case "initialize": // req
   340  		var params ParamInitialize
   341  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   342  			if _, ok := err.(*json.UnmarshalTypeError); !ok {
   343  				return true, sendParseError(ctx, reply, err)
   344  			}
   345  		}
   346  		resp, err := server.Initialize(ctx, &params)
   347  		return true, reply(ctx, resp, err)
   348  	case "shutdown": // req
   349  		if len(r.Params()) > 0 {
   350  			return true, reply(ctx, nil, errors.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
   351  		}
   352  		err := server.Shutdown(ctx)
   353  		return true, reply(ctx, nil, err)
   354  	case "textDocument/willSaveWaitUntil": // req
   355  		var params WillSaveTextDocumentParams
   356  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   357  			return true, sendParseError(ctx, reply, err)
   358  		}
   359  		resp, err := server.WillSaveWaitUntil(ctx, &params)
   360  		return true, reply(ctx, resp, err)
   361  	case "textDocument/completion": // req
   362  		var params CompletionParams
   363  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   364  			return true, sendParseError(ctx, reply, err)
   365  		}
   366  		resp, err := server.Completion(ctx, &params)
   367  		return true, reply(ctx, resp, err)
   368  	case "completionItem/resolve": // req
   369  		var params CompletionItem
   370  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   371  			return true, sendParseError(ctx, reply, err)
   372  		}
   373  		resp, err := server.Resolve(ctx, &params)
   374  		return true, reply(ctx, resp, err)
   375  	case "textDocument/hover": // req
   376  		var params HoverParams
   377  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   378  			return true, sendParseError(ctx, reply, err)
   379  		}
   380  		resp, err := server.Hover(ctx, &params)
   381  		return true, reply(ctx, resp, err)
   382  	case "textDocument/signatureHelp": // req
   383  		var params SignatureHelpParams
   384  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   385  			return true, sendParseError(ctx, reply, err)
   386  		}
   387  		resp, err := server.SignatureHelp(ctx, &params)
   388  		return true, reply(ctx, resp, err)
   389  	case "textDocument/definition": // req
   390  		var params DefinitionParams
   391  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   392  			return true, sendParseError(ctx, reply, err)
   393  		}
   394  		resp, err := server.Definition(ctx, &params)
   395  		return true, reply(ctx, resp, err)
   396  	case "textDocument/references": // req
   397  		var params ReferenceParams
   398  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   399  			return true, sendParseError(ctx, reply, err)
   400  		}
   401  		resp, err := server.References(ctx, &params)
   402  		return true, reply(ctx, resp, err)
   403  	case "textDocument/documentHighlight": // req
   404  		var params DocumentHighlightParams
   405  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   406  			return true, sendParseError(ctx, reply, err)
   407  		}
   408  		resp, err := server.DocumentHighlight(ctx, &params)
   409  		return true, reply(ctx, resp, err)
   410  	case "textDocument/documentSymbol": // req
   411  		var params DocumentSymbolParams
   412  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   413  			return true, sendParseError(ctx, reply, err)
   414  		}
   415  		resp, err := server.DocumentSymbol(ctx, &params)
   416  		return true, reply(ctx, resp, err)
   417  	case "textDocument/codeAction": // req
   418  		var params CodeActionParams
   419  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   420  			return true, sendParseError(ctx, reply, err)
   421  		}
   422  		resp, err := server.CodeAction(ctx, &params)
   423  		return true, reply(ctx, resp, err)
   424  	case "codeAction/resolve": // req
   425  		var params CodeAction
   426  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   427  			return true, sendParseError(ctx, reply, err)
   428  		}
   429  		resp, err := server.ResolveCodeAction(ctx, &params)
   430  		return true, reply(ctx, resp, err)
   431  	case "workspace/symbol": // req
   432  		var params WorkspaceSymbolParams
   433  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   434  			return true, sendParseError(ctx, reply, err)
   435  		}
   436  		resp, err := server.Symbol(ctx, &params)
   437  		return true, reply(ctx, resp, err)
   438  	case "textDocument/codeLens": // req
   439  		var params CodeLensParams
   440  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   441  			return true, sendParseError(ctx, reply, err)
   442  		}
   443  		resp, err := server.CodeLens(ctx, &params)
   444  		return true, reply(ctx, resp, err)
   445  	case "codeLens/resolve": // req
   446  		var params CodeLens
   447  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   448  			return true, sendParseError(ctx, reply, err)
   449  		}
   450  		resp, err := server.ResolveCodeLens(ctx, &params)
   451  		return true, reply(ctx, resp, err)
   452  	case "workspace/codeLens/refresh": // req
   453  		if len(r.Params()) > 0 {
   454  			return true, reply(ctx, nil, errors.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
   455  		}
   456  		err := server.CodeLensRefresh(ctx)
   457  		return true, reply(ctx, nil, err)
   458  	case "textDocument/documentLink": // req
   459  		var params DocumentLinkParams
   460  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   461  			return true, sendParseError(ctx, reply, err)
   462  		}
   463  		resp, err := server.DocumentLink(ctx, &params)
   464  		return true, reply(ctx, resp, err)
   465  	case "documentLink/resolve": // req
   466  		var params DocumentLink
   467  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   468  			return true, sendParseError(ctx, reply, err)
   469  		}
   470  		resp, err := server.ResolveDocumentLink(ctx, &params)
   471  		return true, reply(ctx, resp, err)
   472  	case "textDocument/formatting": // req
   473  		var params DocumentFormattingParams
   474  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   475  			return true, sendParseError(ctx, reply, err)
   476  		}
   477  		resp, err := server.Formatting(ctx, &params)
   478  		return true, reply(ctx, resp, err)
   479  	case "textDocument/rangeFormatting": // req
   480  		var params DocumentRangeFormattingParams
   481  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   482  			return true, sendParseError(ctx, reply, err)
   483  		}
   484  		resp, err := server.RangeFormatting(ctx, &params)
   485  		return true, reply(ctx, resp, err)
   486  	case "textDocument/onTypeFormatting": // req
   487  		var params DocumentOnTypeFormattingParams
   488  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   489  			return true, sendParseError(ctx, reply, err)
   490  		}
   491  		resp, err := server.OnTypeFormatting(ctx, &params)
   492  		return true, reply(ctx, resp, err)
   493  	case "textDocument/rename": // req
   494  		var params RenameParams
   495  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   496  			return true, sendParseError(ctx, reply, err)
   497  		}
   498  		resp, err := server.Rename(ctx, &params)
   499  		return true, reply(ctx, resp, err)
   500  	case "textDocument/prepareRename": // req
   501  		var params PrepareRenameParams
   502  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   503  			return true, sendParseError(ctx, reply, err)
   504  		}
   505  		resp, err := server.PrepareRename(ctx, &params)
   506  		return true, reply(ctx, resp, err)
   507  	case "workspace/executeCommand": // req
   508  		var params ExecuteCommandParams
   509  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   510  			return true, sendParseError(ctx, reply, err)
   511  		}
   512  		resp, err := server.ExecuteCommand(ctx, &params)
   513  		return true, reply(ctx, resp, err)
   514  	case "textDocument/diagnostic": // req
   515  		var params string
   516  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   517  			return true, sendParseError(ctx, reply, err)
   518  		}
   519  		resp, err := server.Diagnostic(ctx, &params)
   520  		return true, reply(ctx, resp, err)
   521  	case "workspace/diagnostic": // req
   522  		var params WorkspaceDiagnosticParams
   523  		if err := json.Unmarshal(r.Params(), &params); err != nil {
   524  			return true, sendParseError(ctx, reply, err)
   525  		}
   526  		resp, err := server.DiagnosticWorkspace(ctx, &params)
   527  		return true, reply(ctx, resp, err)
   528  	case "workspace/diagnostic/refresh": // req
   529  		if len(r.Params()) > 0 {
   530  			return true, reply(ctx, nil, errors.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
   531  		}
   532  		err := server.DiagnosticRefresh(ctx)
   533  		return true, reply(ctx, nil, err)
   534  
   535  	default:
   536  		return false, nil
   537  	}
   538  }
   539  
   540  func (s *serverDispatcher) DidChangeWorkspaceFolders(ctx context.Context, params *DidChangeWorkspaceFoldersParams) error {
   541  	return s.Conn.Notify(ctx, "workspace/didChangeWorkspaceFolders", params)
   542  }
   543  
   544  func (s *serverDispatcher) WorkDoneProgressCancel(ctx context.Context, params *WorkDoneProgressCancelParams) error {
   545  	return s.Conn.Notify(ctx, "window/workDoneProgress/cancel", params)
   546  }
   547  
   548  func (s *serverDispatcher) DidCreateFiles(ctx context.Context, params *CreateFilesParams) error {
   549  	return s.Conn.Notify(ctx, "workspace/didCreateFiles", params)
   550  }
   551  
   552  func (s *serverDispatcher) DidRenameFiles(ctx context.Context, params *RenameFilesParams) error {
   553  	return s.Conn.Notify(ctx, "workspace/didRenameFiles", params)
   554  }
   555  
   556  func (s *serverDispatcher) DidDeleteFiles(ctx context.Context, params *DeleteFilesParams) error {
   557  	return s.Conn.Notify(ctx, "workspace/didDeleteFiles", params)
   558  }
   559  
   560  func (s *serverDispatcher) Initialized(ctx context.Context, params *InitializedParams) error {
   561  	return s.Conn.Notify(ctx, "initialized", params)
   562  }
   563  
   564  func (s *serverDispatcher) Exit(ctx context.Context) error {
   565  	return s.Conn.Notify(ctx, "exit", nil)
   566  }
   567  
   568  func (s *serverDispatcher) DidChangeConfiguration(ctx context.Context, params *DidChangeConfigurationParams) error {
   569  	return s.Conn.Notify(ctx, "workspace/didChangeConfiguration", params)
   570  }
   571  
   572  func (s *serverDispatcher) DidOpen(ctx context.Context, params *DidOpenTextDocumentParams) error {
   573  	return s.Conn.Notify(ctx, "textDocument/didOpen", params)
   574  }
   575  
   576  func (s *serverDispatcher) DidChange(ctx context.Context, params *DidChangeTextDocumentParams) error {
   577  	return s.Conn.Notify(ctx, "textDocument/didChange", params)
   578  }
   579  
   580  func (s *serverDispatcher) DidClose(ctx context.Context, params *DidCloseTextDocumentParams) error {
   581  	return s.Conn.Notify(ctx, "textDocument/didClose", params)
   582  }
   583  
   584  func (s *serverDispatcher) DidSave(ctx context.Context, params *DidSaveTextDocumentParams) error {
   585  	return s.Conn.Notify(ctx, "textDocument/didSave", params)
   586  }
   587  
   588  func (s *serverDispatcher) WillSave(ctx context.Context, params *WillSaveTextDocumentParams) error {
   589  	return s.Conn.Notify(ctx, "textDocument/willSave", params)
   590  }
   591  
   592  func (s *serverDispatcher) DidChangeWatchedFiles(ctx context.Context, params *DidChangeWatchedFilesParams) error {
   593  	return s.Conn.Notify(ctx, "workspace/didChangeWatchedFiles", params)
   594  }
   595  
   596  func (s *serverDispatcher) SetTrace(ctx context.Context, params *SetTraceParams) error {
   597  	return s.Conn.Notify(ctx, "$/setTrace", params)
   598  }
   599  
   600  func (s *serverDispatcher) LogTrace(ctx context.Context, params *LogTraceParams) error {
   601  	return s.Conn.Notify(ctx, "$/logTrace", params)
   602  }
   603  func (s *serverDispatcher) Implementation(ctx context.Context, params *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error) {
   604  	var result Definition /*Definition | DefinitionLink[] | null*/
   605  	if err := Call(ctx, s.Conn, "textDocument/implementation", params, &result); err != nil {
   606  		return nil, err
   607  	}
   608  	return result, nil
   609  }
   610  
   611  func (s *serverDispatcher) TypeDefinition(ctx context.Context, params *TypeDefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) {
   612  	var result Definition /*Definition | DefinitionLink[] | null*/
   613  	if err := Call(ctx, s.Conn, "textDocument/typeDefinition", params, &result); err != nil {
   614  		return nil, err
   615  	}
   616  	return result, nil
   617  }
   618  
   619  func (s *serverDispatcher) DocumentColor(ctx context.Context, params *DocumentColorParams) ([]ColorInformation, error) {
   620  	var result []ColorInformation
   621  	if err := Call(ctx, s.Conn, "textDocument/documentColor", params, &result); err != nil {
   622  		return nil, err
   623  	}
   624  	return result, nil
   625  }
   626  
   627  func (s *serverDispatcher) ColorPresentation(ctx context.Context, params *ColorPresentationParams) ([]ColorPresentation, error) {
   628  	var result []ColorPresentation
   629  	if err := Call(ctx, s.Conn, "textDocument/colorPresentation", params, &result); err != nil {
   630  		return nil, err
   631  	}
   632  	return result, nil
   633  }
   634  
   635  func (s *serverDispatcher) FoldingRange(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange /*FoldingRange[] | null*/, error) {
   636  	var result []FoldingRange /*FoldingRange[] | null*/
   637  	if err := Call(ctx, s.Conn, "textDocument/foldingRange", params, &result); err != nil {
   638  		return nil, err
   639  	}
   640  	return result, nil
   641  }
   642  
   643  func (s *serverDispatcher) Declaration(ctx context.Context, params *DeclarationParams) (Declaration /*Declaration | DeclarationLink[] | null*/, error) {
   644  	var result Declaration /*Declaration | DeclarationLink[] | null*/
   645  	if err := Call(ctx, s.Conn, "textDocument/declaration", params, &result); err != nil {
   646  		return nil, err
   647  	}
   648  	return result, nil
   649  }
   650  
   651  func (s *serverDispatcher) SelectionRange(ctx context.Context, params *SelectionRangeParams) ([]SelectionRange /*SelectionRange[] | null*/, error) {
   652  	var result []SelectionRange /*SelectionRange[] | null*/
   653  	if err := Call(ctx, s.Conn, "textDocument/selectionRange", params, &result); err != nil {
   654  		return nil, err
   655  	}
   656  	return result, nil
   657  }
   658  
   659  func (s *serverDispatcher) PrepareCallHierarchy(ctx context.Context, params *CallHierarchyPrepareParams) ([]CallHierarchyItem /*CallHierarchyItem[] | null*/, error) {
   660  	var result []CallHierarchyItem /*CallHierarchyItem[] | null*/
   661  	if err := Call(ctx, s.Conn, "textDocument/prepareCallHierarchy", params, &result); err != nil {
   662  		return nil, err
   663  	}
   664  	return result, nil
   665  }
   666  
   667  func (s *serverDispatcher) IncomingCalls(ctx context.Context, params *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall /*CallHierarchyIncomingCall[] | null*/, error) {
   668  	var result []CallHierarchyIncomingCall /*CallHierarchyIncomingCall[] | null*/
   669  	if err := Call(ctx, s.Conn, "callHierarchy/incomingCalls", params, &result); err != nil {
   670  		return nil, err
   671  	}
   672  	return result, nil
   673  }
   674  
   675  func (s *serverDispatcher) OutgoingCalls(ctx context.Context, params *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall /*CallHierarchyOutgoingCall[] | null*/, error) {
   676  	var result []CallHierarchyOutgoingCall /*CallHierarchyOutgoingCall[] | null*/
   677  	if err := Call(ctx, s.Conn, "callHierarchy/outgoingCalls", params, &result); err != nil {
   678  		return nil, err
   679  	}
   680  	return result, nil
   681  }
   682  
   683  func (s *serverDispatcher) SemanticTokensFull(ctx context.Context, params *SemanticTokensParams) (*SemanticTokens /*SemanticTokens | null*/, error) {
   684  	var result *SemanticTokens /*SemanticTokens | null*/
   685  	if err := Call(ctx, s.Conn, "textDocument/semanticTokens/full", params, &result); err != nil {
   686  		return nil, err
   687  	}
   688  	return result, nil
   689  }
   690  
   691  func (s *serverDispatcher) SemanticTokensFullDelta(ctx context.Context, params *SemanticTokensDeltaParams) (interface{} /* SemanticTokens | SemanticTokensDelta | float64*/, error) {
   692  	var result interface{} /* SemanticTokens | SemanticTokensDelta | float64*/
   693  	if err := Call(ctx, s.Conn, "textDocument/semanticTokens/full/delta", params, &result); err != nil {
   694  		return nil, err
   695  	}
   696  	return result, nil
   697  }
   698  
   699  func (s *serverDispatcher) SemanticTokensRange(ctx context.Context, params *SemanticTokensRangeParams) (*SemanticTokens /*SemanticTokens | null*/, error) {
   700  	var result *SemanticTokens /*SemanticTokens | null*/
   701  	if err := Call(ctx, s.Conn, "textDocument/semanticTokens/range", params, &result); err != nil {
   702  		return nil, err
   703  	}
   704  	return result, nil
   705  }
   706  
   707  func (s *serverDispatcher) SemanticTokensRefresh(ctx context.Context) error {
   708  	return Call(ctx, s.Conn, "workspace/semanticTokens/refresh", nil, nil)
   709  }
   710  
   711  func (s *serverDispatcher) ShowDocument(ctx context.Context, params *ShowDocumentParams) (*ShowDocumentResult, error) {
   712  	var result *ShowDocumentResult
   713  	if err := Call(ctx, s.Conn, "window/showDocument", params, &result); err != nil {
   714  		return nil, err
   715  	}
   716  	return result, nil
   717  }
   718  
   719  func (s *serverDispatcher) LinkedEditingRange(ctx context.Context, params *LinkedEditingRangeParams) (*LinkedEditingRanges /*LinkedEditingRanges | null*/, error) {
   720  	var result *LinkedEditingRanges /*LinkedEditingRanges | null*/
   721  	if err := Call(ctx, s.Conn, "textDocument/linkedEditingRange", params, &result); err != nil {
   722  		return nil, err
   723  	}
   724  	return result, nil
   725  }
   726  
   727  func (s *serverDispatcher) WillCreateFiles(ctx context.Context, params *CreateFilesParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) {
   728  	var result *WorkspaceEdit /*WorkspaceEdit | null*/
   729  	if err := Call(ctx, s.Conn, "workspace/willCreateFiles", params, &result); err != nil {
   730  		return nil, err
   731  	}
   732  	return result, nil
   733  }
   734  
   735  func (s *serverDispatcher) WillRenameFiles(ctx context.Context, params *RenameFilesParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) {
   736  	var result *WorkspaceEdit /*WorkspaceEdit | null*/
   737  	if err := Call(ctx, s.Conn, "workspace/willRenameFiles", params, &result); err != nil {
   738  		return nil, err
   739  	}
   740  	return result, nil
   741  }
   742  
   743  func (s *serverDispatcher) WillDeleteFiles(ctx context.Context, params *DeleteFilesParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) {
   744  	var result *WorkspaceEdit /*WorkspaceEdit | null*/
   745  	if err := Call(ctx, s.Conn, "workspace/willDeleteFiles", params, &result); err != nil {
   746  		return nil, err
   747  	}
   748  	return result, nil
   749  }
   750  
   751  func (s *serverDispatcher) Moniker(ctx context.Context, params *MonikerParams) ([]Moniker /*Moniker[] | null*/, error) {
   752  	var result []Moniker /*Moniker[] | null*/
   753  	if err := Call(ctx, s.Conn, "textDocument/moniker", params, &result); err != nil {
   754  		return nil, err
   755  	}
   756  	return result, nil
   757  }
   758  
   759  func (s *serverDispatcher) Initialize(ctx context.Context, params *ParamInitialize) (*InitializeResult, error) {
   760  	var result *InitializeResult
   761  	if err := Call(ctx, s.Conn, "initialize", params, &result); err != nil {
   762  		return nil, err
   763  	}
   764  	return result, nil
   765  }
   766  
   767  func (s *serverDispatcher) Shutdown(ctx context.Context) error {
   768  	return Call(ctx, s.Conn, "shutdown", nil, nil)
   769  }
   770  
   771  func (s *serverDispatcher) WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error) {
   772  	var result []TextEdit /*TextEdit[] | null*/
   773  	if err := Call(ctx, s.Conn, "textDocument/willSaveWaitUntil", params, &result); err != nil {
   774  		return nil, err
   775  	}
   776  	return result, nil
   777  }
   778  
   779  func (s *serverDispatcher) Completion(ctx context.Context, params *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error) {
   780  	var result *CompletionList /*CompletionItem[] | CompletionList | null*/
   781  	if err := Call(ctx, s.Conn, "textDocument/completion", params, &result); err != nil {
   782  		return nil, err
   783  	}
   784  	return result, nil
   785  }
   786  
   787  func (s *serverDispatcher) Resolve(ctx context.Context, params *CompletionItem) (*CompletionItem, error) {
   788  	var result *CompletionItem
   789  	if err := Call(ctx, s.Conn, "completionItem/resolve", params, &result); err != nil {
   790  		return nil, err
   791  	}
   792  	return result, nil
   793  }
   794  
   795  func (s *serverDispatcher) Hover(ctx context.Context, params *HoverParams) (*Hover /*Hover | null*/, error) {
   796  	var result *Hover /*Hover | null*/
   797  	if err := Call(ctx, s.Conn, "textDocument/hover", params, &result); err != nil {
   798  		return nil, err
   799  	}
   800  	return result, nil
   801  }
   802  
   803  func (s *serverDispatcher) SignatureHelp(ctx context.Context, params *SignatureHelpParams) (*SignatureHelp /*SignatureHelp | null*/, error) {
   804  	var result *SignatureHelp /*SignatureHelp | null*/
   805  	if err := Call(ctx, s.Conn, "textDocument/signatureHelp", params, &result); err != nil {
   806  		return nil, err
   807  	}
   808  	return result, nil
   809  }
   810  
   811  func (s *serverDispatcher) Definition(ctx context.Context, params *DefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) {
   812  	var result Definition /*Definition | DefinitionLink[] | null*/
   813  	if err := Call(ctx, s.Conn, "textDocument/definition", params, &result); err != nil {
   814  		return nil, err
   815  	}
   816  	return result, nil
   817  }
   818  
   819  func (s *serverDispatcher) References(ctx context.Context, params *ReferenceParams) ([]Location /*Location[] | null*/, error) {
   820  	var result []Location /*Location[] | null*/
   821  	if err := Call(ctx, s.Conn, "textDocument/references", params, &result); err != nil {
   822  		return nil, err
   823  	}
   824  	return result, nil
   825  }
   826  
   827  func (s *serverDispatcher) DocumentHighlight(ctx context.Context, params *DocumentHighlightParams) ([]DocumentHighlight /*DocumentHighlight[] | null*/, error) {
   828  	var result []DocumentHighlight /*DocumentHighlight[] | null*/
   829  	if err := Call(ctx, s.Conn, "textDocument/documentHighlight", params, &result); err != nil {
   830  		return nil, err
   831  	}
   832  	return result, nil
   833  }
   834  
   835  func (s *serverDispatcher) DocumentSymbol(ctx context.Context, params *DocumentSymbolParams) ([]interface{} /*SymbolInformation[] | DocumentSymbol[] | null*/, error) {
   836  	var result []interface{} /*SymbolInformation[] | DocumentSymbol[] | null*/
   837  	if err := Call(ctx, s.Conn, "textDocument/documentSymbol", params, &result); err != nil {
   838  		return nil, err
   839  	}
   840  	return result, nil
   841  }
   842  
   843  func (s *serverDispatcher) CodeAction(ctx context.Context, params *CodeActionParams) ([]CodeAction /*(Command | CodeAction)[] | null*/, error) {
   844  	var result []CodeAction /*(Command | CodeAction)[] | null*/
   845  	if err := Call(ctx, s.Conn, "textDocument/codeAction", params, &result); err != nil {
   846  		return nil, err
   847  	}
   848  	return result, nil
   849  }
   850  
   851  func (s *serverDispatcher) ResolveCodeAction(ctx context.Context, params *CodeAction) (*CodeAction, error) {
   852  	var result *CodeAction
   853  	if err := Call(ctx, s.Conn, "codeAction/resolve", params, &result); err != nil {
   854  		return nil, err
   855  	}
   856  	return result, nil
   857  }
   858  
   859  func (s *serverDispatcher) Symbol(ctx context.Context, params *WorkspaceSymbolParams) ([]SymbolInformation /*SymbolInformation[] | null*/, error) {
   860  	var result []SymbolInformation /*SymbolInformation[] | null*/
   861  	if err := Call(ctx, s.Conn, "workspace/symbol", params, &result); err != nil {
   862  		return nil, err
   863  	}
   864  	return result, nil
   865  }
   866  
   867  func (s *serverDispatcher) CodeLens(ctx context.Context, params *CodeLensParams) ([]CodeLens /*CodeLens[] | null*/, error) {
   868  	var result []CodeLens /*CodeLens[] | null*/
   869  	if err := Call(ctx, s.Conn, "textDocument/codeLens", params, &result); err != nil {
   870  		return nil, err
   871  	}
   872  	return result, nil
   873  }
   874  
   875  func (s *serverDispatcher) ResolveCodeLens(ctx context.Context, params *CodeLens) (*CodeLens, error) {
   876  	var result *CodeLens
   877  	if err := Call(ctx, s.Conn, "codeLens/resolve", params, &result); err != nil {
   878  		return nil, err
   879  	}
   880  	return result, nil
   881  }
   882  
   883  func (s *serverDispatcher) CodeLensRefresh(ctx context.Context) error {
   884  	return Call(ctx, s.Conn, "workspace/codeLens/refresh", nil, nil)
   885  }
   886  
   887  func (s *serverDispatcher) DocumentLink(ctx context.Context, params *DocumentLinkParams) ([]DocumentLink /*DocumentLink[] | null*/, error) {
   888  	var result []DocumentLink /*DocumentLink[] | null*/
   889  	if err := Call(ctx, s.Conn, "textDocument/documentLink", params, &result); err != nil {
   890  		return nil, err
   891  	}
   892  	return result, nil
   893  }
   894  
   895  func (s *serverDispatcher) ResolveDocumentLink(ctx context.Context, params *DocumentLink) (*DocumentLink, error) {
   896  	var result *DocumentLink
   897  	if err := Call(ctx, s.Conn, "documentLink/resolve", params, &result); err != nil {
   898  		return nil, err
   899  	}
   900  	return result, nil
   901  }
   902  
   903  func (s *serverDispatcher) Formatting(ctx context.Context, params *DocumentFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) {
   904  	var result []TextEdit /*TextEdit[] | null*/
   905  	if err := Call(ctx, s.Conn, "textDocument/formatting", params, &result); err != nil {
   906  		return nil, err
   907  	}
   908  	return result, nil
   909  }
   910  
   911  func (s *serverDispatcher) RangeFormatting(ctx context.Context, params *DocumentRangeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) {
   912  	var result []TextEdit /*TextEdit[] | null*/
   913  	if err := Call(ctx, s.Conn, "textDocument/rangeFormatting", params, &result); err != nil {
   914  		return nil, err
   915  	}
   916  	return result, nil
   917  }
   918  
   919  func (s *serverDispatcher) OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) {
   920  	var result []TextEdit /*TextEdit[] | null*/
   921  	if err := Call(ctx, s.Conn, "textDocument/onTypeFormatting", params, &result); err != nil {
   922  		return nil, err
   923  	}
   924  	return result, nil
   925  }
   926  
   927  func (s *serverDispatcher) Rename(ctx context.Context, params *RenameParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) {
   928  	var result *WorkspaceEdit /*WorkspaceEdit | null*/
   929  	if err := Call(ctx, s.Conn, "textDocument/rename", params, &result); err != nil {
   930  		return nil, err
   931  	}
   932  	return result, nil
   933  }
   934  
   935  func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (*Range /*Range | { range: Range, placeholder: string } | { defaultBehavior: boolean } | null*/, error) {
   936  	var result *Range /*Range | { range: Range, placeholder: string } | { defaultBehavior: boolean } | null*/
   937  	if err := Call(ctx, s.Conn, "textDocument/prepareRename", params, &result); err != nil {
   938  		return nil, err
   939  	}
   940  	return result, nil
   941  }
   942  
   943  func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (interface{} /*any | null*/, error) {
   944  	var result interface{} /*any | null*/
   945  	if err := Call(ctx, s.Conn, "workspace/executeCommand", params, &result); err != nil {
   946  		return nil, err
   947  	}
   948  	return result, nil
   949  }
   950  
   951  func (s *serverDispatcher) Diagnostic(ctx context.Context, params *string) (*string, error) {
   952  	var result *string
   953  	if err := Call(ctx, s.Conn, "textDocument/diagnostic", params, &result); err != nil {
   954  		return nil, err
   955  	}
   956  	return result, nil
   957  }
   958  
   959  func (s *serverDispatcher) DiagnosticWorkspace(ctx context.Context, params *WorkspaceDiagnosticParams) (*WorkspaceDiagnosticReport, error) {
   960  	var result *WorkspaceDiagnosticReport
   961  	if err := Call(ctx, s.Conn, "workspace/diagnostic", params, &result); err != nil {
   962  		return nil, err
   963  	}
   964  	return result, nil
   965  }
   966  
   967  func (s *serverDispatcher) DiagnosticRefresh(ctx context.Context) error {
   968  	return Call(ctx, s.Conn, "workspace/diagnostic/refresh", nil, nil)
   969  }
   970  
   971  func (s *serverDispatcher) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error) {
   972  	var result interface{}
   973  	if err := Call(ctx, s.Conn, method, params, &result); err != nil {
   974  		return nil, err
   975  	}
   976  	return result, nil
   977  }