12 comments

[ 4.0 ms ] story [ 40.2 ms ] thread
Sourcegraph CEO here. Excited to show this to HN folks. Huge credit to Farhan Attamimi and John Rothfels on our team for creating it.

Happy to answer any questions here about how we built the Sourcegraph Chrome extension, future plans, issues, etc.

We will be adding more languages soon (beyond Go and Java). Email me at sqs@sourcegraph.com if you want to beta test JavaScript, Python, Objective-C, C/C++, Ruby, or Scala. Or just install the extension now and it'll be automatically updated with more languages in the future.

You can install it directly from https://chrome.google.com/webstore/detail/sourcegraph-browse....

What information does the extension send back to your servers?
It doesn't send code from the GitHub page to Sourcegraph; it actually only works if the repo is already mirrored on Sourcegraph (which obviously requires your explicit permission for private repos).

It will send the name of the repo (e.g., "google/golang" or "JodaOrg/joda-time"), so that Sourcegraph can see whether that repo is mirrored. If the names of your repositories alone are sensitive data and you don't want to trust us, then you shouldn't use the extension. (Repo names can leak to third parties via the HTTP referer header, even in an alternate universe where this extension never existed.)

The unpacked code is available at https://sourcegraph.com/sourcegraph/sourcegraph/-/tree/clien... if you want to poke around. And you can always check the Chrome network inspector to see the exact data structures.

Thanks! That clears it up.
I've tried this a few days ago (not sure if is the same version) and I liked it a lot, the problem is that when I click in a function or variable name it doesn't take me to the code where that function is defined on GitHub, but instead to a Sourcegraph page.

I imagine this is done on purpose, that you want people to use Sourcegraph and all its features, but I'm not familiar with Sourcegraph and do not want to use it now, thus I'm complaining like an ungrateful asshole.

This update is precisely what changes that. It took some hard work to get it to stay on GitHub and make that smooth, but it's ready now.
On the "Github as an IDE" topic, I would like to share my own extension that may act as a companion to this. It lets you click on module import statements (for Go, Python, Javascript and Ruby) and be taken to the imported module source or documentation: http://fiatjaf.alhur.es/gh-browser/