Gocode can't autocomplete file in GOPATH #94

Closed
openvn opened this Issue Aug 7, 2012 · 6 comments

Projects

None yet

3 participants

@openvn
openvn commented Aug 7, 2012

GOPATH=~/workspace/testing/test2

~/workspace/testing/test2/
_______________________src/
__________________________hello/
_______________________________hello.go
__________________________hi/
____________________________hi.go
__________________________test2/
______________________________ main.go
_______________________pkg/
__________________________ linux_368/
____________________________________hello.a
____________________________________hi.a
_______________________bin/


~/workspace/testing/test2/src/main.go:
package main

import (
"fmt"
"hello"
"hi"
)

func main() {
fmt.Print(hello.Hello())
fmt.Print(hi.)
}


When I run:
gocode -in=main.go autocomplete main.go 102
gocode return:
Nothing to complete.

But after I run "gocode set lib-path ~/workspace/testing/test2/pkg/linux_368", it seem ok.

@nsf
Owner
nsf commented Aug 7, 2012

I don't believe you. It works. I've been working on an app which uses a bunch of libraries from GOPATH, all works just fine. And GOPATH is not a new thing, gocode has a lot of users and pretty much all of them use GOPATH and I've heard no complaints like that. Not sure what it could be in your case, but it's not gocode's fault.

@openvn
openvn commented Aug 8, 2012

thanks for your reply.
Any way, I can live with lib-path.

2012/8/8, nsf notifications@github.com:

I don't believe you. It works. I've been working on an app which uses a
bunch of libraries from GOPATH, all works just fine. And GOPATH is not a new
thing, gocode has a lot of users and pretty much all of them use GOPATH and
I've heard no complaints like that. Not sure what it could be in your case,
but it's not gocode's fault.


Reply to this email directly or view it on GitHub:
#94 (comment)

Nguyễn Văn Cao Nguyên
/**
* Contact : +84+935704595
* Blog : http://nguyen.hocvui.net
*/

@ovidiuvisan

You better believe it. Also happens to me, and i have correctly setup $GOOS, $GOARCH, $GOPATH.
$GOOS, $GOARCH, $GOPATH are set in .vimrc in my case:

let $PATH .= ":/usr/lib/go/bin"
let $GOROOT= "/usr/lib/go"
let $GOOS='linux'
let $GOARCH='amd64'
autocmd BufRead,BufNewFile *.go let $GOPATH = expand("%:p:h")

gocode set lib-path "" - doesn't work
gocode set lib-path "fullpath/pkg/architecture" - works
(sorry i didn't paste the actual code, but it's big)

other than that, thumbs up man, great piece of work, saves me ton of time!

@nsf
Owner
nsf commented Aug 25, 2012

That's a different story. In your case the problem is that once a gocode server was started, it doesn't get the new environment vars from the client when you change them. It's in my TODO list: #79

@ovidiuvisan

i see, thanks for info. I am manually setting up lib-path for now and it works.

@nsf
Owner
nsf commented Mar 18, 2013

No response from the issue reporter - no issue.

@nsf nsf closed this Mar 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment