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 for Converge360.

comments powered by Disqus

Featured

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube