1package protocol
2
3// Package protocol contains data types and code for LSP jsonrpcs
4// generated automatically from vscode-languageserver-node
5// commit: 60a5a7825e6f54f57917091f394fd8db7d1724bc
6// last fetched Thu Sep 10 2020 09:21:57 GMT-0400 (Eastern Daylight Time)
7
8// Code generated (see typescript/README.md) DO NOT EDIT.
9
10import (
11	"context"
12	"encoding/json"
13
14	"golang.org/x/tools/internal/jsonrpc2"
15	errors "golang.org/x/xerrors"
16)
17
18type Server interface {
19	DidChangeWorkspaceFolders(context.Context, *DidChangeWorkspaceFoldersParams) error
20	WorkDoneProgressCancel(context.Context, *WorkDoneProgressCancelParams) error
21	SemanticTokensRefresh(context.Context) error
22	Initialized(context.Context, *InitializedParams) error
23	Exit(context.Context) error
24	DidChangeConfiguration(context.Context, *DidChangeConfigurationParams) error
25	DidOpen(context.Context, *DidOpenTextDocumentParams) error
26	DidChange(context.Context, *DidChangeTextDocumentParams) error
27	DidClose(context.Context, *DidCloseTextDocumentParams) error
28	DidSave(context.Context, *DidSaveTextDocumentParams) error
29	WillSave(context.Context, *WillSaveTextDocumentParams) error
30	DidChangeWatchedFiles(context.Context, *DidChangeWatchedFilesParams) error
31	SetTrace(context.Context, *SetTraceParams) error
32	LogTrace(context.Context, *LogTraceParams) error
33	Implementation(context.Context, *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
34	TypeDefinition(context.Context, *TypeDefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
35	DocumentColor(context.Context, *DocumentColorParams) ([]ColorInformation, error)
36	ColorPresentation(context.Context, *ColorPresentationParams) ([]ColorPresentation, error)
37	FoldingRange(context.Context, *FoldingRangeParams) ([]FoldingRange /*FoldingRange[] | null*/, error)
38	Declaration(context.Context, *DeclarationParams) (Declaration /*Declaration | DeclarationLink[] | null*/, error)
39	SelectionRange(context.Context, *SelectionRangeParams) ([]SelectionRange /*SelectionRange[] | null*/, error)
40	PrepareCallHierarchy(context.Context, *CallHierarchyPrepareParams) ([]CallHierarchyItem /*CallHierarchyItem[] | null*/, error)
41	IncomingCalls(context.Context, *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall /*CallHierarchyIncomingCall[] | null*/, error)
42	OutgoingCalls(context.Context, *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall /*CallHierarchyOutgoingCall[] | null*/, error)
43	SemanticTokensFull(context.Context, *SemanticTokensParams) (*SemanticTokens /*SemanticTokens | null*/, error)
44	SemanticTokensFullDelta(context.Context, *SemanticTokensDeltaParams) (interface{} /* SemanticTokens | SemanticTokensDelta | nil*/, error)
45	SemanticTokensRange(context.Context, *SemanticTokensRangeParams) (*SemanticTokens /*SemanticTokens | null*/, error)
46	Initialize(context.Context, *ParamInitialize) (*InitializeResult, error)
47	Shutdown(context.Context) error
48	WillSaveWaitUntil(context.Context, *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error)
49	Completion(context.Context, *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error)
50	Resolve(context.Context, *CompletionItem) (*CompletionItem, error)
51	Hover(context.Context, *HoverParams) (*Hover /*Hover | null*/, error)
52	SignatureHelp(context.Context, *SignatureHelpParams) (*SignatureHelp /*SignatureHelp | null*/, error)
53	Definition(context.Context, *DefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error)
54	References(context.Context, *ReferenceParams) ([]Location /*Location[] | null*/, error)
55	DocumentHighlight(context.Context, *DocumentHighlightParams) ([]DocumentHighlight /*DocumentHighlight[] | null*/, error)
56	DocumentSymbol(context.Context, *DocumentSymbolParams) ([]interface{} /*SymbolInformation[] | DocumentSymbol[] | null*/, error)
57	CodeAction(context.Context, *CodeActionParams) ([]CodeAction /*(Command | CodeAction)[] | null*/, error)
58	Symbol(context.Context, *WorkspaceSymbolParams) ([]SymbolInformation /*SymbolInformation[] | null*/, error)
59	CodeLens(context.Context, *CodeLensParams) ([]CodeLens /*CodeLens[] | null*/, error)
60	ResolveCodeLens(context.Context, *CodeLens) (*CodeLens, error)
61	DocumentLink(context.Context, *DocumentLinkParams) ([]DocumentLink /*DocumentLink[] | null*/, error)
62	ResolveDocumentLink(context.Context, *DocumentLink) (*DocumentLink, error)
63	Formatting(context.Context, *DocumentFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error)
64	RangeFormatting(context.Context, *DocumentRangeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error)
65	OnTypeFormatting(context.Context, *DocumentOnTypeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error)
66	Rename(context.Context, *RenameParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error)
67	PrepareRename(context.Context, *PrepareRenameParams) (*Range /*Range | { range: Range, placeholder: string } | { defaultBehavior: boolean } | null*/, error)
68	ExecuteCommand(context.Context, *ExecuteCommandParams) (interface{} /*any | null*/, error)
69	NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error)
70}
71
72func serverDispatch(ctx context.Context, server Server, reply jsonrpc2.Replier, r jsonrpc2.Request) (bool, error) {
73	switch r.Method() {
74	case "workspace/didChangeWorkspaceFolders": // notif
75		var params DidChangeWorkspaceFoldersParams
76		if err := json.Unmarshal(r.Params(), &params); err != nil {
77			return true, sendParseError(ctx, reply, err)
78		}
79		err := server.DidChangeWorkspaceFolders(ctx, &params)
80		return true, reply(ctx, nil, err)
81	case "window/workDoneProgress/cancel": // notif
82		var params WorkDoneProgressCancelParams
83		if err := json.Unmarshal(r.Params(), &params); err != nil {
84			return true, sendParseError(ctx, reply, err)
85		}
86		err := server.WorkDoneProgressCancel(ctx, &params)
87		return true, reply(ctx, nil, err)
88	case "workspace/semanticTokens/refresh": // notif
89		err := server.SemanticTokensRefresh(ctx)
90		return true, reply(ctx, nil, err)
91	case "initialized": // notif
92		var params InitializedParams
93		if err := json.Unmarshal(r.Params(), &params); err != nil {
94			return true, sendParseError(ctx, reply, err)
95		}
96		err := server.Initialized(ctx, &params)
97		return true, reply(ctx, nil, err)
98	case "exit": // notif
99		err := server.Exit(ctx)
100		return true, reply(ctx, nil, err)
101	case "workspace/didChangeConfiguration": // notif
102		var params DidChangeConfigurationParams
103		if err := json.Unmarshal(r.Params(), &params); err != nil {
104			return true, sendParseError(ctx, reply, err)
105		}
106		err := server.DidChangeConfiguration(ctx, &params)
107		return true, reply(ctx, nil, err)
108	case "textDocument/didOpen": // notif
109		var params DidOpenTextDocumentParams
110		if err := json.Unmarshal(r.Params(), &params); err != nil {
111			return true, sendParseError(ctx, reply, err)
112		}
113		err := server.DidOpen(ctx, &params)
114		return true, reply(ctx, nil, err)
115	case "textDocument/didChange": // notif
116		var params DidChangeTextDocumentParams
117		if err := json.Unmarshal(r.Params(), &params); err != nil {
118			return true, sendParseError(ctx, reply, err)
119		}
120		err := server.DidChange(ctx, &params)
121		return true, reply(ctx, nil, err)
122	case "textDocument/didClose": // notif
123		var params DidCloseTextDocumentParams
124		if err := json.Unmarshal(r.Params(), &params); err != nil {
125			return true, sendParseError(ctx, reply, err)
126		}
127		err := server.DidClose(ctx, &params)
128		return true, reply(ctx, nil, err)
129	case "textDocument/didSave": // notif
130		var params DidSaveTextDocumentParams
131		if err := json.Unmarshal(r.Params(), &params); err != nil {
132			return true, sendParseError(ctx, reply, err)
133		}
134		err := server.DidSave(ctx, &params)
135		return true, reply(ctx, nil, err)
136	case "textDocument/willSave": // notif
137		var params WillSaveTextDocumentParams
138		if err := json.Unmarshal(r.Params(), &params); err != nil {
139			return true, sendParseError(ctx, reply, err)
140		}
141		err := server.WillSave(ctx, &params)
142		return true, reply(ctx, nil, err)
143	case "workspace/didChangeWatchedFiles": // notif
144		var params DidChangeWatchedFilesParams
145		if err := json.Unmarshal(r.Params(), &params); err != nil {
146			return true, sendParseError(ctx, reply, err)
147		}
148		err := server.DidChangeWatchedFiles(ctx, &params)
149		return true, reply(ctx, nil, err)
150	case "$/setTrace": // notif
151		var params SetTraceParams
152		if err := json.Unmarshal(r.Params(), &params); err != nil {
153			return true, sendParseError(ctx, reply, err)
154		}
155		err := server.SetTrace(ctx, &params)
156		return true, reply(ctx, nil, err)
157	case "$/logTrace": // notif
158		var params LogTraceParams
159		if err := json.Unmarshal(r.Params(), &params); err != nil {
160			return true, sendParseError(ctx, reply, err)
161		}
162		err := server.LogTrace(ctx, &params)
163		return true, reply(ctx, nil, err)
164	case "textDocument/implementation": // req
165		var params ImplementationParams
166		if err := json.Unmarshal(r.Params(), &params); err != nil {
167			return true, sendParseError(ctx, reply, err)
168		}
169		resp, err := server.Implementation(ctx, &params)
170		return true, reply(ctx, resp, err)
171	case "textDocument/typeDefinition": // req
172		var params TypeDefinitionParams
173		if err := json.Unmarshal(r.Params(), &params); err != nil {
174			return true, sendParseError(ctx, reply, err)
175		}
176		resp, err := server.TypeDefinition(ctx, &params)
177		return true, reply(ctx, resp, err)
178	case "textDocument/documentColor": // req
179		var params DocumentColorParams
180		if err := json.Unmarshal(r.Params(), &params); err != nil {
181			return true, sendParseError(ctx, reply, err)
182		}
183		resp, err := server.DocumentColor(ctx, &params)
184		return true, reply(ctx, resp, err)
185	case "textDocument/colorPresentation": // req
186		var params ColorPresentationParams
187		if err := json.Unmarshal(r.Params(), &params); err != nil {
188			return true, sendParseError(ctx, reply, err)
189		}
190		resp, err := server.ColorPresentation(ctx, &params)
191		return true, reply(ctx, resp, err)
192	case "textDocument/foldingRange": // req
193		var params FoldingRangeParams
194		if err := json.Unmarshal(r.Params(), &params); err != nil {
195			return true, sendParseError(ctx, reply, err)
196		}
197		resp, err := server.FoldingRange(ctx, &params)
198		return true, reply(ctx, resp, err)
199	case "textDocument/declaration": // req
200		var params DeclarationParams
201		if err := json.Unmarshal(r.Params(), &params); err != nil {
202			return true, sendParseError(ctx, reply, err)
203		}
204		resp, err := server.Declaration(ctx, &params)
205		return true, reply(ctx, resp, err)
206	case "textDocument/selectionRange": // req
207		var params SelectionRangeParams
208		if err := json.Unmarshal(r.Params(), &params); err != nil {
209			return true, sendParseError(ctx, reply, err)
210		}
211		resp, err := server.SelectionRange(ctx, &params)
212		return true, reply(ctx, resp, err)
213	case "textDocument/prepareCallHierarchy": // req
214		var params CallHierarchyPrepareParams
215		if err := json.Unmarshal(r.Params(), &params); err != nil {
216			return true, sendParseError(ctx, reply, err)
217		}
218		resp, err := server.PrepareCallHierarchy(ctx, &params)
219		return true, reply(ctx, resp, err)
220	case "callHierarchy/incomingCalls": // req
221		var params CallHierarchyIncomingCallsParams
222		if err := json.Unmarshal(r.Params(), &params); err != nil {
223			return true, sendParseError(ctx, reply, err)
224		}
225		resp, err := server.IncomingCalls(ctx, &params)
226		return true, reply(ctx, resp, err)
227	case "callHierarchy/outgoingCalls": // req
228		var params CallHierarchyOutgoingCallsParams
229		if err := json.Unmarshal(r.Params(), &params); err != nil {
230			return true, sendParseError(ctx, reply, err)
231		}
232		resp, err := server.OutgoingCalls(ctx, &params)
233		return true, reply(ctx, resp, err)
234	case "textDocument/semanticTokens/full": // req
235		var params SemanticTokensParams
236		if err := json.Unmarshal(r.Params(), &params); err != nil {
237			return true, sendParseError(ctx, reply, err)
238		}
239		resp, err := server.SemanticTokensFull(ctx, &params)
240		return true, reply(ctx, resp, err)
241	case "textDocument/semanticTokens/full/delta": // req
242		var params SemanticTokensDeltaParams
243		if err := json.Unmarshal(r.Params(), &params); err != nil {
244			return true, sendParseError(ctx, reply, err)
245		}
246		resp, err := server.SemanticTokensFullDelta(ctx, &params)
247		return true, reply(ctx, resp, err)
248	case "textDocument/semanticTokens/range": // req
249		var params SemanticTokensRangeParams
250		if err := json.Unmarshal(r.Params(), &params); err != nil {
251			return true, sendParseError(ctx, reply, err)
252		}
253		resp, err := server.SemanticTokensRange(ctx, &params)
254		return true, reply(ctx, resp, err)
255	case "initialize": // req
256		var params ParamInitialize
257		if err := json.Unmarshal(r.Params(), &params); err != nil {
258			return true, sendParseError(ctx, reply, err)
259		}
260		resp, err := server.Initialize(ctx, &params)
261		return true, reply(ctx, resp, err)
262	case "shutdown": // req
263		if len(r.Params()) > 0 {
264			return true, reply(ctx, nil, errors.Errorf("%w: expected no params", jsonrpc2.ErrInvalidParams))
265		}
266		err := server.Shutdown(ctx)
267		return true, reply(ctx, nil, err)
268	case "textDocument/willSaveWaitUntil": // req
269		var params WillSaveTextDocumentParams
270		if err := json.Unmarshal(r.Params(), &params); err != nil {
271			return true, sendParseError(ctx, reply, err)
272		}
273		resp, err := server.WillSaveWaitUntil(ctx, &params)
274		return true, reply(ctx, resp, err)
275	case "textDocument/completion": // req
276		var params CompletionParams
277		if err := json.Unmarshal(r.Params(), &params); err != nil {
278			return true, sendParseError(ctx, reply, err)
279		}
280		resp, err := server.Completion(ctx, &params)
281		return true, reply(ctx, resp, err)
282	case "completionItem/resolve": // req
283		var params CompletionItem
284		if err := json.Unmarshal(r.Params(), &params); err != nil {
285			return true, sendParseError(ctx, reply, err)
286		}
287		resp, err := server.Resolve(ctx, &params)
288		return true, reply(ctx, resp, err)
289	case "textDocument/hover": // req
290		var params HoverParams
291		if err := json.Unmarshal(r.Params(), &params); err != nil {
292			return true, sendParseError(ctx, reply, err)
293		}
294		resp, err := server.Hover(ctx, &params)
295		return true, reply(ctx, resp, err)
296	case "textDocument/signatureHelp": // req
297		var params SignatureHelpParams
298		if err := json.Unmarshal(r.Params(), &params); err != nil {
299			return true, sendParseError(ctx, reply, err)
300		}
301		resp, err := server.SignatureHelp(ctx, &params)
302		return true, reply(ctx, resp, err)
303	case "textDocument/definition": // req
304		var params DefinitionParams
305		if err := json.Unmarshal(r.Params(), &params); err != nil {
306			return true, sendParseError(ctx, reply, err)
307		}
308		resp, err := server.Definition(ctx, &params)
309		return true, reply(ctx, resp, err)
310	case "textDocument/references": // req
311		var params ReferenceParams
312		if err := json.Unmarshal(r.Params(), &params); err != nil {
313			return true, sendParseError(ctx, reply, err)
314		}
315		resp, err := server.References(ctx, &params)
316		return true, reply(ctx, resp, err)
317	case "textDocument/documentHighlight": // req
318		var params DocumentHighlightParams
319		if err := json.Unmarshal(r.Params(), &params); err != nil {
320			return true, sendParseError(ctx, reply, err)
321		}
322		resp, err := server.DocumentHighlight(ctx, &params)
323		return true, reply(ctx, resp, err)
324	case "textDocument/documentSymbol": // req
325		var params DocumentSymbolParams
326		if err := json.Unmarshal(r.Params(), &params); err != nil {
327			return true, sendParseError(ctx, reply, err)
328		}
329		resp, err := server.DocumentSymbol(ctx, &params)
330		return true, reply(ctx, resp, err)
331	case "textDocument/codeAction": // req
332		var params CodeActionParams
333		if err := json.Unmarshal(r.Params(), &params); err != nil {
334			return true, sendParseError(ctx, reply, err)
335		}
336		resp, err := server.CodeAction(ctx, &params)
337		return true, reply(ctx, resp, err)
338	case "workspace/symbol": // req
339		var params WorkspaceSymbolParams
340		if err := json.Unmarshal(r.Params(), &params); err != nil {
341			return true, sendParseError(ctx, reply, err)
342		}
343		resp, err := server.Symbol(ctx, &params)
344		return true, reply(ctx, resp, err)
345	case "textDocument/codeLens": // req
346		var params CodeLensParams
347		if err := json.Unmarshal(r.Params(), &params); err != nil {
348			return true, sendParseError(ctx, reply, err)
349		}
350		resp, err := server.CodeLens(ctx, &params)
351		return true, reply(ctx, resp, err)
352	case "codeLens/resolve": // req
353		var params CodeLens
354		if err := json.Unmarshal(r.Params(), &params); err != nil {
355			return true, sendParseError(ctx, reply, err)
356		}
357		resp, err := server.ResolveCodeLens(ctx, &params)
358		return true, reply(ctx, resp, err)
359	case "textDocument/documentLink": // req
360		var params DocumentLinkParams
361		if err := json.Unmarshal(r.Params(), &params); err != nil {
362			return true, sendParseError(ctx, reply, err)
363		}
364		resp, err := server.DocumentLink(ctx, &params)
365		return true, reply(ctx, resp, err)
366	case "documentLink/resolve": // req
367		var params DocumentLink
368		if err := json.Unmarshal(r.Params(), &params); err != nil {
369			return true, sendParseError(ctx, reply, err)
370		}
371		resp, err := server.ResolveDocumentLink(ctx, &params)
372		return true, reply(ctx, resp, err)
373	case "textDocument/formatting": // req
374		var params DocumentFormattingParams
375		if err := json.Unmarshal(r.Params(), &params); err != nil {
376			return true, sendParseError(ctx, reply, err)
377		}
378		resp, err := server.Formatting(ctx, &params)
379		return true, reply(ctx, resp, err)
380	case "textDocument/rangeFormatting": // req
381		var params DocumentRangeFormattingParams
382		if err := json.Unmarshal(r.Params(), &params); err != nil {
383			return true, sendParseError(ctx, reply, err)
384		}
385		resp, err := server.RangeFormatting(ctx, &params)
386		return true, reply(ctx, resp, err)
387	case "textDocument/onTypeFormatting": // req
388		var params DocumentOnTypeFormattingParams
389		if err := json.Unmarshal(r.Params(), &params); err != nil {
390			return true, sendParseError(ctx, reply, err)
391		}
392		resp, err := server.OnTypeFormatting(ctx, &params)
393		return true, reply(ctx, resp, err)
394	case "textDocument/rename": // req
395		var params RenameParams
396		if err := json.Unmarshal(r.Params(), &params); err != nil {
397			return true, sendParseError(ctx, reply, err)
398		}
399		resp, err := server.Rename(ctx, &params)
400		return true, reply(ctx, resp, err)
401	case "textDocument/prepareRename": // req
402		var params PrepareRenameParams
403		if err := json.Unmarshal(r.Params(), &params); err != nil {
404			return true, sendParseError(ctx, reply, err)
405		}
406		resp, err := server.PrepareRename(ctx, &params)
407		return true, reply(ctx, resp, err)
408	case "workspace/executeCommand": // req
409		var params ExecuteCommandParams
410		if err := json.Unmarshal(r.Params(), &params); err != nil {
411			return true, sendParseError(ctx, reply, err)
412		}
413		resp, err := server.ExecuteCommand(ctx, &params)
414		return true, reply(ctx, resp, err)
415
416	default:
417		return false, nil
418	}
419}
420
421func (s *serverDispatcher) DidChangeWorkspaceFolders(ctx context.Context, params *DidChangeWorkspaceFoldersParams) error {
422	return s.Conn.Notify(ctx, "workspace/didChangeWorkspaceFolders", params)
423}
424
425func (s *serverDispatcher) WorkDoneProgressCancel(ctx context.Context, params *WorkDoneProgressCancelParams) error {
426	return s.Conn.Notify(ctx, "window/workDoneProgress/cancel", params)
427}
428
429func (s *serverDispatcher) SemanticTokensRefresh(ctx context.Context) error {
430	return s.Conn.Notify(ctx, "workspace/semanticTokens/refresh", nil)
431}
432
433func (s *serverDispatcher) Initialized(ctx context.Context, params *InitializedParams) error {
434	return s.Conn.Notify(ctx, "initialized", params)
435}
436
437func (s *serverDispatcher) Exit(ctx context.Context) error {
438	return s.Conn.Notify(ctx, "exit", nil)
439}
440
441func (s *serverDispatcher) DidChangeConfiguration(ctx context.Context, params *DidChangeConfigurationParams) error {
442	return s.Conn.Notify(ctx, "workspace/didChangeConfiguration", params)
443}
444
445func (s *serverDispatcher) DidOpen(ctx context.Context, params *DidOpenTextDocumentParams) error {
446	return s.Conn.Notify(ctx, "textDocument/didOpen", params)
447}
448
449func (s *serverDispatcher) DidChange(ctx context.Context, params *DidChangeTextDocumentParams) error {
450	return s.Conn.Notify(ctx, "textDocument/didChange", params)
451}
452
453func (s *serverDispatcher) DidClose(ctx context.Context, params *DidCloseTextDocumentParams) error {
454	return s.Conn.Notify(ctx, "textDocument/didClose", params)
455}
456
457func (s *serverDispatcher) DidSave(ctx context.Context, params *DidSaveTextDocumentParams) error {
458	return s.Conn.Notify(ctx, "textDocument/didSave", params)
459}
460
461func (s *serverDispatcher) WillSave(ctx context.Context, params *WillSaveTextDocumentParams) error {
462	return s.Conn.Notify(ctx, "textDocument/willSave", params)
463}
464
465func (s *serverDispatcher) DidChangeWatchedFiles(ctx context.Context, params *DidChangeWatchedFilesParams) error {
466	return s.Conn.Notify(ctx, "workspace/didChangeWatchedFiles", params)
467}
468
469func (s *serverDispatcher) SetTrace(ctx context.Context, params *SetTraceParams) error {
470	return s.Conn.Notify(ctx, "$/setTrace", params)
471}
472
473func (s *serverDispatcher) LogTrace(ctx context.Context, params *LogTraceParams) error {
474	return s.Conn.Notify(ctx, "$/logTrace", params)
475}
476func (s *serverDispatcher) Implementation(ctx context.Context, params *ImplementationParams) (Definition /*Definition | DefinitionLink[] | null*/, error) {
477	var result Definition /*Definition | DefinitionLink[] | null*/
478	if err := Call(ctx, s.Conn, "textDocument/implementation", params, &result); err != nil {
479		return nil, err
480	}
481	return result, nil
482}
483
484func (s *serverDispatcher) TypeDefinition(ctx context.Context, params *TypeDefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) {
485	var result Definition /*Definition | DefinitionLink[] | null*/
486	if err := Call(ctx, s.Conn, "textDocument/typeDefinition", params, &result); err != nil {
487		return nil, err
488	}
489	return result, nil
490}
491
492func (s *serverDispatcher) DocumentColor(ctx context.Context, params *DocumentColorParams) ([]ColorInformation, error) {
493	var result []ColorInformation
494	if err := Call(ctx, s.Conn, "textDocument/documentColor", params, &result); err != nil {
495		return nil, err
496	}
497	return result, nil
498}
499
500func (s *serverDispatcher) ColorPresentation(ctx context.Context, params *ColorPresentationParams) ([]ColorPresentation, error) {
501	var result []ColorPresentation
502	if err := Call(ctx, s.Conn, "textDocument/colorPresentation", params, &result); err != nil {
503		return nil, err
504	}
505	return result, nil
506}
507
508func (s *serverDispatcher) FoldingRange(ctx context.Context, params *FoldingRangeParams) ([]FoldingRange /*FoldingRange[] | null*/, error) {
509	var result []FoldingRange /*FoldingRange[] | null*/
510	if err := Call(ctx, s.Conn, "textDocument/foldingRange", params, &result); err != nil {
511		return nil, err
512	}
513	return result, nil
514}
515
516func (s *serverDispatcher) Declaration(ctx context.Context, params *DeclarationParams) (Declaration /*Declaration | DeclarationLink[] | null*/, error) {
517	var result Declaration /*Declaration | DeclarationLink[] | null*/
518	if err := Call(ctx, s.Conn, "textDocument/declaration", params, &result); err != nil {
519		return nil, err
520	}
521	return result, nil
522}
523
524func (s *serverDispatcher) SelectionRange(ctx context.Context, params *SelectionRangeParams) ([]SelectionRange /*SelectionRange[] | null*/, error) {
525	var result []SelectionRange /*SelectionRange[] | null*/
526	if err := Call(ctx, s.Conn, "textDocument/selectionRange", params, &result); err != nil {
527		return nil, err
528	}
529	return result, nil
530}
531
532func (s *serverDispatcher) PrepareCallHierarchy(ctx context.Context, params *CallHierarchyPrepareParams) ([]CallHierarchyItem /*CallHierarchyItem[] | null*/, error) {
533	var result []CallHierarchyItem /*CallHierarchyItem[] | null*/
534	if err := Call(ctx, s.Conn, "textDocument/prepareCallHierarchy", params, &result); err != nil {
535		return nil, err
536	}
537	return result, nil
538}
539
540func (s *serverDispatcher) IncomingCalls(ctx context.Context, params *CallHierarchyIncomingCallsParams) ([]CallHierarchyIncomingCall /*CallHierarchyIncomingCall[] | null*/, error) {
541	var result []CallHierarchyIncomingCall /*CallHierarchyIncomingCall[] | null*/
542	if err := Call(ctx, s.Conn, "callHierarchy/incomingCalls", params, &result); err != nil {
543		return nil, err
544	}
545	return result, nil
546}
547
548func (s *serverDispatcher) OutgoingCalls(ctx context.Context, params *CallHierarchyOutgoingCallsParams) ([]CallHierarchyOutgoingCall /*CallHierarchyOutgoingCall[] | null*/, error) {
549	var result []CallHierarchyOutgoingCall /*CallHierarchyOutgoingCall[] | null*/
550	if err := Call(ctx, s.Conn, "callHierarchy/outgoingCalls", params, &result); err != nil {
551		return nil, err
552	}
553	return result, nil
554}
555
556func (s *serverDispatcher) SemanticTokensFull(ctx context.Context, params *SemanticTokensParams) (*SemanticTokens /*SemanticTokens | null*/, error) {
557	var result *SemanticTokens /*SemanticTokens | null*/
558	if err := Call(ctx, s.Conn, "textDocument/semanticTokens/full", params, &result); err != nil {
559		return nil, err
560	}
561	return result, nil
562}
563
564func (s *serverDispatcher) SemanticTokensFullDelta(ctx context.Context, params *SemanticTokensDeltaParams) (interface{} /* SemanticTokens | SemanticTokensDelta | nil*/, error) {
565	var result interface{} /* SemanticTokens | SemanticTokensDelta | nil*/
566	if err := Call(ctx, s.Conn, "textDocument/semanticTokens/full/delta", params, &result); err != nil {
567		return nil, err
568	}
569	return result, nil
570}
571
572func (s *serverDispatcher) SemanticTokensRange(ctx context.Context, params *SemanticTokensRangeParams) (*SemanticTokens /*SemanticTokens | null*/, error) {
573	var result *SemanticTokens /*SemanticTokens | null*/
574	if err := Call(ctx, s.Conn, "textDocument/semanticTokens/range", params, &result); err != nil {
575		return nil, err
576	}
577	return result, nil
578}
579
580func (s *serverDispatcher) Initialize(ctx context.Context, params *ParamInitialize) (*InitializeResult, error) {
581	var result *InitializeResult
582	if err := Call(ctx, s.Conn, "initialize", params, &result); err != nil {
583		return nil, err
584	}
585	return result, nil
586}
587
588func (s *serverDispatcher) Shutdown(ctx context.Context) error {
589	return Call(ctx, s.Conn, "shutdown", nil, nil)
590}
591
592func (s *serverDispatcher) WillSaveWaitUntil(ctx context.Context, params *WillSaveTextDocumentParams) ([]TextEdit /*TextEdit[] | null*/, error) {
593	var result []TextEdit /*TextEdit[] | null*/
594	if err := Call(ctx, s.Conn, "textDocument/willSaveWaitUntil", params, &result); err != nil {
595		return nil, err
596	}
597	return result, nil
598}
599
600func (s *serverDispatcher) Completion(ctx context.Context, params *CompletionParams) (*CompletionList /*CompletionItem[] | CompletionList | null*/, error) {
601	var result *CompletionList /*CompletionItem[] | CompletionList | null*/
602	if err := Call(ctx, s.Conn, "textDocument/completion", params, &result); err != nil {
603		return nil, err
604	}
605	return result, nil
606}
607
608func (s *serverDispatcher) Resolve(ctx context.Context, params *CompletionItem) (*CompletionItem, error) {
609	var result *CompletionItem
610	if err := Call(ctx, s.Conn, "completionItem/resolve", params, &result); err != nil {
611		return nil, err
612	}
613	return result, nil
614}
615
616func (s *serverDispatcher) Hover(ctx context.Context, params *HoverParams) (*Hover /*Hover | null*/, error) {
617	var result *Hover /*Hover | null*/
618	if err := Call(ctx, s.Conn, "textDocument/hover", params, &result); err != nil {
619		return nil, err
620	}
621	return result, nil
622}
623
624func (s *serverDispatcher) SignatureHelp(ctx context.Context, params *SignatureHelpParams) (*SignatureHelp /*SignatureHelp | null*/, error) {
625	var result *SignatureHelp /*SignatureHelp | null*/
626	if err := Call(ctx, s.Conn, "textDocument/signatureHelp", params, &result); err != nil {
627		return nil, err
628	}
629	return result, nil
630}
631
632func (s *serverDispatcher) Definition(ctx context.Context, params *DefinitionParams) (Definition /*Definition | DefinitionLink[] | null*/, error) {
633	var result Definition /*Definition | DefinitionLink[] | null*/
634	if err := Call(ctx, s.Conn, "textDocument/definition", params, &result); err != nil {
635		return nil, err
636	}
637	return result, nil
638}
639
640func (s *serverDispatcher) References(ctx context.Context, params *ReferenceParams) ([]Location /*Location[] | null*/, error) {
641	var result []Location /*Location[] | null*/
642	if err := Call(ctx, s.Conn, "textDocument/references", params, &result); err != nil {
643		return nil, err
644	}
645	return result, nil
646}
647
648func (s *serverDispatcher) DocumentHighlight(ctx context.Context, params *DocumentHighlightParams) ([]DocumentHighlight /*DocumentHighlight[] | null*/, error) {
649	var result []DocumentHighlight /*DocumentHighlight[] | null*/
650	if err := Call(ctx, s.Conn, "textDocument/documentHighlight", params, &result); err != nil {
651		return nil, err
652	}
653	return result, nil
654}
655
656func (s *serverDispatcher) DocumentSymbol(ctx context.Context, params *DocumentSymbolParams) ([]interface{} /*SymbolInformation[] | DocumentSymbol[] | null*/, error) {
657	var result []interface{} /*SymbolInformation[] | DocumentSymbol[] | null*/
658	if err := Call(ctx, s.Conn, "textDocument/documentSymbol", params, &result); err != nil {
659		return nil, err
660	}
661	return result, nil
662}
663
664func (s *serverDispatcher) CodeAction(ctx context.Context, params *CodeActionParams) ([]CodeAction /*(Command | CodeAction)[] | null*/, error) {
665	var result []CodeAction /*(Command | CodeAction)[] | null*/
666	if err := Call(ctx, s.Conn, "textDocument/codeAction", params, &result); err != nil {
667		return nil, err
668	}
669	return result, nil
670}
671
672func (s *serverDispatcher) Symbol(ctx context.Context, params *WorkspaceSymbolParams) ([]SymbolInformation /*SymbolInformation[] | null*/, error) {
673	var result []SymbolInformation /*SymbolInformation[] | null*/
674	if err := Call(ctx, s.Conn, "workspace/symbol", params, &result); err != nil {
675		return nil, err
676	}
677	return result, nil
678}
679
680func (s *serverDispatcher) CodeLens(ctx context.Context, params *CodeLensParams) ([]CodeLens /*CodeLens[] | null*/, error) {
681	var result []CodeLens /*CodeLens[] | null*/
682	if err := Call(ctx, s.Conn, "textDocument/codeLens", params, &result); err != nil {
683		return nil, err
684	}
685	return result, nil
686}
687
688func (s *serverDispatcher) ResolveCodeLens(ctx context.Context, params *CodeLens) (*CodeLens, error) {
689	var result *CodeLens
690	if err := Call(ctx, s.Conn, "codeLens/resolve", params, &result); err != nil {
691		return nil, err
692	}
693	return result, nil
694}
695
696func (s *serverDispatcher) DocumentLink(ctx context.Context, params *DocumentLinkParams) ([]DocumentLink /*DocumentLink[] | null*/, error) {
697	var result []DocumentLink /*DocumentLink[] | null*/
698	if err := Call(ctx, s.Conn, "textDocument/documentLink", params, &result); err != nil {
699		return nil, err
700	}
701	return result, nil
702}
703
704func (s *serverDispatcher) ResolveDocumentLink(ctx context.Context, params *DocumentLink) (*DocumentLink, error) {
705	var result *DocumentLink
706	if err := Call(ctx, s.Conn, "documentLink/resolve", params, &result); err != nil {
707		return nil, err
708	}
709	return result, nil
710}
711
712func (s *serverDispatcher) Formatting(ctx context.Context, params *DocumentFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) {
713	var result []TextEdit /*TextEdit[] | null*/
714	if err := Call(ctx, s.Conn, "textDocument/formatting", params, &result); err != nil {
715		return nil, err
716	}
717	return result, nil
718}
719
720func (s *serverDispatcher) RangeFormatting(ctx context.Context, params *DocumentRangeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) {
721	var result []TextEdit /*TextEdit[] | null*/
722	if err := Call(ctx, s.Conn, "textDocument/rangeFormatting", params, &result); err != nil {
723		return nil, err
724	}
725	return result, nil
726}
727
728func (s *serverDispatcher) OnTypeFormatting(ctx context.Context, params *DocumentOnTypeFormattingParams) ([]TextEdit /*TextEdit[] | null*/, error) {
729	var result []TextEdit /*TextEdit[] | null*/
730	if err := Call(ctx, s.Conn, "textDocument/onTypeFormatting", params, &result); err != nil {
731		return nil, err
732	}
733	return result, nil
734}
735
736func (s *serverDispatcher) Rename(ctx context.Context, params *RenameParams) (*WorkspaceEdit /*WorkspaceEdit | null*/, error) {
737	var result *WorkspaceEdit /*WorkspaceEdit | null*/
738	if err := Call(ctx, s.Conn, "textDocument/rename", params, &result); err != nil {
739		return nil, err
740	}
741	return result, nil
742}
743
744func (s *serverDispatcher) PrepareRename(ctx context.Context, params *PrepareRenameParams) (*Range /*Range | { range: Range, placeholder: string } | { defaultBehavior: boolean } | null*/, error) {
745	var result *Range /*Range | { range: Range, placeholder: string } | { defaultBehavior: boolean } | null*/
746	if err := Call(ctx, s.Conn, "textDocument/prepareRename", params, &result); err != nil {
747		return nil, err
748	}
749	return result, nil
750}
751
752func (s *serverDispatcher) ExecuteCommand(ctx context.Context, params *ExecuteCommandParams) (interface{} /*any | null*/, error) {
753	var result interface{} /*any | null*/
754	if err := Call(ctx, s.Conn, "workspace/executeCommand", params, &result); err != nil {
755		return nil, err
756	}
757	return result, nil
758}
759
760func (s *serverDispatcher) NonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error) {
761	var result interface{}
762	if err := Call(ctx, s.Conn, method, params, &result); err != nil {
763		return nil, err
764	}
765	return result, nil
766}
767