Open pfcouto opened 1 year ago
We can definitely produce code lenses here, though I think VS Code would also need an update to their middleware to actually invoke the test.
CC @hyangah
If you need anything else from me, just @ me and I will be at your disposal. Thanks for the help!
Related: https://github.com/golang/vscode-go/issues/482
VS Code does not use gopls's test code lenses. The intention was not to present a code lens on TestMain(*testing.M)
and obviously it didn't take into account the case where it's actively edited. (another related: https://github.com/golang/vscode-go/issues/2435)
For package-level testing, there is "run package tests" codelens.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
What did you do?
In VSCode when I try to create a TestMain function with the *testing.M nothing appears on top of it to run the test, as shown in the first picture. However, if I change it to something else, like T or even nothing it appears. I don't believe that it is my problem.
What did you expect to see?
A "run test" clickable text on top of the function
What did you see instead?
The "run test" clickable test does not appear