Skip to content
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

Jump to definition doesnt work with vanity domain names #568

Closed
epelc opened this issue Nov 19, 2014 · 4 comments
Closed

Jump to definition doesnt work with vanity domain names #568

epelc opened this issue Nov 19, 2014 · 4 comments

Comments

@epelc
Copy link

epelc commented Nov 19, 2014

I believe gosublime has a problem showing docs and jumping to definition for vanity domain name packages. For example if you try to do so with mgo which now uses gopkg.in/mgo.v2 as its domain you will see // GsDoc: no docs found when ypi ctrl+shift+click on a package struct/function.

This may be related to godoc only recognizing a certain list of domains see golang/gddo#68

@DisposaBlackSwan
Copy link

How do I reproduce this? does it actually work with the original path? FYI: only global definitions are supported so fmt.Println should work but err.Error won't and IIRC it also won't work if there are syntax errors in the file.

@epelc
Copy link
Author

epelc commented Nov 19, 2014

Try it with this use cmd instead of ctrl on macs. Also I'm aware it doesnt work on certain types but this is package wide(and I assume everything on gopkg.in and similar domains wont work either).

package main

import (
    "gopkg.in/mgo.v2"
    "log"
)

func main() {
    // crtl+shift+click on "Dial" doesnt work
    session, err := mgo.Dial("localhost")
    if err != nil {
        panic(err)
    }
    // doesnt work on "Close"
    defer session.Close()

    // crtl+shift+click on "Println" works
    log.Println("You can jump to Println's definition")
}

@DisposaBlackSwan
Copy link

I believe this is a sife-effect of the import path (basename) not being the same as the pkg it defines. I'm sure it's come up before, but that functionality's waiting for a rewrite so I don't think there's any point in trying to fix it at this time. You can get the same info with a few more keystrokes by typing ctrl+dot,ctrl+a

@dlclark
Copy link

dlclark commented Dec 1, 2014

Margo (the backend) currently doesn't support this level of Go To Definition, but I've taken this snippet and confirmed it's fixed by my changes in #571.

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

No branches or pull requests

4 participants