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/cmd/gopls: GoToDef does not work with embedded pointer structs #31451

Closed
marwan-at-work opened this issue Apr 13, 2019 · 6 comments
Closed

Comments

@marwan-at-work
Copy link
Contributor

@marwan-at-work marwan-at-work commented Apr 13, 2019

Say you have a struct that looks like this:

type A struct {}

type B struct {
    *A
}

If you tried to GoToDef on the embedded struct *A inside B, then the GoToDef does not work. But if you remove the *, then GoToDef works properly by moving the cursor to the A declaration

cc: @ianthehat

@gopherbot gopherbot added this to the Unreleased milestone Apr 13, 2019
@muirdm
Copy link

@muirdm muirdm commented Apr 18, 2019

I'll work on this one if it is still available.

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Apr 18, 2019

It is available. Thanks!

@ianthehat
Copy link

@ianthehat ianthehat commented Apr 18, 2019

Although Marwan did mention he might decide to look at himself, not sure if he still means to or not?
I believe this is probably related to the special handling for embedded fields here

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 18, 2019

Change https://golang.org/cl/172583 mentions this issue: internal/lsp: handle embedded struct point definitions

@marwan-at-work
Copy link
Contributor Author

@marwan-at-work marwan-at-work commented Apr 18, 2019

@muirrn you beat me to it so it's all yours :)

@muirdm
Copy link

@muirdm muirdm commented Apr 18, 2019

Oops, didn't mean to step on anyone's toes.

@golang golang locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.