1
0
mirror of https://github.com/golang/go synced 2024-11-05 14:46:11 -07:00
go/internal/lsp/analysis
Rebecca Stambler 4025ed8474 internal/lsp: move fillstruct suggested fixes out of analysis
This change moves the suggested fixes logic for fillstruct out of the
analysis and into internal/lsp/source. This logic is then used as part
of a new fillstruct command. This command is returned along with the
code action results, to be executed only when the user accepts the code
action.

This led to a number of changes to testing. The suggested fix tests in
internal/lsp doesn't support executing commands, so we skip them. The
suggested fix tests in internal/lsp/source are changed to call
fillstruct directly. A new regtest is added to check the command
execution, which led to a few regtest changes.

Also, remove the `go mod tidy` code action, as it's made redundant by
the existence of the suggested fixes coming from internal/lsp/mod.

Change-Id: I35ca0aff1ace8f0097fe7cb57232997facb516a4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/241983
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-07-20 20:42:44 +00:00
..
fillreturns internal/lsp/analysis/fillreturns: implement matching in fillreturns 2020-06-11 16:18:57 +00:00
fillstruct internal/lsp: move fillstruct suggested fixes out of analysis 2020-07-20 20:42:44 +00:00
nonewvars internal/lsp: add type error fixes to existing diagnostics 2020-04-08 01:45:16 +00:00
noresultvalues internal/lsp: add type error fixes to existing diagnostics 2020-04-08 01:45:16 +00:00
simplifycompositelit internal/lsp: make sure that gofmt -s analyses don't modify AST 2020-04-06 21:01:14 +00:00
simplifyrange internal/lsp: make sure that gofmt -s analyses don't modify AST 2020-04-06 21:01:14 +00:00
simplifyslice internal/lsp: make sure that gofmt -s analyses don't modify AST 2020-04-06 21:01:14 +00:00
undeclaredname internal/lsp: extract highlighted selection to variable 2020-07-07 21:12:28 +00:00
unusedparams internal/lsp/analysis: add pass for unused parameters 2020-03-26 20:36:28 +00:00