-
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: add receiver name to stubbed methods
Fixes golang/go#64078 Change-Id: Ib551119b04a36d0be0929a3f949b052b598f57ad Reviewed-on: https://go-review.googlesource.com/c/tools/+/544916 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
- Loading branch information
Showing
8 changed files
with
91 additions
and
26 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
36 changes: 36 additions & 0 deletions
36
gopls/internal/test/marker/testdata/stubmethods/issue64078.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
This test verifies that the named receiver is generated. | ||
|
||
-- p.go -- | ||
package p | ||
|
||
type A struct{} | ||
|
||
func (aa *A) M1() { | ||
panic("unimplemented") | ||
} | ||
|
||
type I interface { | ||
M1() | ||
M2(aa string) | ||
M3(bb string) | ||
M4() (aa string) | ||
} | ||
|
||
var _ I = &A{} //@suggestedfix(re"&A..", re"missing method M", stub) | ||
-- @stub/p.go -- | ||
@@ -5 +5,15 @@ | ||
+// M2 implements I. | ||
+func (*A) M2(aa string) { | ||
+ panic("unimplemented") | ||
+} | ||
+ | ||
+// M3 implements I. | ||
+func (aa *A) M3(bb string) { | ||
+ panic("unimplemented") | ||
+} | ||
+ | ||
+// M4 implements I. | ||
+func (*A) M4() (aa string) { | ||
+ panic("unimplemented") | ||
+} | ||
+ |
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