1
0
mirror of https://github.com/golang/go synced 2024-11-06 02:16:10 -07:00
go/internal/lsp/analysis
Rebecca Stambler e31b568ad1 internal/lsp: plumb fillstruct through analysis
Now that fillstruct is an analyzer, we can simplify the code that calls
it in code_action.go. We introduce a new class of analyzer --
convenience analyzers, which are closer to commands. These represent
suggestions that won't necessarily improve the quality or correctness of
your code, but they offer small helper functions for the user.

This CL also combines the refactor rewrite tests with the suggested fix
tests, since they are effectively the same.

For now, we only support convenience analyzers when a code action was
requested on the same line as the fix. I'm not sure how to otherwise
handle this without bothering the user with unnecessary diagnostics.

Change-Id: I7f0aa198b5ee9964a907d709bae6380093d4ef21
Reviewed-on: https://go-review.googlesource.com/c/tools/+/237687
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-06-15 21:22:08 +00:00
..
fillreturns internal/lsp/analysis/fillreturns: implement matching in fillreturns 2020-06-11 16:18:57 +00:00
fillstruct internal/lsp: plumb fillstruct through analysis 2020-06-15 21:22:08 +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: add type error fixes to existing diagnostics 2020-04-08 01:45:16 +00:00
unusedparams