Skip to content

Instantly share code, notes, and snippets.

@Wilfred
Last active August 29, 2015 14:10
Show Gist options
  • Save Wilfred/5f7fb62bdaf535ea9f00 to your computer and use it in GitHub Desktop.
Save Wilfred/5f7fb62bdaf535ea9f00 to your computer and use it in GitHub Desktop.
Sourcegraph feedback

So, I've played with Sourcegraph, and I love the concept. I love the idea of being able to explore usage of functions and jumping to the original version.

I'm a Python programmer who likes Django, so I chose render_to_response as a function to try. It's a function I've used plenty and it's pure-python, so I assume it must be indexed.

https://sourcegraph.com/search?q=render_to_response shows the django-nonrel fork, but not the official django sources.

I visit https://sourcegraph.com/github.com/django-nonrel/django/.PipPackage/Django/.def/django/shortcuts/render_to_response to try to find some usage references. I click https://sourcegraph.com/github.com/django-nonrel/django/.PipPackage/Django/.def/django/shortcuts/render_to_response/.examples and it shows usage (handy!) but also imports (not interesting), such as the last example on this page, which is "django/django/contrib/admindocs/views.py:6-14" from "django-nonrel/django".

OK, let's try a numpy function. I search for 'allclose': https://sourcegraph.com/search?q=allclose I don't find it. I search for numpy instead: https://sourcegraph.com/search?q=numpy and find the repo: https://sourcegraph.com/github.com/numpy/numpy and just get a warning about C. Shame, but it's clear so I stop trying this.

Let's try a standard lib function. I search for 'collections.defaultdict' https://sourcegraph.com/search?q=collections.defaultdict and I think at first sourcegraph hasn't found it. I then spot cpython, but it's second from the bottom. I think your weighting could be improved.

I open the link https://sourcegraph.com/hg.python.org/cpython@default/.PipPackage/Python/.def/_collections/defaultdict in Firefox, and I'm looking at the top of _collectionsmodule.c. I'd rather it scrolled to the relevant part of the code. There are some examples on the right hand side, but two have errored "An error occurred while showing an example from stemming/stemming/lovins.py." and "An error occurred while showing an example from sphinx/sphinx/builders/gettext.py." and the others are just showing imports. Confusingly, if I open the same link in Chromium, I'm just shown a summary and some usage examples, not the original source.

Finally, let's try a node.js function. I search for 'http.createServer' https://sourcegraph.com/search?q=http.createServer and I get quite a lot of results. Some are JS, others are Python. Breaking this down by language would be really helpful here (compare with the language filter on a github search: https://github.com/search?utf8=%E2%9C%93&q=console&type=Repositories&ref=searchresults).

I pick a JS result that looks interesting: https://sourcegraph.com/github.com/tudouui/hrt@master/.CommonJSPackage/http-proxy/.def/commonjs/http-proxy/test/helpers/http.js/-/createServer Highlighting is applied to the whole function (nice!) and it scrolls to the right place. I click '> Authors', expecting it to expand (because there's a chevron). Instead, it takes me to https://sourcegraph.com/github.com/tudouui/hrt/.CommonJSPackage/http-proxy/.def/commonjs/http-proxy/test/helpers/http.js/-/createServer/.authors but it's really not very interesting -- only one author. Perhaps the link should show the number of authors?

Anyway, I love the project, the tech clearly works, and I think these are just little polish issues. I hope my feedback is useful to you.

Wilfred

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment