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
Get completion for package when it's not imported yet (using with deoplete) #2562
Comments
This feature is currently available behind a flag in |
We need to add some options to vim-go to support starting gopls with flags. |
@marselmustafin is deoplete using vim-go's autocompletion? If not, then your particular use case needs to be solved by deoplete, not with vim-go. |
@stamblerre will |
I'm not sure yet, but most likely, yes. I think the feature still needs to be iterated on a bit more. |
Deoplete has the So this issue should aim to implement |
@stamblerre I just want to confirm: |
Yes, exactly. |
@bhcleek thanks for the update. Did you test completion with |
It will, of course depend on the version of gopls you have installed. I think that the latest release of gopls doesn't yet support this feature, but a new release is imminent. Once a new release of gopls is made, you can use You may find golang/go#31906 useful, too. |
Fixes fatih#2562 for realz.
@marselmustafin after correcting to use the proper values to encode for json, the version of gopls installed by vim-go works as expected for me. |
@bhcleek I've updated plugin and |
The latest stable version (v0.1.7) does not seem to have this feature. You can install gopls with a certain commit to support this. such as... go get -v -u golang.org/x/tools/gopls@97ad0ed33101b39103eaf8aeab62b59dd1cfb89e I have successfully completed methods from unimported ones. |
@delphinus I am using gopls 0.1.7, and completion of unimnported package names is working fine. @marselmustafin |
@bhcleek sorry for importunity. I tried different things but it still doesn't work. I've set |
No worries, @marselmustafin . Currently, gopls does not complete the identifiers from unimported packages; it only completes the package itself. golang/go#31906 is useful to explain some of the details of the gopls feature. |
What did you do? (required: The issue will be closed when not provided)
Also
deoplete
andvim-go
plugins installed.What did you expect to happen?
Autocompletion works excellent with
deoplete
for imported packages. But given I enteredfmt
for example and it's not in my import list, I want to see functions for this package in completions list anyway.What happened instead?
I see no completions for package until it imported. This forces me to import package manually or add function call and import it by
goimports
before using completion.Configuration (MUST fill this out):
(written above)
vim-go version:
v1.21
Vim version (first three lines from
:version
):Neovim v0.4.2
Go version (
go version
):go version go1.13.1 darwin/amd64
Go environment
not relevant here
The text was updated successfully, but these errors were encountered: