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

Open
stamblerre opened this issue Sep 1, 2019 · 2 comments

Comments

@stamblerre
Copy link
Contributor

commented Sep 1, 2019

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

@gopherbot gopherbot added this to the Unreleased milestone Sep 1, 2019

@kiivihal

This comment has been minimized.

Copy link
Contributor

commented Sep 7, 2019

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

@stamblerre

This comment has been minimized.

Copy link
Contributor Author

commented Sep 9, 2019

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 label Sep 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.