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