“Much more than grep” — Visual Studio Magazine


GitHub Previews Improved code search: “Much more than grep”

GitHub invites developers to participate in a Technology Preview of Enhanced Code Search, which it describes as “much more than grep,” the Linux command-line search utility.

The project has its own website and a temporary interface separate from GitHub.com, although functionality may be integrated later into IDEs and code editors, with GitHub asking developers which tools would make good candidates for integration.

One aspect of the project is improving the search syntax, which differs from the usual GitHub.com search syntax with the introduction of new operators for searching regular expressions and symbols.

GitHub code lookup
[Click on image for larger view.] GitHub code lookup (source: GitHub).

In these early stages, the project’s search index covers over 5 million popular public code repositories, including private repositories that a user has access to. The initial list of programming languages ​​in which symbol extraction is supported (more will be added) includes C#, Python, Go, Java, JavaScript, TypeScript, PHP, Protocol Buffers, Ruby, and Rust.

show code
[Click on image for larger view.] show code (source: GitHub).

Features highlighted by the Microsoft-owned development platform include:

  • Easily find what you’re looking for among the top results, with smart ranking and a code-optimized index.
  • Search for an exact string, with support for substring matches and special characters, or use regular expressions (included in / separators).
  • Expand your search with org: Where repo: qualifiers, with auto-completion suggestions in the search field.
  • Refine your results using filters such as language:, path:, extension: and Boolean operators (OR, NOT). Look up definitions of a symbol with symbol:.
  • Get your cues quickly with additional features, like a directory tree, symbol information for the active staff, jump to definition, selection for search, and more!

Access to the Technology Preview is limited and developers can request to be waitlisted here.

Going forward, GitHub plans to experiment with scoring and ranking heuristics to find the best approach, explore the most potentially impactful APIs and integrations, and add support for more languages ​​to language-specific features.

“For code search, our vision is to help every developer find, discover, navigate and understand code quickly and intuitively,” the company said. “GitHub Code Search puts the world’s code at your fingertips: everything is searchable. It helps you maintain a state of flux by showing you the most relevant results first and helping you with the auto-completion at every step.And once you’re on a results page, the rich navigation experience is optimized for reading and understanding code, allowing you to quickly make sense of unfamiliar logic, even for code in outside of your IDE.”

About the Author

David Ramel is an editor and writer for Converge360.

Comments are closed.