1
0
mirror of https://github.com/golang/go synced 2024-11-19 08:54:47 -07:00
go/internal/lsp/testdata/godef/b/b.go
Ian Cottrell 6dfe7efaa9 internal/lsp: add definition tests from godef
This makes our internal version of go to definition be tested with the
same test data that godef now uses

Change-Id: I04e488b6b9b2d891181f202ea1125b823a079c50
Reviewed-on: https://go-review.googlesource.com/c/150045
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2018-11-19 18:17:22 +00:00

24 lines
497 B
Go

package b
import "golang.org/x/tools/internal/lsp/godef/a"
type S1 struct { //@S1
F1 int //@mark(S1F1, "F1")
S2 //@godef("S2", S2), mark(S1S2, "S2")
a.A //@godef("A", A)
}
type S2 struct { //@S2
F1 string //@mark(S2F1, "F1")
F2 int //@mark(S2F2, "F2")
}
func Bar() {
a.Stuff() //@godef("Stuff", Stuff)
var x S1 //@godef("S1", S1)
_ = x.S2 //@godef("S2", S1S2)
_ = x.F1 //@godef("F1", S1F1)
_ = x.F2 //@godef("F2", S2F2)
_ = x.S2.F1 //@godef("F1", S2F1)
}