-
Notifications
You must be signed in to change notification settings - Fork 2.3k
gopls/internal/golang: implement 'Go to TestXxx' CodeLens and Code Action #589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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 ActionDO NOT REVIEW DO NOT SUBMIT
28f7ec3
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:
|
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.