
Ask HN: What code search tools do you use? - hazbo
One feature I really like about GitHub, which is seldom talked about nearly as much as many of their other features, is the search. Often if I&#x27;m trying to find some &quot;real code&quot; as an example to help me with my own work, searching for function definitions on GitHub&#x27;s search has saved me so much time. Particularly when working with lesser known &#x2F; used libraries.<p>Are there any other tools out there that provide a way to search quickly, in the same way GitHub&#x27;s work, in which their emphasis <i>is</i> on search?<p>I&#x27;d add, that by search I mean cross-repo search. Not just on a single codebase.<p>EDIT: changed some words
======
pulkitsh1234
Sourcegraph ?
[https://about.sourcegraph.com/product](https://about.sourcegraph.com/product)

~~~
beliu
Sourcegraph co-founder here, thanks for the mention :)

Doing code search well is basically what Sourcegraph is all about. We support
full text and regex search over many repositories. Sourcegraph.com indexes
most repositories on GitHub.com and we also have a Docker container that you
can spin up to index code on private code hosts.

Our search is fast and our query syntax is powerful:
[https://docs.sourcegraph.com/user/search/queries](https://docs.sourcegraph.com/user/search/queries).

Most of our users are daily users and most of our customers deploy us across
their entire engineering organization to make all code accessible to all
developers (subject to permissions). We view search not as a single feature,
but a large collection of related, but distinct use cases:

* Honing in on error messages

* Debugging and resolving production issues faster

* Comparing different packages / libraries

* Figuring out how to use a particular API

* Understanding what a function does

* Detecting patterns and anti-patterns

* Enforcing code quality best practices (saved searches)

* Large-scale code changes (easy find-and-replace across your entire codebase)

* Walking the reference graph in code (i.e., jump-to-def and find-refs, and tooltips as you browse the code)

We were inspired by a lot of the great code search tools that companies like
Google and Facebook have built internally for themselves. We're also investing
in promulgating new pattern matching languages (e.g.,
[https://comby.dev/](https://comby.dev/)) that we think will yield huge
productivity gains for programmers who find regex has its shortcomings.

We will always be free to use for individual developers. Our code is open-
source. We make money off of enterprise. You can try us out on open source
([https://sourcegraph.com/github.com/sourcegraph/sourcegraph](https://sourcegraph.com/github.com/sourcegraph/sourcegraph))
or spin up your own free instance
([https://docs.sourcegraph.com/admin/install/docker](https://docs.sourcegraph.com/admin/install/docker)).
If you end up checking us out, would love to hear your feedback!

------
softwaredoug
I find the Github search super frustrating.

I often want an IDE-like search experience. GoTo definition, or other similar
browsing tools. Instead I have to think about the exact way to find a literal
definition "class Foo"

I realize that's ambitious - but it is Github after all!

