Skip to content
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

x/tools/gopls: offer test function snippets as completion candidates in test files #61210

Open
findleyr opened this issue Jul 6, 2023 · 0 comments
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Jul 6, 2023

Suggestion by way of @pjweinb: when typing a new function declaration in a test file (*_test.go), we could offer completion items for untested exported functions in the non-test package.

For example, if package p defines function Foo, we could offer the completion suggestion func TestFoo when typing in p_test.go.

Extra credit: populate the completion snippet with a test body that sets up a table-driven test for the function in question.

@findleyr findleyr added this to the gopls/later milestone Jul 6, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants