waigani / GoOracle

GoOracle is a Golang plugin for SublimeText that integrates the Go oracle tool.
MIT License
73 stars 17 forks source link

Oracle never returns #13

Open anacrolix opened 9 years ago

anacrolix commented 9 years ago

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
ericaro commented 9 years ago

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"]
            }
        }
    }
pwaller commented 9 years ago

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.

dr2chase commented 9 years ago

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.

dr2chase commented 9 years ago

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"]
        }
    }
}
jostyee commented 8 years ago

@dr2chase tried w/o luck :-(