internal/lsp: add titles to `go mod tidy` and update go.sum fixes

These were missing titles, which was showing up empty for users in the
VS Code UI and leading people not to trust the fixes.

Also did a find references on SuggestedFix to confirm that we always
set the title in other cases.

Fixes golang/go#43234

Change-Id: I8d0f272c383a2e1a364aefcec6650988d18d4fb4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/278778
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 2020-12-16 21:45:14 -05:00
parent fa10ef0b87
commit 48e5bd1105
1 changed files with 2 additions and 0 deletions

View File

@ -209,6 +209,7 @@ See https://github.com/golang/go/issues/39164 for more detail on this issue.`,
Message: `go.sum is out of sync with go.mod. Please update it or run "go mod tidy".`,
SuggestedFixes: []source.SuggestedFix{
{
Title: source.CommandTidy.Title,
Command: &protocol.Command{
Command: source.CommandTidy.ID(),
Title: source.CommandTidy.Title,
@ -216,6 +217,7 @@ See https://github.com/golang/go/issues/39164 for more detail on this issue.`,
},
},
{
Title: source.CommandUpdateGoSum.Title,
Command: &protocol.Command{
Command: source.CommandUpdateGoSum.ID(),
Title: source.CommandUpdateGoSum.Title,