Skip to content

Commit 062bf4e

Browse files
committed
internal/lsp: make ShowDocument RPC available to gopls
The window/showDocument RPC is now correctly classified as being sent from the server to the client. Change-Id: I659528af69662fb709242d326563d52070fd5702 Reviewed-on: https://go-review.googlesource.com/c/tools/+/315990 Run-TryBot: Peter Weinberger <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Peter Weinberger <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 3e17c62 commit 062bf4e

File tree

6 files changed

+25
-20
lines changed

6 files changed

+25
-20
lines changed

internal/lsp/cmd/cmd.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ func (c *cmdClient) Progress(context.Context, *protocol.ProgressParams) error {
443443
return nil
444444
}
445445

446+
func (c *cmdClient) ShowDocument(context.Context, *protocol.ShowDocumentParams) (*protocol.ShowDocumentResult, error) {
447+
return nil, nil
448+
}
449+
446450
func (c *cmdClient) WorkDoneProgressCreate(context.Context, *protocol.WorkDoneProgressCreateParams) error {
447451
return nil
448452
}

internal/lsp/fake/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func (c *Client) WorkDoneProgressCreate(ctx context.Context, params *protocol.Wo
111111
return nil
112112
}
113113

114+
func (c *Client) ShowDocument(context.Context, *protocol.ShowDocumentParams) (*protocol.ShowDocumentResult, error) {
115+
return nil, nil
116+
}
117+
114118
// ApplyEdit applies edits sent from the server.
115119
func (c *Client) ApplyEdit(ctx context.Context, params *protocol.ApplyWorkspaceEditParams) (*protocol.ApplyWorkspaceEditResponse, error) {
116120
if len(params.Edit.Changes) != 0 {

internal/lsp/protocol/tsclient.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lsp/protocol/tsserver.go

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/lsp/protocol/typescript/code.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ function setReceives() {
135135
receives.set('workspace/applyEdit', 'client');
136136
receives.set('textDocument/publishDiagnostics', 'client');
137137
receives.set('window/workDoneProgress/create', 'client');
138+
receives.set('window/showDocument', 'client');
138139
receives.set('$/progress', 'client');
139140
// a small check
140141
receives.forEach((_, k) => {

internal/lsp/server_gen.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,6 @@ func (s *Server) SetTrace(context.Context, *protocol.SetTraceParams) error {
228228
return notImplemented("SetTrace")
229229
}
230230

231-
func (s *Server) ShowDocument(context.Context, *protocol.ShowDocumentParams) (*protocol.ShowDocumentResult, error) {
232-
return nil, notImplemented("ShowDocument")
233-
}
234-
235231
func (s *Server) Shutdown(ctx context.Context) error {
236232
return s.shutdown(ctx)
237233
}

0 commit comments

Comments
 (0)