Commit 24a13c6
committed
gopls/internal/regtest: fill out features of the new marker tests
Add missing features to the new marker test implementation, implement a
few new markers, and port some tests to demonstrate the new structure.
Additionally, improve UX following some experience working with these
tests.
Specifically:
- Add support for settings.json. This was necessary for standard library
hover, since full documentation was too verbose and varied across Go
versions.
- Ensure that the ordering of ordinary archive files is preserved. I
kept having go.mod sorted below go files, which harms readability.
- Add a helper to provide a nice location summary for test output,
formatting both local and global (=archive-wide) positions.
- Add support for both regexp and string locations conversion.
- Add the loc marker, which is pre-processed to make named locations
available to other markers.
- Add the diag marker, which defines a 1:1 pairing between observed and
expected diagnostics.
- Add the def marker, which runs textDocument/definition.
- Port around half of the godef tests, which include both def and hover
markers. While doing so, try to extract related assertions into
separate tests, to improve organization and documentation and reduce
test size. Remaining tests will have to wait, as this CL was getting
too big.
For golang/go#54845
Change-Id: Id9fe22c00ebd1b3a96eeacc5c0e82fca9c95c680
Reviewed-on: https://go-review.googlesource.com/c/tools/+/465895
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>1 parent 2b149ce commit 24a13c6
File tree
26 files changed
+973
-1314
lines changed- gopls/internal
- lsp
- fake
- regtest
- testdata
- godef
- a
- b
- regtest/marker/testdata
- definition
- hover
26 files changed
+973
-1314
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
777 | 780 | | |
778 | 781 | | |
779 | 782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
174 | 194 | | |
175 | 195 | | |
176 | 196 | | |
| |||
0 commit comments