Skip to content

Commit

Permalink
Merge pull request #157 from prometheus-community/error_msgs
Browse files Browse the repository at this point in the history
Avoid certain error messages shown in VS Code
  • Loading branch information
slrtbtfs authored May 30, 2020
2 parents b2be2c0 + ee3185a commit 8ea8e68
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions langserver/notImplemented.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ func (s *server) Symbol(_ context.Context, _ *protocol.WorkspaceSymbolParams) ([

// CodeLens is required by the protocol.Server interface.
func (s *server) CodeLens(_ context.Context, _ *protocol.CodeLensParams) ([]protocol.CodeLens, error) {
return nil, notImplemented("CodeLens")
// As of version 0.4.0 of gopls it is not possible to instruct the language
// client to stop asking for Code Lenses and Document Links. To prevent
// VS Code from showing error messages, this feature is implemented by
// returning empty values.
return nil, nil
}

// ResolveCodeLens is required by the protocol.Server interface.
Expand Down Expand Up @@ -173,7 +177,11 @@ func (s *server) Rename(_ context.Context, _ *protocol.RenameParams) (*protocol.

// DocumentLink is required by the protocol.Server interface.
func (s *server) DocumentLink(_ context.Context, _ *protocol.DocumentLinkParams) ([]protocol.DocumentLink, error) {
return nil, notImplemented("DocumentLink")
// As of version 0.4.0 of gopls it is not possible to instruct the language
// client to stop asking for Code Lenses and Document Links. To prevent
// VS Code from showing error messages, this feature is implemented by
// returning empty values.
return nil, nil
}

// ResolveDocumentLink is required by the protocol.Server interface.
Expand Down

0 comments on commit 8ea8e68

Please sign in to comment.