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

Go completion not working, but works with <C-x> <C-o> #103

Closed
blockloop opened this issue Apr 27, 2017 · 3 comments
Closed

Go completion not working, but works with <C-x> <C-o> #103

blockloop opened this issue Apr 27, 2017 · 3 comments

Comments

@blockloop
Copy link

I have vim-go installed and pressing <C-x> <C-o> opens autocompletion properly, otherwise nothing works.

I stopped gocode and ran it in debug mode and tested with both <C-x> <C-o> and simply by pressing .. When I press . I get the following output from gocode

2017/04/26 21:14:27 Import path "github.com/stretchr/testify/assert" was not resolved
2017/04/26 21:14:27 Gocode's build context is:
2017/04/26 21:14:27  GOROOT: /usr/local/Cellar/go/1.8.1/libexec
2017/04/26 21:14:27  GOPATH: /Users/brett/go
2017/04/26 21:14:27  GOOS: darwin
2017/04/26 21:14:27  GOARCH: amd64
2017/04/26 21:14:27  BzlProjectRoot: ""
2017/04/26 21:14:27  GBProjectRoot: ""
2017/04/26 21:14:27  lib-path: ""
2017/04/26 21:14:27 extracted expression tokens: b
2017/04/26 21:14:27 Offset: 0
2017/04/26 21:14:27 Number of candidates found: 0
2017/04/26 21:14:27 Candidates are:
2017/04/26 21:14:27 =======================================================

Without changing anything I can press <C-x> <C-o> and completion comes up and gocode prints the following

017/04/26 21:15:05 -------------------------------------------------------
2017/04/26 21:15:05 Found "testing" at "/usr/local/Cellar/go/1.8.1/libexec/pkg/darwin_amd64/testing.a"
2017/04/26 21:15:05 Found "github.com/stretchr/testify/assert" at "/Users/brett/go/pkg/darwin_amd64/github.com/blockloop/go-datastructures/vendor/github.com/stretchr/testify/assert.a"
2017/04/26 21:15:05 Error parsing input file (inner block):
2017/04/26 21:15:05  6:4: expected selector or type assertion, found ';'
2017/04/26 21:15:05  7:2: expected ';', found 'IDENT' assert
2017/04/26 21:15:05  8:2: expected ';', found 'EOF'
2017/04/26 21:15:05  8:2: expected '}', found 'EOF'
2017/04/26 21:15:05 extracted expression tokens: b
2017/04/26 21:15:05 Offset: 0
2017/04/26 21:15:05 Number of candidates found: 6
2017/04/26 21:15:05 Candidates are:
2017/04/26 21:15:05   func Size() int
2017/04/26 21:15:05   func findMin() *Node
2017/04/26 21:15:05   func insert(data int) *Node
2017/04/26 21:15:05   func search(data int) *Node
2017/04/26 21:15:05   var Root *Node
2017/04/26 21:15:05   var size int
2017/04/26 21:15:05 =======================================================

Is vim-go doing something different? Why is omnicomplete working, but the regular completion using . or <tab> not? The autocomplete is triggering, but gocode is reporting the vendor packages not resolving.

I have enabled tab completion as in the readme. This appears to be a problem with the command passed to gocode. github.com/stretchr/testify/assert is installed in vendor/.

@blockloop
Copy link
Author

@fatih perhaps you can shed some light as well

@edganiukov
Copy link
Contributor

@blockloop maybe related to nsf/gocode#461
As @nsf said it has wrong gocode cli arguments. Here is:
https://github.com/maralla/completor.vim/blob/master/pythonx/completers/go.py#L19

@blockloop
Copy link
Author

Cleaning up old PRs. Closing this because this project appears abandoned.

@blockloop blockloop closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants