mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00: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:
parent
6c790d6458
commit
c52e9e2de4
@ -178,16 +178,15 @@ func (s *Server) fetchConfig(ctx context.Context, name string, folder span.URI,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
v := protocol.ParamConfig{
|
v := protocol.ParamConfig{
|
||||||
protocol.ConfigurationParams{
|
ConfigurationParams: protocol.ConfigurationParams{
|
||||||
Items: []protocol.ConfigurationItem{{
|
Items: []protocol.ConfigurationItem{{
|
||||||
ScopeURI: protocol.NewURI(folder),
|
ScopeURI: protocol.NewURI(folder),
|
||||||
Section: "gopls",
|
Section: "gopls",
|
||||||
}, {
|
}, {
|
||||||
ScopeURI: protocol.NewURI(folder),
|
ScopeURI: protocol.NewURI(folder),
|
||||||
Section: name,
|
Section: name,
|
||||||
},
|
}},
|
||||||
},
|
},
|
||||||
}, protocol.PartialResultParams{},
|
|
||||||
}
|
}
|
||||||
configs, err := s.client.Configuration(ctx, &v)
|
configs, err := s.client.Configuration(ctx, &v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -614,24 +614,19 @@ func (r *runner) Definition(t *testing.T, data tests.Definitions) {
|
|||||||
var hover *protocol.Hover
|
var hover *protocol.Hover
|
||||||
if d.IsType {
|
if d.IsType {
|
||||||
params := &protocol.TypeDefinitionParams{
|
params := &protocol.TypeDefinitionParams{
|
||||||
tdpp,
|
TextDocumentPositionParams: tdpp,
|
||||||
protocol.WorkDoneProgressParams{},
|
|
||||||
protocol.PartialResultParams{},
|
|
||||||
}
|
}
|
||||||
locs, err = r.server.TypeDefinition(r.ctx, params)
|
locs, err = r.server.TypeDefinition(r.ctx, params)
|
||||||
} else {
|
} else {
|
||||||
params := &protocol.DefinitionParams{
|
params := &protocol.DefinitionParams{
|
||||||
tdpp,
|
TextDocumentPositionParams: tdpp,
|
||||||
protocol.WorkDoneProgressParams{},
|
|
||||||
protocol.PartialResultParams{},
|
|
||||||
}
|
}
|
||||||
locs, err = r.server.Definition(r.ctx, params)
|
locs, err = r.server.Definition(r.ctx, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed for %v: %+v", d.Src, err)
|
t.Fatalf("failed for %v: %+v", d.Src, err)
|
||||||
}
|
}
|
||||||
v := &protocol.HoverParams{
|
v := &protocol.HoverParams{
|
||||||
tdpp,
|
TextDocumentPositionParams: tdpp,
|
||||||
protocol.WorkDoneProgressParams{},
|
|
||||||
}
|
}
|
||||||
hover, err = r.server.Hover(r.ctx, v)
|
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,
|
Position: loc.Range.Start,
|
||||||
}
|
}
|
||||||
params := &protocol.DocumentHighlightParams{
|
params := &protocol.DocumentHighlightParams{
|
||||||
tdpp,
|
TextDocumentPositionParams: tdpp,
|
||||||
protocol.WorkDoneProgressParams{},
|
|
||||||
protocol.PartialResultParams{},
|
|
||||||
}
|
}
|
||||||
highlights, err := r.server.DocumentHighlight(r.ctx, params)
|
highlights, err := r.server.DocumentHighlight(r.ctx, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -829,8 +822,7 @@ func (r *runner) PrepareRename(t *testing.T, data tests.PrepareRenames) {
|
|||||||
Position: loc.Range.Start,
|
Position: loc.Range.Start,
|
||||||
}
|
}
|
||||||
params := &protocol.PrepareRenameParams{
|
params := &protocol.PrepareRenameParams{
|
||||||
tdpp,
|
TextDocumentPositionParams: tdpp,
|
||||||
protocol.WorkDoneProgressParams{},
|
|
||||||
}
|
}
|
||||||
got, err := r.server.PrepareRename(context.Background(), params)
|
got, err := r.server.PrepareRename(context.Background(), params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -946,8 +938,7 @@ func (r *runner) SignatureHelp(t *testing.T, data tests.Signatures) {
|
|||||||
Position: loc.Range.Start,
|
Position: loc.Range.Start,
|
||||||
}
|
}
|
||||||
params := &protocol.SignatureHelpParams{
|
params := &protocol.SignatureHelpParams{
|
||||||
tdpp,
|
TextDocumentPositionParams: tdpp,
|
||||||
protocol.WorkDoneProgressParams{},
|
|
||||||
}
|
}
|
||||||
gotSignatures, err := r.server.SignatureHelp(r.ctx, params)
|
gotSignatures, err := r.server.SignatureHelp(r.ctx, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user