diff options
Diffstat (limited to 'internal/lsp/testdata/godef/a')
-rw-r--r-- | internal/lsp/testdata/godef/a/a.go | 105 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/a.go.golden | 190 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/a_test.go | 8 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/a_test.go.golden | 26 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/a_x_test.go | 9 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/a_x_test.go.golden | 26 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/d.go | 43 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/d.go.golden | 164 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/f.go | 15 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/f.go.golden | 34 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/g.go | 6 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/g.go.golden | 6 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/h.go | 147 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/h.go.golden | 136 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/random.go | 31 | ||||
-rw-r--r-- | internal/lsp/testdata/godef/a/random.go.golden | 112 |
16 files changed, 0 insertions, 1058 deletions
diff --git a/internal/lsp/testdata/godef/a/a.go b/internal/lsp/testdata/godef/a/a.go deleted file mode 100644 index 5cc85527a..000000000 --- a/internal/lsp/testdata/godef/a/a.go +++ /dev/null @@ -1,105 +0,0 @@ -// Package a is a package for testing go to definition. -package a //@mark(aPackage, "a "),hoverdef("a ", aPackage) - -import ( - "fmt" - "go/types" - "sync" -) - -var ( - // x is a variable. - x string //@x,hoverdef("x", x) -) - -// Constant block. When I hover on h, I should see this comment. -const ( - // When I hover on g, I should see this comment. - g = 1 //@g,hoverdef("g", g) - - h = 2 //@h,hoverdef("h", h) -) - -// z is a variable too. -var z string //@z,hoverdef("z", z) - -type A string //@mark(AString, "A") - -func AStuff() { //@AStuff - x := 5 - Random2(x) //@godef("dom2", Random2) - Random() //@godef("()", Random) - - var err error //@err - fmt.Printf("%v", err) //@godef("err", err) - - var y string //@string,hoverdef("string", string) - _ = make([]int, 0) //@make,hoverdef("make", make) - - var mu sync.Mutex - mu.Lock() //@Lock,hoverdef("Lock", Lock) - - var typ *types.Named //@mark(typesImport, "types"),hoverdef("types", typesImport) - typ.Obj().Name() //@Name,hoverdef("Name", Name) -} - -type A struct { -} - -func (_ A) Hi() {} //@mark(AHi, "Hi") - -type S struct { - Field int //@mark(AField, "Field") - R // embed a struct - H // embed an interface -} - -type R struct { - Field2 int //@mark(AField2, "Field2") -} - -func (_ R) Hey() {} //@mark(AHey, "Hey") - -type H interface { - Goodbye() //@mark(AGoodbye, "Goodbye") -} - -type I interface { - B() //@mark(AB, "B") - J -} - -type J interface { - Hello() //@mark(AHello, "Hello") -} - -func _() { - // 1st type declaration block - type ( - a struct { //@mark(declBlockA, "a"),hoverdef("a", declBlockA) - x string - } - ) - - // 2nd type declaration block - type ( - // b has a comment - b struct{} //@mark(declBlockB, "b"),hoverdef("b", declBlockB) - ) - - // 3rd type declaration block - type ( - // c is a struct - c struct { //@mark(declBlockC, "c"),hoverdef("c", declBlockC) - f string - } - - d string //@mark(declBlockD, "d"),hoverdef("d", declBlockD) - ) - - type ( - e struct { //@mark(declBlockE, "e"),hoverdef("e", declBlockE) - f float64 - } // e has a comment - ) -} diff --git a/internal/lsp/testdata/godef/a/a.go.golden b/internal/lsp/testdata/godef/a/a.go.golden deleted file mode 100644 index 9f67a147d..000000000 --- a/internal/lsp/testdata/godef/a/a.go.golden +++ /dev/null @@ -1,190 +0,0 @@ --- Lock-hoverdef -- -```go -func (*sync.Mutex).Lock() -``` - -Lock locks m\. - -[`(sync.Mutex).Lock` on pkg.go.dev](https://pkg.go.dev/sync?utm_source=gopls#Mutex.Lock) --- Name-hoverdef -- -```go -func (*types.object).Name() string -``` - -Name returns the object\'s \(package\-local, unqualified\) name\. - -[`(types.TypeName).Name` on pkg.go.dev](https://pkg.go.dev/go/types?utm_source=gopls#TypeName.Name) --- Random-definition -- -godef/a/random.go:3:6-12: defined here as ```go -func Random() int -``` - -[`a.Random` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Random) --- Random-definition-json -- -{ - "span": { - "uri": "file://godef/a/random.go", - "start": { - "line": 3, - "column": 6, - "offset": 16 - }, - "end": { - "line": 3, - "column": 12, - "offset": 22 - } - }, - "description": "```go\nfunc Random() int\n```\n\n[`a.Random` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Random)" -} - --- Random-hoverdef -- -```go -func Random() int -``` - -[`a.Random` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Random) --- Random2-definition -- -godef/a/random.go:8:6-13: defined here as ```go -func Random2(y int) int -``` - -[`a.Random2` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Random2) --- Random2-definition-json -- -{ - "span": { - "uri": "file://godef/a/random.go", - "start": { - "line": 8, - "column": 6, - "offset": 71 - }, - "end": { - "line": 8, - "column": 13, - "offset": 78 - } - }, - "description": "```go\nfunc Random2(y int) int\n```\n\n[`a.Random2` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Random2)" -} - --- Random2-hoverdef -- -```go -func Random2(y int) int -``` - -[`a.Random2` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Random2) --- aPackage-hoverdef -- -Package a is a package for testing go to definition\. --- declBlockA-hoverdef -- -```go -type a struct { - x string -} -``` - -1st type declaration block --- declBlockB-hoverdef -- -```go -type b struct{} -``` - -b has a comment --- declBlockC-hoverdef -- -```go -type c struct { - f string -} -``` - -c is a struct --- declBlockD-hoverdef -- -```go -type d string -``` - -3rd type declaration block --- declBlockE-hoverdef -- -```go -type e struct { - f float64 -} -``` - -e has a comment --- err-definition -- -godef/a/a.go:33:6-9: defined here as ```go -var err error -``` - -\@err --- err-definition-json -- -{ - "span": { - "uri": "file://godef/a/a.go", - "start": { - "line": 33, - "column": 6, - "offset": 612 - }, - "end": { - "line": 33, - "column": 9, - "offset": 615 - } - }, - "description": "```go\nvar err error\n```\n\n\\@err" -} - --- err-hoverdef -- -```go -var err error -``` - -\@err --- g-hoverdef -- -```go -const g untyped int = 1 -``` - -When I hover on g, I should see this comment\. --- h-hoverdef -- -```go -const h untyped int = 2 -``` - -Constant block\. --- make-hoverdef -- -```go -func make(t Type, size ...int) Type -``` - -The make built\-in function allocates and initializes an object of type slice, map, or chan \(only\)\. - -[`make` on pkg.go.dev](https://pkg.go.dev/builtin?utm_source=gopls#make) --- string-hoverdef -- -```go -type string string -``` - -string is the set of all strings of 8\-bit bytes, conventionally but not necessarily representing UTF\-8\-encoded text\. - -[`string` on pkg.go.dev](https://pkg.go.dev/builtin?utm_source=gopls#string) --- typesImport-hoverdef -- -```go -package types ("go/types") -``` - -[`types` on pkg.go.dev](https://pkg.go.dev/go/types?utm_source=gopls) --- x-hoverdef -- -```go -var x string -``` - -x is a variable\. --- z-hoverdef -- -```go -var z string -``` - -z is a variable too\. diff --git a/internal/lsp/testdata/godef/a/a_test.go b/internal/lsp/testdata/godef/a/a_test.go deleted file mode 100644 index 77bd633b6..000000000 --- a/internal/lsp/testdata/godef/a/a_test.go +++ /dev/null @@ -1,8 +0,0 @@ -package a - -import ( - "testing" -) - -func TestA(t *testing.T) { //@TestA,godef(TestA, TestA) -} diff --git a/internal/lsp/testdata/godef/a/a_test.go.golden b/internal/lsp/testdata/godef/a/a_test.go.golden deleted file mode 100644 index e5cb3d799..000000000 --- a/internal/lsp/testdata/godef/a/a_test.go.golden +++ /dev/null @@ -1,26 +0,0 @@ --- TestA-definition -- -godef/a/a_test.go:7:6-11: defined here as ```go -func TestA(t *testing.T) -``` --- TestA-definition-json -- -{ - "span": { - "uri": "file://godef/a/a_test.go", - "start": { - "line": 7, - "column": 6, - "offset": 39 - }, - "end": { - "line": 7, - "column": 11, - "offset": 44 - } - }, - "description": "```go\nfunc TestA(t *testing.T)\n```" -} - --- TestA-hoverdef -- -```go -func TestA(t *testing.T) -``` diff --git a/internal/lsp/testdata/godef/a/a_x_test.go b/internal/lsp/testdata/godef/a/a_x_test.go deleted file mode 100644 index 4631eba2c..000000000 --- a/internal/lsp/testdata/godef/a/a_x_test.go +++ /dev/null @@ -1,9 +0,0 @@ -package a_test - -import ( - "testing" -) - -func TestA2(t *testing.T) { //@TestA2,godef(TestA2, TestA2) - Nonexistant() //@diag("Nonexistant", "compiler", "undeclared name: Nonexistant", "error") -} diff --git a/internal/lsp/testdata/godef/a/a_x_test.go.golden b/internal/lsp/testdata/godef/a/a_x_test.go.golden deleted file mode 100644 index 2e3064794..000000000 --- a/internal/lsp/testdata/godef/a/a_x_test.go.golden +++ /dev/null @@ -1,26 +0,0 @@ --- TestA2-definition -- -godef/a/a_x_test.go:7:6-12: defined here as ```go -func TestA2(t *testing.T) -``` --- TestA2-definition-json -- -{ - "span": { - "uri": "file://godef/a/a_x_test.go", - "start": { - "line": 7, - "column": 6, - "offset": 44 - }, - "end": { - "line": 7, - "column": 12, - "offset": 50 - } - }, - "description": "```go\nfunc TestA2(t *testing.T)\n```" -} - --- TestA2-hoverdef -- -```go -func TestA2(t *testing.T) -``` diff --git a/internal/lsp/testdata/godef/a/d.go b/internal/lsp/testdata/godef/a/d.go deleted file mode 100644 index 2da8d058e..000000000 --- a/internal/lsp/testdata/godef/a/d.go +++ /dev/null @@ -1,43 +0,0 @@ -package a //@mark(a, "a "),hoverdef("a ", a) - -import "fmt" - -type Thing struct { //@Thing - Member string //@Member -} - -var Other Thing //@Other - -func Things(val []string) []Thing { //@Things - return nil -} - -func (t Thing) Method(i int) string { //@Method - return t.Member -} - -func useThings() { - t := Thing{ //@mark(aStructType, "ing") - Member: "string", //@mark(fMember, "ember") - } - fmt.Print(t.Member) //@mark(aMember, "ember") - fmt.Print(Other) //@mark(aVar, "ther") - Things() //@mark(aFunc, "ings") - t.Method() //@mark(aMethod, "eth") -} - -/*@ -godef(aStructType, Thing) -godef(aMember, Member) -godef(aVar, Other) -godef(aFunc, Things) -godef(aMethod, Method) -godef(fMember, Member) -godef(Member, Member) - -//param -//package name -//const -//anon field - -*/ diff --git a/internal/lsp/testdata/godef/a/d.go.golden b/internal/lsp/testdata/godef/a/d.go.golden deleted file mode 100644 index 47723b045..000000000 --- a/internal/lsp/testdata/godef/a/d.go.golden +++ /dev/null @@ -1,164 +0,0 @@ --- Member-definition -- -godef/a/d.go:6:2-8: defined here as ```go -field Member string -``` - -\@Member - -[`(a.Thing).Member` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing.Member) --- Member-definition-json -- -{ - "span": { - "uri": "file://godef/a/d.go", - "start": { - "line": 6, - "column": 2, - "offset": 90 - }, - "end": { - "line": 6, - "column": 8, - "offset": 96 - } - }, - "description": "```go\nfield Member string\n```\n\n\\@Member\n\n[`(a.Thing).Member` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing.Member)" -} - --- Member-hoverdef -- -```go -field Member string -``` - -\@Member - -[`(a.Thing).Member` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing.Member) --- Method-definition -- -godef/a/d.go:15:16-22: defined here as ```go -func (Thing).Method(i int) string -``` - -[`(a.Thing).Method` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing.Method) --- Method-definition-json -- -{ - "span": { - "uri": "file://godef/a/d.go", - "start": { - "line": 15, - "column": 16, - "offset": 219 - }, - "end": { - "line": 15, - "column": 22, - "offset": 225 - } - }, - "description": "```go\nfunc (Thing).Method(i int) string\n```\n\n[`(a.Thing).Method` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing.Method)" -} - --- Method-hoverdef -- -```go -func (Thing).Method(i int) string -``` - -[`(a.Thing).Method` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing.Method) --- Other-definition -- -godef/a/d.go:9:5-10: defined here as ```go -var Other Thing -``` - -\@Other - -[`a.Other` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Other) --- Other-definition-json -- -{ - "span": { - "uri": "file://godef/a/d.go", - "start": { - "line": 9, - "column": 5, - "offset": 121 - }, - "end": { - "line": 9, - "column": 10, - "offset": 126 - } - }, - "description": "```go\nvar Other Thing\n```\n\n\\@Other\n\n[`a.Other` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Other)" -} - --- Other-hoverdef -- -```go -var Other Thing -``` - -\@Other - -[`a.Other` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Other) --- Thing-definition -- -godef/a/d.go:5:6-11: defined here as ```go -type Thing struct { - Member string //@Member -} -``` - -[`a.Thing` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing) --- Thing-definition-json -- -{ - "span": { - "uri": "file://godef/a/d.go", - "start": { - "line": 5, - "column": 6, - "offset": 65 - }, - "end": { - "line": 5, - "column": 11, - "offset": 70 - } - }, - "description": "```go\ntype Thing struct {\n\tMember string //@Member\n}\n```\n\n[`a.Thing` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing)" -} - --- Thing-hoverdef -- -```go -type Thing struct { - Member string //@Member -} -``` - -[`a.Thing` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Thing) --- Things-definition -- -godef/a/d.go:11:6-12: defined here as ```go -func Things(val []string) []Thing -``` - -[`a.Things` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Things) --- Things-definition-json -- -{ - "span": { - "uri": "file://godef/a/d.go", - "start": { - "line": 11, - "column": 6, - "offset": 148 - }, - "end": { - "line": 11, - "column": 12, - "offset": 154 - } - }, - "description": "```go\nfunc Things(val []string) []Thing\n```\n\n[`a.Things` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Things)" -} - --- Things-hoverdef -- -```go -func Things(val []string) []Thing -``` - -[`a.Things` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Things) --- a-hoverdef -- -Package a is a package for testing go to definition\. diff --git a/internal/lsp/testdata/godef/a/f.go b/internal/lsp/testdata/godef/a/f.go deleted file mode 100644 index 589c45fc1..000000000 --- a/internal/lsp/testdata/godef/a/f.go +++ /dev/null @@ -1,15 +0,0 @@ -package a - -import "fmt" - -func TypeStuff() { //@Stuff - var x string - - switch y := interface{}(x).(type) { //@mark(switchY, "y"),godef("y", switchY) - case int: //@mark(intY, "int") - fmt.Printf("%v", y) //@hoverdef("y", intY) - case string: //@mark(stringY, "string") - fmt.Printf("%v", y) //@hoverdef("y", stringY) - } - -} diff --git a/internal/lsp/testdata/godef/a/f.go.golden b/internal/lsp/testdata/godef/a/f.go.golden deleted file mode 100644 index a084356c0..000000000 --- a/internal/lsp/testdata/godef/a/f.go.golden +++ /dev/null @@ -1,34 +0,0 @@ --- intY-hoverdef -- -```go -var y int -``` --- stringY-hoverdef -- -```go -var y string -``` --- switchY-definition -- -godef/a/f.go:8:9-10: defined here as ```go -var y interface{} -``` --- switchY-definition-json -- -{ - "span": { - "uri": "file://godef/a/f.go", - "start": { - "line": 8, - "column": 9, - "offset": 76 - }, - "end": { - "line": 8, - "column": 10, - "offset": 77 - } - }, - "description": "```go\nvar y interface{}\n```" -} - --- switchY-hoverdef -- -```go -var y interface{} -``` diff --git a/internal/lsp/testdata/godef/a/g.go b/internal/lsp/testdata/godef/a/g.go deleted file mode 100644 index dfef2fb80..000000000 --- a/internal/lsp/testdata/godef/a/g.go +++ /dev/null @@ -1,6 +0,0 @@ -package a - -import "time" - -// dur is a constant of type time.Duration. -const dur = 15*time.Minute + 10*time.Second + 350*time.Millisecond //@dur,hoverdef("dur", dur) diff --git a/internal/lsp/testdata/godef/a/g.go.golden b/internal/lsp/testdata/godef/a/g.go.golden deleted file mode 100644 index b7ed73928..000000000 --- a/internal/lsp/testdata/godef/a/g.go.golden +++ /dev/null @@ -1,6 +0,0 @@ --- dur-hoverdef -- -```go -const dur time.Duration = 910350000000 // 15m10.35s -``` - -dur is a constant of type time\.Duration\. diff --git a/internal/lsp/testdata/godef/a/h.go b/internal/lsp/testdata/godef/a/h.go deleted file mode 100644 index 5a5dcc678..000000000 --- a/internal/lsp/testdata/godef/a/h.go +++ /dev/null @@ -1,147 +0,0 @@ -package a - -func _() { - type s struct { - nested struct { - // nested number - number int64 //@mark(nestedNumber, "number") - } - nested2 []struct { - // nested string - str string //@mark(nestedString, "str") - } - x struct { - x struct { - x struct { - x struct { - x struct { - // nested map - m map[string]float64 //@mark(nestedMap, "m") - } - } - } - } - } - } - - var t s - _ = t.nested.number //@hoverdef("number", nestedNumber) - _ = t.nested2[0].str //@hoverdef("str", nestedString) - _ = t.x.x.x.x.x.m //@hoverdef("m", nestedMap) -} - -func _() { - var s struct { - // a field - a int //@mark(structA, "a") - // b nested struct - b struct { //@mark(structB, "b") - // c field of nested struct - c int //@mark(structC, "c") - } - } - _ = s.a //@hoverdef("a", structA) - _ = s.b //@hoverdef("b", structB) - _ = s.b.c //@hoverdef("c", structC) - - var arr []struct { - // d field - d int //@mark(arrD, "d") - // e nested struct - e struct { //@mark(arrE, "e") - // f field of nested struct - f int //@mark(arrF, "f") - } - } - _ = arr[0].d //@hoverdef("d", arrD) - _ = arr[0].e //@hoverdef("e", arrE) - _ = arr[0].e.f //@hoverdef("f", arrF) - - var complex []struct { - c <-chan map[string][]struct { - // h field - h int //@mark(complexH, "h") - // i nested struct - i struct { //@mark(complexI, "i") - // j field of nested struct - j int //@mark(complexJ, "j") - } - } - } - _ = (<-complex[0].c)["0"][0].h //@hoverdef("h", complexH) - _ = (<-complex[0].c)["0"][0].i //@hoverdef("i", complexI) - _ = (<-complex[0].c)["0"][0].i.j //@hoverdef("j", complexJ) - - var mapWithStructKey map[struct { - // X key field - x []string //@mark(mapStructKeyX, "x") - }]int - for k := range mapWithStructKey { - _ = k.x //@hoverdef("x", mapStructKeyX) - } - - var mapWithStructKeyAndValue map[struct { - // Y key field - y string //@mark(mapStructKeyY, "y") - }]struct { - // X value field - x string //@mark(mapStructValueX, "x") - } - for k, v := range mapWithStructKeyAndValue { - // TODO: we don't show docs for y field because both map key and value - // are structs. And in this case, we parse only map value - _ = k.y //@hoverdef("y", mapStructKeyY) - _ = v.x //@hoverdef("x", mapStructValueX) - } - - var i []map[string]interface { - // open method comment - open() error //@mark(openMethod, "open") - } - i[0]["1"].open() //@hoverdef("open", openMethod) -} - -func _() { - test := struct { - // test description - desc string //@mark(testDescription, "desc") - }{} - _ = test.desc //@hoverdef("desc", testDescription) - - for _, tt := range []struct { - // test input - in map[string][]struct { //@mark(testInput, "in") - // test key - key string //@mark(testInputKey, "key") - // test value - value interface{} //@mark(testInputValue, "value") - } - result struct { - v <-chan struct { - // expected test value - value int //@mark(testResultValue, "value") - } - } - }{} { - _ = tt.in //@hoverdef("in", testInput) - _ = tt.in["0"][0].key //@hoverdef("key", testInputKey) - _ = tt.in["0"][0].value //@hoverdef("value", testInputValue) - - _ = (<-tt.result.v).value //@hoverdef("value", testResultValue) - } -} - -func _() { - getPoints := func() []struct { - // X coord - x int //@mark(returnX, "x") - // Y coord - y int //@mark(returnY, "y") - } { - return nil - } - - r := getPoints() - r[0].x //@hoverdef("x", returnX) - r[0].y //@hoverdef("y", returnY) -} diff --git a/internal/lsp/testdata/godef/a/h.go.golden b/internal/lsp/testdata/godef/a/h.go.golden deleted file mode 100644 index 4b27211e9..000000000 --- a/internal/lsp/testdata/godef/a/h.go.golden +++ /dev/null @@ -1,136 +0,0 @@ --- arrD-hoverdef -- -```go -field d int -``` - -d field --- arrE-hoverdef -- -```go -field e struct{f int} -``` - -e nested struct --- arrF-hoverdef -- -```go -field f int -``` - -f field of nested struct --- complexH-hoverdef -- -```go -field h int -``` - -h field --- complexI-hoverdef -- -```go -field i struct{j int} -``` - -i nested struct --- complexJ-hoverdef -- -```go -field j int -``` - -j field of nested struct --- mapStructKeyX-hoverdef -- -```go -field x []string -``` - -X key field --- mapStructKeyY-hoverdef -- -```go -field y string -``` --- mapStructValueX-hoverdef -- -```go -field x string -``` - -X value field --- nestedMap-hoverdef -- -```go -field m map[string]float64 -``` - -nested map --- nestedNumber-hoverdef -- -```go -field number int64 -``` - -nested number --- nestedString-hoverdef -- -```go -field str string -``` - -nested string --- openMethod-hoverdef -- -```go -func (interface).open() error -``` - -open method comment --- returnX-hoverdef -- -```go -field x int -``` - -X coord --- returnY-hoverdef -- -```go -field y int -``` - -Y coord --- structA-hoverdef -- -```go -field a int -``` - -a field --- structB-hoverdef -- -```go -field b struct{c int} -``` - -b nested struct --- structC-hoverdef -- -```go -field c int -``` - -c field of nested struct --- testDescription-hoverdef -- -```go -field desc string -``` - -test description --- testInput-hoverdef -- -```go -field in map[string][]struct{key string; value interface{}} -``` - -test input --- testInputKey-hoverdef -- -```go -field key string -``` - -test key --- testInputValue-hoverdef -- -```go -field value interface{} -``` - -test value --- testResultValue-hoverdef -- -```go -field value int -``` - -expected test value diff --git a/internal/lsp/testdata/godef/a/random.go b/internal/lsp/testdata/godef/a/random.go deleted file mode 100644 index 62055c1fc..000000000 --- a/internal/lsp/testdata/godef/a/random.go +++ /dev/null @@ -1,31 +0,0 @@ -package a - -func Random() int { //@Random - y := 6 + 7 - return y -} - -func Random2(y int) int { //@Random2,mark(RandomParamY, "y") - return y //@godef("y", RandomParamY) -} - -type Pos struct { - x, y int //@mark(PosX, "x"),mark(PosY, "y") -} - -// Typ has a comment. Its fields do not. -type Typ struct{ field string } //@mark(TypField, "field") - -func _() { - x := &Typ{} - x.field //@godef("field", TypField) -} - -func (p *Pos) Sum() int { //@mark(PosSum, "Sum") - return p.x + p.y //@godef("x", PosX) -} - -func _() { - var p Pos - _ = p.Sum() //@godef("()", PosSum) -} diff --git a/internal/lsp/testdata/godef/a/random.go.golden b/internal/lsp/testdata/godef/a/random.go.golden deleted file mode 100644 index 381a11ace..000000000 --- a/internal/lsp/testdata/godef/a/random.go.golden +++ /dev/null @@ -1,112 +0,0 @@ --- PosSum-definition -- -godef/a/random.go:24:15-18: defined here as ```go -func (*Pos).Sum() int -``` - -[`(a.Pos).Sum` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Pos.Sum) --- PosSum-definition-json -- -{ - "span": { - "uri": "file://godef/a/random.go", - "start": { - "line": 24, - "column": 15, - "offset": 413 - }, - "end": { - "line": 24, - "column": 18, - "offset": 416 - } - }, - "description": "```go\nfunc (*Pos).Sum() int\n```\n\n[`(a.Pos).Sum` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Pos.Sum)" -} - --- PosSum-hoverdef -- -```go -func (*Pos).Sum() int -``` - -[`(a.Pos).Sum` on pkg.go.dev](https://pkg.go.dev/golang.org/x/tools/internal/lsp/godef/a?utm_source=gopls#Pos.Sum) --- PosX-definition -- -godef/a/random.go:13:2-3: defined here as ```go -field x int -``` - -\@mark\(PosX, \"x\"\),mark\(PosY, \"y\"\) --- PosX-definition-json -- -{ - "span": { - "uri": "file://godef/a/random.go", - "start": { - "line": 13, - "column": 2, - "offset": 187 - }, - "end": { - "line": 13, - "column": 3, - "offset": 188 - } - }, - "description": "```go\nfield x int\n```\n\n\\@mark\\(PosX, \\\"x\\\"\\),mark\\(PosY, \\\"y\\\"\\)" -} - --- PosX-hoverdef -- -```go -field x int -``` - -\@mark\(PosX, \"x\"\),mark\(PosY, \"y\"\) --- RandomParamY-definition -- -godef/a/random.go:8:14-15: defined here as ```go -var y int -``` --- RandomParamY-definition-json -- -{ - "span": { - "uri": "file://godef/a/random.go", - "start": { - "line": 8, - "column": 14, - "offset": 79 - }, - "end": { - "line": 8, - "column": 15, - "offset": 80 - } - }, - "description": "```go\nvar y int\n```" -} - --- RandomParamY-hoverdef -- -```go -var y int -``` --- TypField-definition -- -godef/a/random.go:17:18-23: defined here as ```go -field field string -``` --- TypField-definition-json -- -{ - "span": { - "uri": "file://godef/a/random.go", - "start": { - "line": 17, - "column": 18, - "offset": 292 - }, - "end": { - "line": 17, - "column": 23, - "offset": 297 - } - }, - "description": "```go\nfield field string\n```" -} - --- TypField-hoverdef -- -```go -field field string -``` |