-
Notifications
You must be signed in to change notification settings - Fork 648
Support "Go: Autocomplete Unimported Packages" feature when using Go modules #2484
Comments
Maybe at least make it to work with packages under the current module and those in vendor folder? They are presented in source code files and the good old going-over approach should work. |
@ramya-rao-a, we are definitely planning on supporting this as part of |
Thanks @stamblerre Closing this issue in favor of the upstream issue. |
Oh closed too soon!
That is an interesting take, how do you suggest we get the list of such packages? Would |
I think there is a way that caching standard library's packages information to some place, because everybody would use it everyday and itself isn't change too often. And provide the list of dependencies's by parsing |
Doesn't |
With On modules it includes all dependencies' packages and standard library's packages as well. |
Thanks @fintanchen and @paivagustavo |
There is no fast way to do what you are trying to do here with existing tools. |
Thanks @ianthehat If anyone wants to help with the issue, please look at golang/go#31906 to help contribute a way to get this feature from I'll keep this issue open just in case if anyone wants to give the |
saibing/tools support "Autocomplete Unimported Packages", can this help with the issue? |
golang/go#31906 has been closed upstream, and this will be supported by default in |
That's great news @stamblerre Is there a way one can disable this feature? |
It can be disabled by setting the |
Thanks @stamblerre Closing this issue as the feature will be available in the next version
|
Enabling the setting
go.autocompleteUnimportedPackages
used to provide completions for unimported packages. When such a completion item was selected by the user, not only was the current word completed, but an import statement is added in the file for that package.This was implemented by going over all the packages under the GOPATH and keeping a cache of this result.
With Go modules, it is not clear how we can provide this feature.
@stamblerre Is this something that
gopls
can do as part of the completion provider?The text was updated successfully, but these errors were encountered: