gopls/internal/golang: implement 'Go to TestXxx' CodeLens and Code Action#589
gopls/internal/golang: implement 'Go to TestXxx' CodeLens and Code Action#589ShoshinNikita wants to merge 4 commits intogolang:masterfrom
Conversation
|
This PR (HEAD: 397ea86) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/696395. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/696395. |
Go to TestXxx CodeLensGo to TestXxx CodeLens and Code Action
|
This PR (HEAD: 28f7ec3) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/696395. Important tips:
|
Go to TestXxx CodeLens and Code Action28f7ec3 to
95dc314
Compare
|
This PR (HEAD: 95dc314) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/696395. Important tips:
|
95dc314 to
12e84f7
Compare
|
This PR (HEAD: 12e84f7) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/696395. Important tips:
|
12e84f7 to
e44a1d2
Compare
|
This PR (HEAD: e44a1d2) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/696395. Important tips:
|
e44a1d2 to
46c1f91
Compare
|
This PR (HEAD: 46c1f91) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/696395. Important tips:
|
DO NOT SUBMIT
Add a new code lens that annotates function and method declarations
with their corresponding Test, Example, Benchmark, and Fuzz functions.
The same list of test functions can also be accessed through the Source
Action menu.
The algorithm for matching functions with tests works as follows:
'TestFoo' -> 'Foo' and 'foo', 'Test_foo' -> 'foo'.
with one of the generated names. This allows us to match 'TestDeletePanics'
with 'Delete' and 'TestDeleteFunc' with 'DeleteFunc' (but not 'Delete').
Jumping to the test declaration is handled by a new command
'source.go_to_test' that uses 'window/showDocument' under the hood.
For golang/go#75030.