GitHub preview improved code search
GitHub unveiled a tech preview of enhanced code search capabilities on its popular code-sharing site, along with “fine-grained” code navigation for Python.
Among the improvements, a new code search engine built into Rust, geared towards code search and speed. In the tech preview, the search index covers over five million of the most popular public repositories. Searches can also be performed on private repositories if a user has access to them.
Technology preview features include:
- “Smart” rankings and an index optimized for the code.
- Search for an exact string, with support for substring matches and special characters.
- Scope of research with
repo:codequalifiers, with autocomplete suggestions in the search box.
- Refine the results using filters such as language: code and path: code.
- Quickly get benchmarks with additional features, like a directory tree.
Search syntax can be found on GitHub.
Interested developers can register on the waiting list and provide an answer. Once the technology preview is activated, developers can try it on GitHub. Initially, a separate interface will be provided for the new search as it is built. Once GitHub is happy with the feedback and the technology is ready for wider adoption, GitHub will integrate it into the main GitHub.com experience.
Precise code navigation for Python is enhanced by a new stack graphics frame. Stack charts are used to encode detailed information about Python name binding rules. This allows you to determine which specific definition each reference refers to, without any additional configuration required for the repositories.
Until now code navigation on GitHub was “fuzzy” or based on research; clicking on a reference would display all the definitions in a repository with that name. This could cause a lot of noise when displaying definitions and references with a common name. For now, code navigation for other supported languages ââwill remain unclear. Support for stack graphics for other languages ââwill be added in the coming months.
GitHub made the new code navigation features available in the “changed files” tab of each checkout request. Previously, these were only available when viewing files in GitHub’s code browser. By clicking on a baseline or definition, the developer accesses the code browser of the main branch of the checkout request, giving developers a better idea of ââthe impact of the changes.
GitHub’s latest changes follow code review checks introduced last month. Limits have been put in place to deal with drive-by pull requests and unwanted change requests.
Copyright Â© 2021 IDG Communications, Inc.