1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:54:42 -07:00

internal/lsp: fix vet errors

Change-Id: I2435140e7b2b419df704e994ec45ad75932421b1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/195877
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
Rebecca Stambler 2019-09-17 00:38:16 -04:00
parent 6c790d6458
commit c52e9e2de4
2 changed files with 9 additions and 19 deletions

View File

@ -178,16 +178,15 @@ func (s *Server) fetchConfig(ctx context.Context, name string, folder span.URI,
return nil
}
v := protocol.ParamConfig{
protocol.ConfigurationParams{
ConfigurationParams: protocol.ConfigurationParams{
Items: []protocol.ConfigurationItem{{
ScopeURI: protocol.NewURI(folder),
Section: "gopls",
}, {
ScopeURI: protocol.NewURI(folder),
Section: name,
},
},
}, protocol.PartialResultParams{},
}},
},
}
configs, err := s.client.Configuration(ctx, &v)
if err != nil {

View File

@ -614,24 +614,19 @@ func (r *runner) Definition(t *testing.T, data tests.Definitions) {
var hover *protocol.Hover
if d.IsType {
params := &protocol.TypeDefinitionParams{
tdpp,
protocol.WorkDoneProgressParams{},
protocol.PartialResultParams{},
TextDocumentPositionParams: tdpp,
}
locs, err = r.server.TypeDefinition(r.ctx, params)
} else {
params := &protocol.DefinitionParams{
tdpp,
protocol.WorkDoneProgressParams{},
protocol.PartialResultParams{},
TextDocumentPositionParams: tdpp,
}
locs, err = r.server.Definition(r.ctx, params)
if err != nil {
t.Fatalf("failed for %v: %+v", d.Src, err)
}
v := &protocol.HoverParams{
tdpp,
protocol.WorkDoneProgressParams{},
TextDocumentPositionParams: tdpp,
}
hover, err = r.server.Hover(r.ctx, v)
}
@ -681,9 +676,7 @@ func (r *runner) Highlight(t *testing.T, data tests.Highlights) {
Position: loc.Range.Start,
}
params := &protocol.DocumentHighlightParams{
tdpp,
protocol.WorkDoneProgressParams{},
protocol.PartialResultParams{},
TextDocumentPositionParams: tdpp,
}
highlights, err := r.server.DocumentHighlight(r.ctx, params)
if err != nil {
@ -829,8 +822,7 @@ func (r *runner) PrepareRename(t *testing.T, data tests.PrepareRenames) {
Position: loc.Range.Start,
}
params := &protocol.PrepareRenameParams{
tdpp,
protocol.WorkDoneProgressParams{},
TextDocumentPositionParams: tdpp,
}
got, err := r.server.PrepareRename(context.Background(), params)
if err != nil {
@ -946,8 +938,7 @@ func (r *runner) SignatureHelp(t *testing.T, data tests.Signatures) {
Position: loc.Range.Start,
}
params := &protocol.SignatureHelpParams{
tdpp,
protocol.WorkDoneProgressParams{},
TextDocumentPositionParams: tdpp,
}
gotSignatures, err := r.server.SignatureHelp(r.ctx, params)
if err != nil {