|GitHub Improves Code Search|
|Written by Kay Ewbank|
|Monday, 13 December 2021|
GitHub has announced a preview version of an improved way to search code on the platform. The GitHub team says the preview provides an early look at the next step in making GitHub easier to use, specifically helping developers explore and discover code, all while staying focused.
In more practical terms, the search facility is designed to make it easier for a developer to find what they’re looking for, with smart ranking and an index that is optimized for code.
Pavel Avgustinov of the GitHub team said in a blog post that at the moment, the technology preview is located in a separate website and has to be enabled for your account. The team says that once they’re happy with the feedback and are ready for wider adoption, they plan to integrate it into the main github.com experience.
The search index covers more than five million of the most popular public repositories, as well as your private repositories. The code search website says the new facility offers "Way more than grep", with the ability to search across multiple repositories, an index that is always up to date, and that it understands your code, and puts the most relevant results first.
The search facility lets you search for an exact string of code, with support for substring matches and special characters. You can also use regular expressions (enclosed in `/` separators).
If you want to limit the locations to search, you can add scope to your searches with `org:` or `repo:` qualifiers, and the search tool will provide auto-completion suggestions in the search box.
Along with the main search options, there's also a directory tree view, symbol information for the active scope, jump-to-definition, and select-to-search.
The announcement of the code search facility follows the release of Copilot and Codespaces, and according Avgustinov is another example of how GitHub continues to evolve to improve the developer experience.
or email your comment to: firstname.lastname@example.org