internal/lsp: address Rob's comments from CL 289772

Change-Id: Ifc5431b2e549c5221d66f7771dac47fcb70afb56
Reviewed-on: https://go-review.googlesource.com/c/tools/+/290829
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Rebecca Stambler 2021-02-09 22:53:49 -05:00
parent d459050367
commit 51f72a196f
5 changed files with 6 additions and 12 deletions

View File

@ -193,7 +193,7 @@ Args:
```
{
// The file URI.
// The file URIs.
"URIs": []string,
}
```
@ -221,7 +221,7 @@ Args:
```
{
// The file URI.
// The file URIs.
"URIs": []string,
}
```

View File

@ -826,7 +826,7 @@ func main() {
if d.Message != `go.sum is out of sync with go.mod. Please update it by applying the quick fix.` {
continue
}
actions, err := env.GetQuickFixes("a/go.mod", []protocol.Diagnostic{d})
actions, err := env.Editor.GetQuickFixes(env.Ctx, "a/go.mod", nil, []protocol.Diagnostic{d})
if err != nil {
t.Fatal(err)
}

View File

@ -200,12 +200,6 @@ func (e *Env) ApplyQuickFixes(path string, diagnostics []protocol.Diagnostic) {
}
}
// GetQuickFixes returns the available quick fix code actions.
func (e *Env) GetQuickFixes(path string, diagnostics []protocol.Diagnostic) ([]protocol.CodeAction, error) {
e.T.Helper()
return e.Editor.GetQuickFixes(e.Ctx, path, nil, diagnostics)
}
// Hover in the editor, calling t.Fatal on any error.
func (e *Env) Hover(name string, pos fake.Pos) (*protocol.MarkupContent, fake.Pos) {
e.T.Helper()

View File

@ -152,7 +152,7 @@ type URIArg struct {
}
type URIArgs struct {
// The file URI.
// The file URIs.
URIs []protocol.DocumentURI
}

View File

@ -742,7 +742,7 @@ var GeneratedAPIJSON = &APIJSON{
Command: "gopls.tidy",
Title: "Run go mod tidy",
Doc: "Runs `go mod tidy` for a module.",
ArgDoc: "{\n\t// The file URI.\n\t\"URIs\": []string,\n}",
ArgDoc: "{\n\t// The file URIs.\n\t\"URIs\": []string,\n}",
},
{
Command: "gopls.toggle_gc_details",
@ -754,7 +754,7 @@ var GeneratedAPIJSON = &APIJSON{
Command: "gopls.update_go_sum",
Title: "Update go.sum",
Doc: "Updates the go.sum file for a module.",
ArgDoc: "{\n\t// The file URI.\n\t\"URIs\": []string,\n}",
ArgDoc: "{\n\t// The file URIs.\n\t\"URIs\": []string,\n}",
},
{
Command: "gopls.upgrade_dependency",