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: completion for f.Fuzz parameter #51089

Closed
hyangah opened this issue Feb 8, 2022 · 5 comments
Closed

x/tools/gopls: completion for f.Fuzz parameter #51089

hyangah opened this issue Feb 8, 2022 · 5 comments
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. FrozenDueToAge 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

@hyangah
Copy link
Contributor

hyangah commented Feb 8, 2022

Going one step further from #50198

It would be nice if gopls fills out the parameter automatically based on f.Add if it is present.

@hyangah hyangah added the FeatureRequest Issues asking for a new feature that does not need a proposal. label Feb 8, 2022
@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 Feb 8, 2022
@gopherbot gopherbot added this to the Unreleased milestone Feb 8, 2022
@suzmue suzmue modified the milestones: Unreleased, gopls/unplanned Feb 10, 2022
@pjweinb pjweinb self-assigned this Feb 15, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/385974 mentions this issue: internal/lsp: Provide completions for test function definitions

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/387615 mentions this issue: internal/lsp: more precise completions for *testing.F fuzz methods

gopherbot pushed a commit to golang/tools that referenced this issue Feb 25, 2022
In test files, function definitions starting with
Test, Bench, or Fuzz can be completed almost automatically.

For the snippets the user hits tab, completes the name, hits
tab again, and the function is defined, except (of course) for its
body.

Otherwise a completion that fills in the signature is proposed.

Where appropriate, 'TestMain(m *testing.M)' is also offered as
a completion.

Fixes golang/go#46896 and golang/go#51089

Change-Id: I46c05af0ead79c1d82ca40b2c605045e06e1a35d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/385974
Run-TryBot: Peter Weinberger <[email protected]>
Trust: Peter Weinberger <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
gopls-CI: kokoro <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
@findleyr
Copy link
Member

Reopening, as I don't think this feature is quite working correctly.

If I am inside a fuzz function and type f.Fuz, the current implementation drops the completion to Fuzz. I think that's a bug -- it should only prune completions inside of a fuzz target.

@findleyr findleyr reopened this Mar 15, 2022
@findleyr findleyr modified the milestones: gopls/v0.8.1, gopls/v0.8.2 Mar 15, 2022
@pjweinb
Copy link

pjweinb commented Mar 15, 2022 via email

@pjweinb
Copy link

pjweinb commented Mar 16, 2022

closed by 393019
:
internal/completion: default to regular completion for f.Fuzz without f.Add

@pjweinb pjweinb closed this as completed Mar 16, 2022
@rsc rsc unassigned pjweinb Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest Issues asking for a new feature that does not need a proposal. FrozenDueToAge 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

5 participants