Skip to content

Commit

Permalink
gopls/protocol: use the current definition of the lsp
Browse files Browse the repository at this point in the history
There are no changes to main line gopls code.

The type of ParamInitialize.Trace changes from string to a string
type TraceValues. This only affects fake/editor.go

Four messages were changed to go from the server to the client,
necessitating changes to the various test clients.

Some copied comments in tsprotocol.go have changed.

Finally, the parse completeness test found a new field, Deprecated,
in metaModel.json. It duplicates information already in
the Documentation field.

Change-Id: I14bbc63e8b1a1aebb7cd2d55ce282fe42568ecc2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/464095
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
  • Loading branch information
pjweinbgo committed Jan 31, 2023
1 parent aa633e7 commit 072fca5
Show file tree
Hide file tree
Showing 9 changed files with 886 additions and 883 deletions.
16 changes: 16 additions & 0 deletions gopls/internal/lsp/cmd/cmd.go
Expand Up @@ -528,6 +528,22 @@ func (c *cmdClient) WorkDoneProgressCreate(context.Context, *protocol.WorkDonePr
return nil
}

func (c *cmdClient) DiagnosticRefresh(context.Context) error {
return nil
}

func (c *cmdClient) InlayHintRefresh(context.Context) error {
return nil
}

func (c *cmdClient) SemanticTokensRefresh(context.Context) error {
return nil
}

func (c *cmdClient) InlineValueRefresh(context.Context) error {
return nil
}

func (c *cmdClient) getFile(ctx context.Context, uri span.URI) *cmdFile {
file, found := c.files[uri]
if !found || file.err != nil {
Expand Down
8 changes: 8 additions & 0 deletions gopls/internal/lsp/fake/client.go
Expand Up @@ -34,6 +34,14 @@ type Client struct {

func (c *Client) CodeLensRefresh(context.Context) error { return nil }

func (c *Client) InlayHintRefresh(context.Context) error { return nil }

func (c *Client) DiagnosticRefresh(context.Context) error { return nil }

func (c *Client) InlineValueRefresh(context.Context) error { return nil }

func (c *Client) SemanticTokensRefresh(context.Context) error { return nil }

func (c *Client) LogTrace(context.Context, *protocol.LogTraceParams) error { return nil }

func (c *Client) ShowMessage(ctx context.Context, params *protocol.ShowMessageParams) error {
Expand Down
3 changes: 2 additions & 1 deletion gopls/internal/lsp/fake/editor.go
Expand Up @@ -279,7 +279,8 @@ func (e *Editor) initialize(ctx context.Context) error {
},
}

params.Trace = "messages"
trace := protocol.TraceValues("messages")
params.Trace = &trace
// TODO: support workspace folders.
if e.Server != nil {
resp, err := e.Server.Initialize(ctx, params)
Expand Down
2 changes: 2 additions & 0 deletions gopls/internal/lsp/protocol/generate/types.go
Expand Up @@ -85,6 +85,7 @@ type Enumeration struct {
// A TypeAlias is the parsed version of an LSP type alias from the spec
type TypeAlias struct {
Documentation string `json:"documentation"`
Deprecated string `json:"deprecated"`
Name string `json:"name"`
Proposed bool `json:"proposed"`
Since string `json:"since"`
Expand Down Expand Up @@ -125,6 +126,7 @@ type NameType struct {
Type *Type `json:"type"`
Optional bool `json:"optional"`
Documentation string `json:"documentation"`
Deprecated string `json:"deprecated"`
Since string `json:"since"`
Proposed bool `json:"proposed"`
Line int `json:"line"`
Expand Down
30 changes: 29 additions & 1 deletion gopls/internal/lsp/protocol/tsclient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 072fca5

Please sign in to comment.