Closed klonuo closed 9 years ago
Hey klonuo, thanks for checking srclib out! Yeah, srclib-python currently has a rather large dependency on Go, so you'll need to set up your GOPATH after downloading Go.
The GOPATH is what Go uses as its "workstation": it will download code to $GOPATH/src, install binaries in $GOPATH/bin, and put object files in $GOPATH/pkg. You can set it to anything you want, but I have a "code" directory in my home directory, and I added the line "export GOPATH=/home/samer/code/go" to my .bashrc.
If you're on a Mac, setting environmental variables is a bit tricky for gui applications. I pushed a change so that you can specify the full path for the "src" tool, but it hasn't taken on Package Control yet. I can ping you when it's up to date, though I didn't expect it to take this long.
Let me know if you have any other questions!
Thanks for your explanation.
Additionally I had to add $GOPATH/bin
to my PATH.
After successfully finishing previous command, it seems like Python support is present:
$ src toolchain list-tools
TOOLCHAIN TOOL OP SOURCE UNIT TYPES
sourcegraph.com/sourcegraph/srclib-go scan scan GoPackage
sourcegraph.com/sourcegraph/srclib-go graph graph GoPackage
sourcegraph.com/sourcegraph/srclib-go depresolve depresolve GoPackage
sourcegraph.com/sourcegraph/srclib-python scan scan PipPackage
sourcegraph.com/sourcegraph/srclib-python graph graph PipPackage
sourcegraph.com/sourcegraph/srclib-python depresolve depresolve PipPackage
Maybe I don't understand how this is supposed to work, but I can't get anything out in Sublime Text. I created a file with simple statement import sys; print(sys.path)
and calling the plugin on highlighted sys.path
- here is the result:
sourcegraph: ERROR: src api describe failed: Command '['src', 'api', 'describe', '--file', '/home/klo/temp/test.py', '--start-byte', '12', '--no-examples']' returned non-zero exit status 1
On a side note, I'd like to mention that plugin currently does not handle opened buffer file, if it is not saved to a file on disk:
sourcegraph: ERROR: src api describe failed: Can't convert 'NoneType' object to str implicitly
Hi,
I wanted to try Sublime Text plugin with Python source, but I keep getting no result and it's not clear if Python is supported out-of-the-box or not. So after installing golang I tried this:
Googling around I coudn't find what exact location should I set to GOPATH as I'm not familiar with the language and it's packaging system and the context on which I should set it.