AutoComplete un-imported packages based on go.mod #1902
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for jumping on this @uudashr!
Correct me if I am wrong, I was under the assumption that when modules are enabled, then one can only import packages that are defined in the module or the ones in the standard library.
With the current change, packages from the GOPATH will also be included regardless of whether the current file is under the GOPATH or not
Ya.. correct. Just figure out.
|
So I am guessing we need to
The identification of whether current package is using modules or not, should be done in |
I cloned https://github.com/golang/example/ outside of my GOPATH
Since this PR relies on |
@ramya-rao-a what is the goal of What if we are opening file under go modules project, does the result going to be different ex: GOROOT + modules |
Yes. Let's keep things consistent and make all the 3 exported functions from
|
Is this coming online soon? It'd be nice for VSC to work with the .mod files! |
Hopefully soon |
Eh! I just went ahead and imported your files into my current Go plugin. Couldn't wait for the 'official' release. Great work, man! Everything is working just swimmingly! Love it! |
Works great too. |
@uudashr Turns out that if you use Also, the current solution in this PR doesn't make use of the caching system we put in place earlier. I am closing this PR in favor of 0a9001f which covers the above concerns. Do take a look at that commit and share any feedback you have. Others, Also see |
Still we have missing piece here. |
Note to others: this is being followed up in #1937 |
Initial support for go modules.