Go: x/tools/cmd/gopls: GoToDef does not work with embedded pointer structs

Created on 13 Apr 2019  路  6Comments  路  Source: golang/go

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

FrozenDueToAge Suggested gopls

Most helpful comment

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

All 6 comments

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

It is available. Thanks!

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enoodle picture enoodle  路  3Comments

natefinch picture natefinch  路  3Comments

ajstarks picture ajstarks  路  3Comments

ashb picture ashb  路  3Comments

michaelsafyan picture michaelsafyan  路  3Comments