You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gopls/internal/golang: Implementations for func types
This CL adds support to the Implementations query for function
types. The query relates two sets of locations:
1. the "func" token of each function declaration (FuncDecl or
FuncLit). These are analogous to declarations of concrete
methods.
2. uses of abstract functions:
(a) the "func" token of each FuncType that is not part of
Func{Decl,Lit}. These are analogous to interface{...} types.
(b) the "(" paren of each dynamic call on a value of an
abstract function type. These are analogous to references to
interface method names, but no names are involved, which has
historically made them hard to search for.
An Implementations query on a location in set 1 returns set 2,
and vice versa.
Only the local algorithm is implemented for now; the global
one (using an index analogous to methodsets) will follow.
This CL supersedes CL 448035 and CL 619515, both of which attempt
to unify the treatment of functions and interfaces in the methodsets
algorithm and in the index; but the two problems are not precisely
analogous, and I think we'll end up with more but simpler code
if we implement themn separately.
+ tests, docs, relnotes
Updates golang/go#56572
Change-Id: I18e1a7cc2f6c320112b9f3589323d04f9a52ef3c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/654556
Commit-Queue: Alan Donovan <[email protected]>
Reviewed-by: Jonathan Amsterdam <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Alan Donovan <[email protected]>
0 commit comments