-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
:GoInstall error navigation seems broken #404
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
Comments
Hi @daaku. Weird thing indeed. The thing is there is no code that changed |
It's getting the absolute paths wrong, |
It's so hard to test this without a proper test files. I've tried in my current GOPATH with several other packages, and in all of them it was working. Is there a way you could paste me a self contained go code so I could directly reproduce it ? |
I'll look into it later |
I pulled but it still fails for me :/ Here's a repro case: # setup a test case
export GOPATH=$PWD/tmp
mkdir -p $GOPATH/src/foo
mkdir -p $GOPATH/src/bar
cat << 'EOF' > $GOPATH/src/foo/foo.go
package foo
import "fmt"
func Do() {
fmt.Println("hello from foo")
}
EOF
cat << 'EOF' > $GOPATH/src/bar/bar.go
package main
import (
"fmt"
"foo"
)
func main() {
foo.Do()
fmt.Println("hello from bar")
}
EOF
go install -v ...
$GOPATH/bin/bar
# now break the code so go install fails
cat << 'EOF' > $GOPATH/src/foo/foo.go
package foo
func Do() {
fmt.Println("hello from foo")
}
EOF
go install -v ...
# open this and run :GoInstall
vim $GOPATH/src/bar/bar.go |
Thanks @daaku. Will look at it in the morning. |
We need to cd into the current files directory. This is important so namemodify does create a full path for outputs when the token is only a ingle file name (such as for a go test output, i.e.: 'demo_test.go'). For ther outputs, such as 'go install' we already get an absolute path i.e.: '../foo/foo.go') and fnamemodify successfuly creates the full ath.) Fixes #404,#407
Thanks @daaku I can now reproduce it. I've fixed it with #410. Can you please try it? Now it successfully parses the error location and put's into the quickfix list. Note that |
Really appreciate the effort @fatih! The path logic still isn't working -- it's getting the correct filename, but not the directory. |
It will show the file name but if you call |
I'm not getting the same behavior. I setup a stripped vimrc to make sure there isn't anything interfering which looks like this:
(I'm using https://github.com/junegunn/vim-plug but I don't think that should matter.) The vim-go I'm using is at rev 22544ec. When I run
So it's getting the |
This time I really couldn't reproduce it :/ With the fix at #410 it works perfect. I've also tried with the your simple vimrc. Here is a screencast showing it: http://quick.as/4ovsbqqm I'm merging #410. Please pull master again. I think it's because you didn't try with #410 may be? |
It's fixed! Thank you very much @fatih! |
Finally 👍 :) |
Haven't figure out what exactly is happening, but this was working fine until I upgraded yesterday. Steps to reproduce:
$HOME
$HOME/go/src/foo/foo.go
:GoInstall foo/..
GoInstall
in$HOME/go/src/bar/bar.go
you'll see it listed but won't be opened as it used to be.The text was updated successfully, but these errors were encountered: