go/gopls/doc
Marwan Sulaiman 70c3ea29e2 gopls,internal/lsp: Implement method stubbing via CodeAction
This CL adds a quickfix CodeAction that detects "missing method"
compiler errors and suggests adding method stubs to the concrete
type that would implement the interface. There are many ways that
a user might indicate a concrete type is meant to be used as an interface.
This PR detects two types of those errors: variable declaration and function returns.
For variable declarations, things like the following should be detected:
1. var _ SomeInterface = SomeType{}
2. var _ = SomeInterface(SomeType{})
3. var _ SomeInterface = (*SomeType)(nil)
For function returns, the following example is the primary detection:
func newIface() SomeInterface {
	return &SomeType{}
}
More detections can be added in the future of course.

Fixes golang/go#37537

Change-Id: Ibb7784622184c9885eff2ccc786767682876b4d3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/274372
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-16 19:42:34 +00:00
..
design gopls/doc: clean up and slightly reorganize documentation 2021-01-14 06:55:38 +00:00
advanced.md doc: update the instruction to use beta2 2022-01-31 20:30:41 +00:00
analyzers.md gopls,internal/lsp: Implement method stubbing via CodeAction 2022-02-16 19:42:34 +00:00
command-line.md gopls/doc: remove bad gopls cli link 2021-10-20 20:41:51 +00:00
commands.md internal/lsp: add ListImports 2022-02-04 22:09:29 +00:00
contributing.md gopls/doc: add instructions for the new "kokoro rerun" feature 2021-09-20 19:55:18 +00:00
daemon.md gopls/doc: clarify how to set remote.listen.timeout 2021-03-08 14:22:49 +00:00
emacs.md Update emacs.md - add .dir-locals.el example 2021-03-19 04:40:15 +00:00
features.md gopls: change the default value for templateExtensions to be empty 2022-01-13 20:56:24 +00:00
generate.go gopls/doc: use improved code generator for API doc 2021-12-16 11:15:33 +00:00
generate_test.go gopls/doc: use improved code generator for API doc 2021-12-16 11:15:33 +00:00
semantictokens.md internal/lsp: produce "method" in place of "member" as per the spec 2021-09-13 21:01:54 +00:00
settings.md gopls: make 'fastfuzzy' the default fuzzy matcher for workspace symbols 2022-02-03 14:26:36 +00:00
subl.md gopls/doc: how to request a particular gopls w/ sublime text 2022-02-04 21:02:33 +00:00
troubleshooting.md gopls: merge README and user.md 2021-01-21 18:28:06 +00:00
vim.md gopls: update coc.nvim documentation for using go.work 2022-02-04 14:04:20 +00:00
workspace.md gopls/doc: fix broken link 2021-04-26 16:33:22 +00:00