DisposaBoy / GoSublime

A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.
MIT License
3.42k stars 302 forks source link

Goto Definition not working with vendor #664

Closed nicmue closed 5 years ago

nicmue commented 8 years ago

I have several projects with own vendor folders. When I try to use the "Goto Defintion" function of GoSublime, he's telling me "// GsDoc: no docs found" or he jumps to the Source outside of Vendor. I tried to set the GOPATH for GoSublime to the specific vendor directory and enabled GO15VENDOREXPERIMENT, but this still don't works.

Can someone help me? I think I'm doing something completely wrong...

franciscocpg commented 8 years ago

It's working Goto Definition with vendors for me, but Code Completion is not (I am going to open an issue for this). I have the following values at my GoSublime.sublime-settings

"env": { 
        "GOPATH": "/Users/fguima4/programas/go",
        "GO15VENDOREXPERIMENT": "1"
    }
ben181231 commented 8 years ago

On my situation, Code Completion works while Goto Definition is not.

runningmaster commented 8 years ago

@ben181231

On my situation, Code Completion works while Goto Definition is not.

I have same problem too.

donkeysharp commented 7 years ago

Hello, I'm having the same issue

On my situation, Code Completion works while Goto Definition is not.

@ben181231 what configuration are using in order to make Code Completion work?

My project has this structure

.
├── foo
├── main.go
└── vendor
    ├── deps
    └── vendor.json

When I use this settings:

{
    "env": {
        "GOPATH": "${PWD}/vendor:${GOPATH}",
    },
}

I don't have Code Completion working, however if I create a symlink inside vendor called src inside pointing to itself then I have Code Completion working

$ ~/foo/vendor > ln -s ../vendor src

Any ideas on how to solve this problem?

dvcrn commented 7 years ago

Same problem here. Code completion works fine but jumping to vendored definitions often has problems. Any solutions for this?

alecthomas commented 6 years ago

Yep, still happening for me.

zvodd commented 6 years ago

Same, code completion work, goto definitions does not.

Does anyone know what part of the plug-in is responsible for definition look ups? I'd be happy to throw a bunch of print statements into it and maybe find a clue.

DisposaBoy commented 6 years ago

@zvodd I need more info. What version of GoSublime you're using, etc.

zvodd commented 6 years ago

@DisposaBoy Sublime Text 3: "Build 3175" Go Sublime: "18.07.31" go version go1.10.3 windows/amd64

Attempted to do some preliminary bug hunting, ended up down a rabbit hole reading python thread lock C implementation ¯\(ツ)

DisposaBoy commented 6 years ago

@zvodd try switching to the development branch. See https://margo.sh/b/migrate/