1
0
mirror of https://github.com/golang/go synced 2024-11-19 02:54:42 -07:00
go/internal/lsp/testdata/implementation/implementation.go
Muir Manders 9a30a9a96c internal/lsp: trim down implementations code
Remove the unused code that was tracking concrete-type =>
interface-type mappings. It isn't clear if there is a good spot for
this in LSP.

I also made it skip interface types when looking for implementations.
It doesn't seem useful to be shown other interface types/methods when
you are looking for implementations of a given interface type/method.

Change-Id: Ib59fb717e5c1a181cc713581a22e60ed654b918c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210279
Run-TryBot: Muir Manders <muir@mnd.rs>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-12-09 20:39:02 +00:00

34 lines
699 B
Go

package implementation
import "golang.org/x/tools/internal/lsp/implementation/other"
type ImpP struct{} //@ImpP
func (*ImpP) Laugh() { //@mark(LaughP, "Laugh")
}
type ImpS struct{} //@ImpS
func (ImpS) Laugh() { //@mark(LaughS, "Laugh")
}
type ImpI interface {
Laugh() //@implementations("Laugh", LaughP, OtherLaughP, LaughS, OtherLaughS)
}
type Laugher interface { //@implementations("Laugher", ImpP, OtherImpP, ImpS, OtherImpS)
Laugh() //@implementations("Laugh", LaughP, OtherLaughP, LaughS, OtherLaughS)
}
type Foo struct {
other.Foo
}
type U interface {
U() //TODO: fix flaky @implementations("U", ImpU)
}
type cryer int
func (cryer) Cry(other.CryType) {} //@mark(CryImpl, "Cry")