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: add a method snippet to postfix completion #55154

Open
THOUSAND-SKY opened this issue Sep 18, 2022 · 5 comments · May be fixed by golang/tools#405
Open

x/tools/gopls: add a method snippet to postfix completion #55154

THOUSAND-SKY opened this issue Sep 18, 2022 · 5 comments · May be fixed by golang/tools#405
Assignees
Labels
FeatureRequest gopls Issues related to the Go language server, gopls. help wanted Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@THOUSAND-SKY
Copy link

THOUSAND-SKY commented Sep 18, 2022

Is your feature request related to a problem? Please describe.
Typing out methods is tedious because one always has to fill the receiver field. The meth snippet is great but this would be even better.

Describe the solution you'd like
It would be real slick to have a completion from:

type X struct {}

X.meth!

to

type X struct {}

func (x X) _() {
}
@findleyr findleyr changed the title Suffix completion for methods x/tools/gopls: add a method snippet to postfix completion Sep 19, 2022
@findleyr findleyr transferred this issue from golang/vscode-go Sep 19, 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 Sep 19, 2022
@gopherbot gopherbot added this to the Unreleased milestone Sep 19, 2022
@findleyr findleyr modified the milestones: Unreleased, gopls/unplanned Sep 19, 2022
@findleyr
Copy link
Contributor

findleyr commented Sep 19, 2022

Thanks, this should be straightforward to add (start in gopls/internal/lsp/source/completion/postfix_snippets.go). Marking as "help wanted".

@anoymouscoder
Copy link

anoymouscoder commented Sep 22, 2022

Hi, @findleyr. I would like to work on this issue

@anoymouscoder
Copy link

anoymouscoder commented Sep 28, 2022

@findleyr Could you assign this issue to me? :)

@findleyr
Copy link
Contributor

findleyr commented Sep 29, 2022

Done! Thanks.

anoymouscoder pushed a commit to anoymouscoder/tools that referenced this issue Oct 4, 2022
Support for generating method for structs

Fixes golang/go#55154
@gopherbot
Copy link

gopherbot commented Oct 4, 2022

Change https://go.dev/cl/438415 mentions this issue: gopls: add a method snippet to postfix completion

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. help wanted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants