Commit 827f5aa
committed
gopls/internal/lsp/source: test references bug on struct{p.T}
This change adds a regression test for bug in gopls' references
operation applied to the T identifier in an embedded struct field
such as struct{p.T): instead of reporting references to T,
it reports references to package name p.
This is a consequence of go/types bug golang/go#60372,
which sets the position of the struct field types.Var to
that of the ast.Field syntax (p) not the type name (T).
The bug was fixed in go1.21.
Updates golang/go#60372
Fixes golang/go#60369
Change-Id: Ibabe885ea689b30d966dbf7e51f8c25e44a6ce1c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/497495
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>1 parent a12e1a6 commit 827f5aa
2 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
652 | 660 | | |
653 | 661 | | |
654 | 662 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments