diff options
Diffstat (limited to 'gopls/internal/lsp/testdata/implementation/implementation.go')
-rw-r--r-- | gopls/internal/lsp/testdata/implementation/implementation.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gopls/internal/lsp/testdata/implementation/implementation.go b/gopls/internal/lsp/testdata/implementation/implementation.go new file mode 100644 index 000000000..4c1a22dd4 --- /dev/null +++ b/gopls/internal/lsp/testdata/implementation/implementation.go @@ -0,0 +1,37 @@ +package implementation + +import "golang.org/lsptests/implementation/other" + +type ImpP struct{} //@ImpP,implementations("ImpP", Laugher, OtherLaugher) + +func (*ImpP) Laugh() { //@mark(LaughP, "Laugh"),implementations("Laugh", Laugh, OtherLaugh) +} + +type ImpS struct{} //@ImpS,implementations("ImpS", Laugher, OtherLaugher) + +func (ImpS) Laugh() { //@mark(LaughS, "Laugh"),implementations("Laugh", Laugh, OtherLaugh) +} + +type Laugher interface { //@Laugher,implementations("Laugher", ImpP, OtherImpP, ImpS, OtherImpS, embedsImpP) + Laugh() //@Laugh,implementations("Laugh", LaughP, OtherLaughP, LaughS, OtherLaughS) +} + +type Foo struct { //@implementations("Foo", Joker) + other.Foo +} + +type Joker interface { //@Joker + Joke() //@Joke,implementations("Joke", ImpJoker) +} + +type cryer int //@implementations("cryer", Cryer) + +func (cryer) Cry(other.CryType) {} //@mark(CryImpl, "Cry"),implementations("Cry", Cry) + +type Empty interface{} //@implementations("Empty") + +var _ interface{ Joke() } //@implementations("Joke", ImpJoker) + +type embedsImpP struct { //@embedsImpP + ImpP //@implementations("ImpP", Laugher, OtherLaugher) +} |