Ask HN: What code search tools do you use?
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'm trying to find some "real code" as an example to help me with my own work, searching for function definitions on GitHub's search has saved me so much time. Particularly when working with lesser known / used libraries.
Are there any other tools out there that provide a way to search quickly, in the same way GitHub's work, in which their emphasis is on search?
I'd add, that by search I mean cross-repo search. Not just on a single codebase.
EDIT: changed some words
3 comments
[ 2.7 ms ] story [ 11.4 ms ] threadDoing 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.
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/) 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) or spin up your own free instance (https://docs.sourcegraph.com/admin/install/docker). If you end up checking us out, would love to hear your feedback!
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!