mirror of https://github.com/golang/go.git
internal/lsp: do not return interface itself when finding implementations
Finding implementations of an interface should not give the interface itself as an implementation. Fixes #35601 Change-Id: Id3352619ece90fb7ca906ddabca613742d156c76 Reviewed-on: https://go-review.googlesource.com/c/tools/+/208667 Run-TryBot: Rohan Challa <rohan@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
66af5afb16
commit
73db347c3b
|
|
@ -77,6 +77,10 @@ func (i *IdentifierInfo) Implementation(ctx context.Context) ([]protocol.Locatio
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Do not add interface itself to the list.
|
||||
if ident.Declaration.spanRange == i.Declaration.spanRange {
|
||||
continue
|
||||
}
|
||||
locations = append(locations, protocol.Location{
|
||||
URI: protocol.NewURI(ident.Declaration.URI()),
|
||||
Range: decRange,
|
||||
|
|
|
|||
Loading…
Reference in New Issue