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: fix autocompletion of structs in slices #33211

Closed
ComfyFluffy opened this issue Jul 22, 2019 · 3 comments
Closed

x/tools/gopls: fix autocompletion of structs in slices #33211

ComfyFluffy opened this issue Jul 22, 2019 · 3 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ComfyFluffy
Copy link

go version

go version go1.12.5 windows/amd64

gopls version

version v0.1.3, built in $GOPATH mode

On VSCode:
This seems OK (ctrl + space):
image

After deleted &cli.Command before Name:, press ctrl + space:
image

It will not show the completions of the struct. It should show completions like the first one.

@gopherbot gopherbot added this to the Unreleased milestone Jul 22, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 22, 2019
@stamblerre stamblerre changed the title x/tools/gopls: Auto completion not working in this situation x/tools/gopls: autocompletion of structs in slices Jul 22, 2019
@stamblerre stamblerre added the Suggested Issues that may be good for new contributors looking for work to do. label Jul 22, 2019
@stamblerre stamblerre changed the title x/tools/gopls: autocompletion of structs in slices x/tools/gopls: fix autocompletion of structs in slices Jul 22, 2019
@stamblerre
Copy link
Contributor

Thank you for reporting this issue. We will investigate.

@stamblerre stamblerre added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 22, 2019
@stamblerre stamblerre added help wanted and removed Suggested Issues that may be good for new contributors looking for work to do. labels Aug 8, 2019
@ghost
Copy link

ghost commented Aug 29, 2019

Hey! I'm looking for a good way to start contributing to the Go project. I spent a little time looking into this issue. It appears that the root of the issue is that it is a slice of pointers, which confuses the code in completion.go:enclosingCompositeLiteral(). The suggestions work correctly if it is a slice of structs (not pointers to structs).

I'll try to put together a fix for this unless someone does first.

@gopherbot
Copy link

Change https://golang.org/cl/192277 mentions this issue: gopls: fixes completion for pointers to structs in slice literals

@golang golang locked and limited conversation to collaborators Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants