-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
GoInfo fails silently on systems where gocode -sock=unix fails #996
Comments
Hi @blin So this fails on if you use gocode on bash on ubuntu on windows ? I'm not sure why vim-go should fix it? Shouldn't you open this issue for gocode itself ? |
The main concern that I have is that vim-go fails silently, instead of producing a clear error message. It took me a long time to figure out that something was wrong with gocode, rather than my vim installation or configuration.
I should open an issue for BashOnWindows. Still, adding an option to set -sock=tcp on gocode will not introduce a lot of complexity to the code base and will address a real issue. |
If you give a screenshot or the correct error message I might have a look at it. |
I'm not sure I understood what you wanted, but here you go https://i.imgur.com/tLUbLa8.png . This is the result of the following change: --- a/autoload/go/complete.vim
+++ b/autoload/go/complete.vim
@@ -37,6 +37,7 @@ function! s:gocodeCommand(cmd, preargs, args)
let $GOPATH = old_gopath
if go#util#ShellError() != 0
+ echoerr "gocode failed:" . result
return "[\"0\", []]"
else
if &encoding != 'utf-8' Note that error detection is already in place, but the error is never presented to the user. |
The reason for that is that the autocompletion engine in Vim itself accepts a value. And that's it. You can't go and pass an error to it. And if you try to echo it, it shows it in an unreadable way. I'm adding a setting now where you can customize the socket flag that is passed to |
Actual behavior
GoInfo fails silently if
gocode -sock=unix
fails.Expected behavior
GoInfo fails with an error message and a suggestion to set something like
let g:go_gocode_sock_tcp = 1
.let g:go_gocode_sock_tcp = 1
adds-sock=tcp
to gocodeCommand's preargs.Steps to reproduce:
Running gocode on bash on ubuntu on windows
Workaround
The text was updated successfully, but these errors were encountered: