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
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@marwan-at-work
Copy link
Contributor

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

@marwan-at-work marwan-at-work added the gopls Issues related to the Go language server, gopls. label Apr 13, 2019
@gopherbot gopherbot added this to the Unreleased milestone Apr 13, 2019
@stamblerre stamblerre added the Suggested Issues that may be good for new contributors looking for work to do. label Apr 13, 2019
@muirdm
Copy link

muirdm commented Apr 18, 2019

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

@stamblerre
Copy link
Contributor

It is available. Thanks!

@ianthehat
Copy link

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

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

@marwan-at-work
Copy link
Contributor Author

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

@muirdm
Copy link

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.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants