| 1 |
This test checks that hovering over an embedded field |
| 2 |
reports information about the field, not its type. |
| 3 |
|
| 4 |
We put backslash escapes in the hover expectation as the @hover marker |
| 5 |
appears on the same line as the declaration. Otherwise the hover doc |
| 6 |
content, which includes the comment containing the marker itself, |
| 7 |
would trivially satisfy itself no matter what text we expect! |
| 8 |
|
| 9 |
-- flags -- |
| 10 |
-skip_goarch=386,arm |
| 11 |
|
| 12 |
-- go.mod -- |
| 13 |
module mod.com |
| 14 |
go 1.18 |
| 15 |
|
| 16 |
-- a/a.go -- |
| 17 |
package a |
| 18 |
|
| 19 |
type A struct { |
| 20 |
byte |
| 21 |
S string //@ hover("S", "S", "field S string // size=16 (0x10), offset=8\n") |
| 22 |
} |
| 23 |
|
| 24 |
type B struct { |
| 25 |
byte |
| 26 |
S //@ hover("S", "S", "field S S // size=1, class=8, offset=1\n") |
| 27 |
} |
| 28 |
|
| 29 |
type C struct { |
| 30 |
byte |
| 31 |
*S // hover("S", "S", "field S S // size=1, class=8, offset=1\n") |
| 32 |
} |
| 33 |
|
| 34 |
type S byte |