waigani / GoOracle

GoOracle is a Golang plugin for SublimeText that integrates the Go oracle tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Oracle never returns

anacrolix opened this issue · comments

Pressing ctrl+shift+o and selecting something shows a buffer that contains the following:

Running oracle callees command...

It never finishes. The console contains:

Traceback (most recent call last):
  File "goOracle in /Users/anacrolix/Library/Application Support/Sublime Text 3/Installed Packages/GoOracle.sublime-package", line 46, in on_done
  File "goOracle in /Users/anacrolix/Library/Application Support/Sublime Text 3/Installed Packages/GoOracle.sublime-package", line 115, in oracle
TypeError
commented

exact same thing here.

the fix is to update your project settings file (*.sublime-project ) to contain:

    {
        "folders":
        [... your stuff ... ],
        "settings":
        {
            "GoOracle":{
                "env":
                {
                    "GOPATH": "/Src/myproject",
                    "PATH": "$GOPATH/bin:$PATH"
                },
                "oracle_scope": ["github.com/ericaro/mrepo/a"]
            }
        }
    }

I got the TypeError, did as @ericaro suggested, and now I get this:

Traceback (most recent call last):
  File "./goOracle.py", line 46, in on_done
  File "./goOracle.py", line 121, in oracle
AttributeError: 'module' object has no attribute 'set_timeout_async'

Sublime text 2, Ubuntu 14.04.

I also see nothing, and the instructions above for which file to edit do not contain enough context.
There are no files on my file system with that suffix, therefore I do not know which one to edit.
(Or rather, I have edited the entire (empty) set of them, so I followed the instructions to the letter.)

I have set up .../Packages/GoOracle/User.sublime-settings like so:
{
"env": { "GOPATH": "$HOME/work/gocode", "GOROOT": "$HOME/work/go", "PATH": "$HOME/work/go/bin:$HOME/work/gocode/bin:$PATH" },
"oracle_scope": [],
"oracle_format": "plain",
"output": "buffer"
}

On the command line I get:
oracle -format=plain -pos=$GOROOT/src/net/http/triv.go:#413 what
/Users/drchase/work/go/src/net/http/triv.go:26.25-26.38: identifier
/Users/drchase/work/go/src/net/http/triv.go:26.20-26.38: selector
/Users/drchase/work/go/src/net/http/triv.go:26.18-26.38: field/method/parameter
/Users/drchase/work/go/src/net/http/triv.go:26.17-26.58: field/method/parameter list
/Users/drchase/work/go/src/net/http/triv.go:26.1-29.1: function declaration
/Users/drchase/work/go/src/net/http/triv.go:7.1-141.1: source file
-: modes: [callers callstack definition describe implements pointsto referrers]
-: srcdir: /Users/drchase/work/go/src
-: import path: net/http

I'm using Sublime Text 3 on a Mac running Mavericks.
I edited User.sublime-settings (the first time) with emacs.
My query to GoOracle in Sublime Text references the exact same file and position (I installed a character counter plugin to get that part right, it was also not working before I installed the character counter plugin).

Thanks for any assistance.

Success!! This is (exactly) what worked for me -- I am working on Go 1.5.
In /Users/drchase/work/go/GoDevel.sublime-project, I put the following,
this may be more than is necessary, but this worked:

{
    "folders": [ {
        "follow_symlinks": true,
        "path":"/Users/drchase/work/go/src"
    } ],
    "settings": {
        "GoOracle": {
            "env": {
                "GOPATH": "/Users/drchase/GoogleDrive/work/gocode",
                "GOROOT": "/Users/drchase/GoogleDrive/work/go",
                "PATH": "$GOPATH/bin:$GOROOT/bin:$PATH"
            },
            "oracle_scope": ["github.com/golang/go"]
        }
    }
}
  • GOROOT appears to be necessary
  • Symbolic links cannot appear in GOPATH or GOROOT; this seems like a bug, or else at least some missing documentation.

@dr2chase tried w/o luck :-(