-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
Currently, when finding references for a type T
, gopls also returns references to interfaces that T
implements.
This can be a source of significant noise in the results, particularly for LSP clients that apply their own sorting on top of the results returned by gopls. Consider the following:
type T struct{}
func (T) String() string { return "" }
func useT(T) {}
In this case, the type T
implements the fmt.Stringer
interface. Finding references to such a T
defined in the x/tools repo results in both T.String
and useT
(the only direct references to T
) not being in the first page of results.
I feel like we can do better, either by excluding all indirect references to T
, restricting indirect references to those interfaces defined in the same package as T
, or adding special handling for extremely common interfaces such as fmt.Stringer
.
CC @heschik @stamblerre