Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

'Go to definition' does not work #185

Closed
abligh opened this issue Feb 10, 2016 · 3 comments
Closed

'Go to definition' does not work #185

abligh opened this issue Feb 10, 2016 · 3 comments

Comments

@abligh
Copy link

abligh commented Feb 10, 2016

Selecting a method and using F3 / Go to definition does not always work. Here is a minimal program illustrating the point:

package main

import (
    zmq "github.com/pebbe/zmq4"
)

func main() {
    responder, _ := zmq.NewSocket(zmq.REP)
    defer responder.Close()
}

Put that in a new project, and pull zmq4 from github. Right click on 'NewSocket', 'REP' or 'Close' and do 'go to definition'. You will get the mysterious error 'selected position does not refer to a definition. Rather, it's a: selector'. I am pretty sure this used to work.

@bruno-medeiros
Copy link
Contributor

You sure this used to work? I can't compile that project due to a:

# github.com/pebbe/zmq4
github.com\pebbe\zmq4\errors.go:4:17: fatal error: zmq.h: No such file or directory

Usually if a project does compile due to import failures, then oracle doesn't work properly as well. (orace is the tool used to find def)

@abligh
Copy link
Author

abligh commented Feb 12, 2016

On 12 Feb 2016, at 12:35, Bruno Medeiros notifications@github.com wrote:

You sure this used to work? I can't compile that project due to a:

github.com/pebbe/zmq4

github.com\pebbe\zmq4\errors.go:4:17: fatal error: zmq.h: No such file or directory

Usually if a project does compile due to import failures, then oracle doesn't work properly as well. (orace is the tool used to find def)

The project compiles fine here. You will have to install libzmq4 and its development headers to get that one to work.

Alex Bligh

@bruno-medeiros
Copy link
Contributor

I'm on Windows, so I can't install that easily. In any case don't think it matters, this seem to be an oracle issue, same as this: #176

Namely the problem is: golang/go#13971

The good news is I might switch to using https://github.com/rogpeppe/godef instead, it seems nearly every other IDE/editor is using that, so it might have better support overall. And I did try it on the case above, and it seems to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants