-
Notifications
You must be signed in to change notification settings - Fork 72
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
Module aware go completion #115
Comments
I would first ask in go-nuts group, or at Go slack if anyone knows on such API, or what is the best practice to do it. Shelling out and decoding the json can be last resort.
This sounds great. I would appreciate such a PR. |
Good suggestion. I asked around on the Go slack and got some suggestions. I was able to write some test code that lists all names within a package's scope using
A list of imports can be obtained by setting the right Mode. I'm working on a PR that updates the gocomplete tool with the latest 1.14 flags and I'm starting to play with completion for godoc. |
Sounds good. Enjoy it! |
I use this package's go completion daily and I really appreciate it. However the completion suggestions for packages is both limited and now outdated as it relies on GOPATH, which is effectively deprecated.
I would like the go completion to take advantage of
go list
to obtain a module aware list of suggestions. This can even be used to greatly improve the use ofgo doc
and complete not just package name but also symbols from the package. The suggestions can even take into account the-u
flag and offer unexported completion suggestions as well.This can fall back to searching the module cache if no matching name is in the local projects go.mod file, and finally it could fall back to searching $GOPATH/src/ for package name completions.
I did a little research and discovered that there is no package that exposes the same functionality as
go list
however it has well defined JSON output option so parsing the output is trivial.I am interested in submitting a PR for this but wanted to discuss it in an issue first.
The text was updated successfully, but these errors were encountered: