News

GitHub Code Search Now Generally Available, 'Way More than grep'

Following a two-year effort that involved an invite-only, 17-month technology preview, GitHub Code Search is now generally available.

"Our goal with the new code search and code view is to enable developers to quickly find critical information scattered across their codebase, put that information into context, and ultimately make them more productive," said Microsoft-owned GitHub in a May 8 announcement.

GitHub Code Search
[Click on image for larger view.] GitHub Code Search (source: GitHub).

GitHub detailed how the improved code search can help developers fix a bug, find a configuration and find a vulnerability, thanks to three new capabilities:

  • An entirely redesigned search interface with suggestions, completions and the ability to slice and dice the results.
  • A new code search engine rebuilt completely from scratch, making it about twice as fast as the old code search along with being far more capable (supporting substring queries, regular expressions and symbol search) and better at understanding code, being able to present the most relevant results first.
  • A totally redesigned GitHub code view that tightly integrates search, browsing and code navigation.

In inviting developers to take part in the technology preview in December 2021, the company listed highlights of the project in more detail, telling developers it can help them:

  • Easily find what you're looking for among the top results, with smart ranking and an index that is optimized for code.
  • Search for an exact string, with support for substring matches and special characters, or use regular expressions (enclosed in / separators).
  • Scope your searches with org: or repo: qualifiers, with auto-completion suggestions in the search box.
  • Refine your results using filters like language:, path:, extension: and Boolean operators (OR, NOT).
  • Search for definitions of a symbol with symbol:.
  • Get your bearings quickly with additional features, like a directory tree view, symbol information for the active scope, jump-to-definition, select-to-search, and more!

"One of the most fundamental tasks developers perform is reading and understanding code," GitHub said this week. "Whether planning and implementing a new feature, investigating a bug, or reviewing a pull request, developers typically spend more time reading and understanding code than writing it.

"That's why, in the past two years, we've laid out our plans to improve code search and shown off the technology that enabled us to do so."

That technology, according to a February post linked above, includes Rust, the programming language used to rebuild the company's own search engine (called Blackbird) specifically for the domain of code search. The effort also involved creating an improved search index, indexing 45 million repositories and enhancing query functionality.

GitHub Code Search
[Click on image for larger view.] GitHub Code Search (source: GitHub).

GitHub originally positioned the new code search effort in the context of a unified solution comprising broader initiatives around developer productivity. Those include products such as the GitHub Copilot "AI pair programmer" and Codespaces, which provides cloud-hosted developer environments.

In fact, this week's announcement mentions "a new era of code intelligence," noting that GitHub is infusing AI tech into every aspect of software development, with GitHub Copilot X leading the charge.

Much more information on GitHub Code Search can be found on a dedicated web site, which includes a video, FAQ and a link to try it out in a browser.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube