-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/lsp/source: fix Fix titles
Previously, many diagnostics were produced with messages that were in fact the titles of suggested fixes (e.g. "Fill struct S"); conversely, many suggested fixes appeared in the client UI with a message that was in fact the text of the diagnostic it was supposed to fix (e.g. "undeclared name: x"). This change reorganizes the way suggested fixes are handled so that, for fixes produced by analyzers, the analyzer output (Diagnostic and SuggestedFix) determines the LSP output. An SuggestedFix with no edits is assumed to have fixer support in ApplyFix; the name of the fixer is determined by the Diagnostic's Category. (Ideally we would use SuggestedFix.Category in case a diagnostic has more than one lazy fix, but there's no such field.) Fixers whose commands are constructed directly by the Code Action method are essentially unchanged. There is still a need for some kind of framework for registering (analyzers, category, fixer) triples, but this is a first step. Fixes golang/go#65087 Change-Id: Id72f3fd187d42df9c3711f4d3be140f9ea7af1d7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/556755 Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
17 changed files
with
300 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.