File tree 4 files changed +57
-49
lines changed 4 files changed +57
-49
lines changed Original file line number Diff line number Diff line change 4
4
# Use of this source code is governed by a BSD-style
5
5
# license that can be found in the LICENSE file.
6
6
#
7
- # Regenerates the *.golden files in the ./internal/lsp/testdata directory .
7
+ # Updates the *.golden files ... to match the tests' current behavior .
8
8
9
9
set -eu
10
10
11
+ GO117BIN=" go1.17.9"
12
+
13
+ command -v $GO117BIN > /dev/null 2>&1 || {
14
+ go install golang.org/dl/$GO117BIN @latest
15
+ $GO117BIN download
16
+ }
17
+
11
18
find ./internal/lsp/testdata -name * .golden ! -name summary* .txt.golden -delete
12
- go test ./internal/lsp/source -golden
13
- go test ./internal/lsp/ -golden
14
- go test ./internal/lsp/cmd -golden
19
+ # Here we intentionally do not run the ./internal/lsp/source tests with
20
+ # -golden. Eventually these tests will be deleted, and in the meantime they are
21
+ # redundant with the ./internal/lsp tests.
22
+ #
23
+ # Note: go1.17.9 tests must be run *before* go tests, as by convention the
24
+ # golden output should match the output of gopls built with the most recent
25
+ # version of Go. If output differs at 1.17, tests must be tolerant of the 1.17
26
+ # output.
27
+ $GO117BIN test ./internal/lsp -golden
28
+ go test ./internal/lsp -golden
29
+ $GO117BIN test ./test -golden
30
+ go test ./test -golden
Original file line number Diff line number Diff line change
1
+ -- H-hoverdef --
2
+ ```go
3
+ type H interface {
4
+ Goodbye() //@mark(AGoodbye, "Goodbye")
5
+ }
6
+ ```
7
+
8
+ [`a.H` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#H)
9
+ -- I-hoverdef --
10
+ ```go
11
+ type I interface {
12
+ B() //@mark(AB, "B")
13
+ J
14
+ }
15
+ ```
16
+
17
+ [`a.I` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#I)
18
+ -- J-hoverdef --
19
+ ```go
20
+ type J interface {
21
+ Hello() //@mark(AHello, "Hello")
22
+ }
23
+ ```
24
+
25
+ [`a.J` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#J)
1
26
-- Lock-hoverdef --
2
27
```go
3
28
func (*sync.Mutex).Lock()
@@ -165,31 +190,6 @@ const h untyped int = 2
165
190
166
191
Constant block.
167
192
168
- -- H-hoverdef --
169
- ```go
170
- type H interface {
171
- Goodbye() //@mark(AGoodbye, "Goodbye")
172
- }
173
- ```
174
-
175
- [`a.H` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#H)
176
- -- I-hoverdef --
177
- ```go
178
- type I interface {
179
- B() //@mark(AB, "B")
180
- J
181
- }
182
- ```
183
-
184
- [`a.I` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#I)
185
- -- J-hoverdef --
186
- ```go
187
- type J interface {
188
- Hello() //@mark(AHello, "Hello")
189
- }
190
- ```
191
-
192
- [`a.J` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#J)
193
193
-- make-hoverdef --
194
194
```go
195
195
func make(t Type, size ...int) Type
Original file line number Diff line number Diff line change @@ -64,6 +64,18 @@ func (Thing).Method(i int) string
64
64
```
65
65
66
66
[`(a.Thing).Method` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#Thing.Method)
67
+ -- NextThing-hoverdef --
68
+ ```go
69
+ type NextThing struct {
70
+ Thing
71
+ Value int
72
+ }
73
+
74
+ func (*NextThing).Method3() int
75
+ func (NextThing).another() string
76
+ ```
77
+
78
+ [`a.NextThing` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#NextThing)
67
79
-- Other-definition --
68
80
godef/a/d.go:9:5-10: defined here as ```go
69
81
var Other Thing
@@ -177,15 +189,3 @@ func Things(val []string) []Thing
177
189
-- a-hoverdef --
178
190
Package a is a package for testing go to definition.
179
191
180
- -- NextThing-hoverdef --
181
- ```go
182
- type NextThing struct {
183
- Thing
184
- Value int
185
- }
186
-
187
- func (*NextThing).Method3() int
188
- func (NextThing).another() string
189
- ```
190
-
191
- [`a.NextThing` on pkg.go.dev](https://pkg.go.dev/golang.org/lsptests/godef/a#NextThing)
Original file line number Diff line number Diff line change 1
- -- Pparam-hoverdef --
2
- ```go
3
- type parameter P interface{~int|string}
4
- ```
5
- -- Pvar-hoverdef --
6
- ```go
7
- type parameter P interface{~int|string}
8
- ```
9
1
-- ValueQfield-hoverdef --
10
2
```go
11
3
field Q int
You can’t perform that action at this time.
0 commit comments