Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: outgoing callhierarchy return incorrect struct field functions #43456

leitzler opened this issue Jan 1, 2021 · 1 comment


Copy link

@leitzler leitzler commented Jan 1, 2021

What version of Go are you using (go version)?

$ go version
go version devel +20d0991b86 Wed Dec 30 22:51:30 2020 +0000 darwin/amd64
$ go list -m v0.0.0-20201218024724-ae774e9781d2 v0.0.0-20201218024724-ae774e9781d2

Does this issue reproduce with the latest release?


What did you do?

Called callHierarchy/outgoingCalls from main() in:

package main

type X struct {
    A func()
    B func()

func main() {
    x := X{}

Note that the same issue applies to func's defined in an interface.

What did you expect to see?

Outgoing calls to A() and B().

What did you see instead?

Outgoing calls to A() only, but with FromRange from both A func() and B func().

@gopherbot gopherbot added this to the Unreleased milestone Jan 1, 2021
Copy link

@gopherbot gopherbot commented Jan 1, 2021

Change mentions this issue: internal/lsp/source: return all field funcs from outgoing callhierarchy

@stamblerre stamblerre added this to Needs Triage in vscode-go: gopls by default Jan 8, 2021
@stamblerre stamblerre moved this from Needs Triage to Done in vscode-go: gopls by default Jan 8, 2021
gopherbot pushed a commit to golang/tools that referenced this issue Jan 11, 2021
Outgoing callhierarchy didn't handle different functions defined as
field in a struct as separate functions since they were declared by the
same AST node.

This change adds the identifier name to the key, so that a function
must share both declaration node and name to be considered "the same".

Fixes golang/go#43456

Change-Id: Ifbced98f2e8fc3a303834f7cefbae66829b68d27
Trust: Pontus Leitzler <>
Run-TryBot: Pontus Leitzler <>
gopls-CI: kokoro <>
TryBot-Result: Go Bot <>
Reviewed-by: Rebecca Stambler <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No open projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants