Comment by colin353
2 years ago
I'm Colin from GitHub's code search team, happy to answer any questions.
For more info on how we built this, you can check out our technical blog post from a few months ago https://github.blog/2023-02-06-the-technology-behind-githubs...
How does it compare to Sourcegraph? What is the main differentiator?
It would be really awesome if code search could one day consume LSIF for precise results in its index similar to source graph. The symbol search is good now, but approximate. Having more precise code search by allowing devs to upload LSIF data in their CI pipelines would allow for precise symbol search (go to definition / find usages actually being accurate) and remove irrelevant result.
Great point. Yes, we initially focused on zero-config approximate code navigation. But we do intend to support build-based code navigation in the future, since the approximate code navigation experience can be pretty poor for some languages (e.g. C/C++).
Great stuff, is there any update on searches which include code in branches? I often manually find interesting work done in development branches of cloned repos of the one I'm focused on but which never sees the light of day and not found in search. I imagine having the network also part of the search would be a good facet.
I don't see anything in https://docs.github.com/en/search-github/github-code-search/... :/
I've been using it for a few weeks, and it's a great improvement, congrats on the launch.
(Pleeeease make the right click context menu just be the normal default menu though, I (apparently) "Right-click > Back" a lot when using a mouse rather than a trackpad and I keep getting that goofy Emoji dialog.)
Are you planning to release code search as open source? I can’t find a link to the source code anywhere.
Loving the new Code Search! Might be super specific, but is there any syntax for searching attributes in HTML elements. For example if a React Component called <Button ...some-props color="red" /> what's the best way to find all the buttons that are red?
Hmm, you can construct a regular expression, something like:
Example:
https://github.com/search?q=lang%3Atsx+%2F%3CButton%5B%5E%5C...
You can do code blocks with 4 consecutive spaces. Backticks are not supported unfortunately
Ooh nice, this looks great! Thanks!!
I imagine a future in which this is integrated into vscode so I can go from an error message in the terminal to a search through my code + third-party modules that my code is importing
You can already do that by including your module folder (eg. node_modules, site-packages etc) in your project tree
Will this make it to GH enterprise eventually?
Yes, we're working on bringing it to GitHub enterprise right now.
Fantastic. Love the functionality on public GH and always find myself missing it at work.
Any plans to add support for Vue SFC syntax highlighting?
Edit: correction it looks like that's been fixed since last week, nm