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: autocomplete in package declaration #34008

Closed
stamblerre opened this issue Sep 1, 2019 · 3 comments
Closed

x/tools/gopls: autocomplete in package declaration #34008

stamblerre opened this issue Sep 1, 2019 · 3 comments
Labels
FeatureRequest FrozenDueToAge 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

@stamblerre
Copy link
Contributor

This can be done for new files in the same package, test files, or new packages based on the name of the directory.

@stamblerre stamblerre added NeedsFix The path to resolution is known, but the work has not been done. gopls Issues related to the Go language server, gopls. labels Sep 1, 2019
@gopherbot gopherbot added this to the Unreleased milestone Sep 1, 2019
@kiivihal
Copy link
Contributor

kiivihal commented Sep 7, 2019

I would like to pick this up. Any pointers to the best place to start would be appreciated.

@stamblerre
Copy link
Contributor Author

This might be a particularly complicated change actually, because this type of completion would only be triggered when we don't know the name of the package so we won't have good type information. The autocompletion code can be found here: https://github.com/golang/tools/blob/master/internal/lsp/source/completion.go, but I think that you will basically need to create a case that does this here: https://github.com/golang/tools/blob/27d1b4e4f3c75e4e2c92ae1b99a67c7f34185617/internal/lsp/source/completion.go#L394, when we fail to get a package for the given file.

@stamblerre stamblerre added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 9, 2019
@stamblerre stamblerre modified the milestones: Unreleased, gopls unplanned Dec 4, 2019
@stamblerre stamblerre modified the milestones: gopls unplanned, gopls completion Jan 29, 2020
@stamblerre stamblerre removed this from the gopls/v0.5.0 milestone Jun 24, 2020
@stamblerre stamblerre added FeatureRequest and removed NeedsFix The path to resolution is known, but the work has not been done. labels Jul 23, 2020
@gopherbot
Copy link

Change https://golang.org/cl/251160 mentions this issue: internal/lsp: add package completion suggestions

@golang golang locked and limited conversation to collaborators Sep 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge 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

No branches or pull requests

3 participants