In the process of software development, reading and understanding code is a basic task. Whether implementing new features or finding bugs, developers first need to read and understand the code, which takes even more time than writing it. If you can quickly find the contextual code needed for development like a search engine, then the efficiency of software development will be greatly improved.
As the world's largest source code hosting service platform, GitHub released a preview version of the code search engine Code Search in 2021. Afterwards, GitHub made a series of optimization modifications to Code Search, and in Technical details were announced in February this year.
Now, GitHub announces that all users will have access to a new code search engine and code view, designed to allow developers to quickly search, navigate and understand code, ultimately improving work efficiency.
Specifically, GitHub has launched a completely redesigned search interface. The new interface not only provides suggestions and completions, but also intelligently categorizes search results.
This is based on GitHub's new code search engine built from the ground up, which features faster speeds (approx. twice as fast as old code), more powerful (supports substring queries, regular expression searches, and symbol searches), and has the code understanding to put the most relevant results first.
In addition, the R&D team also redesigned GitHub’s code view to tightly integrate search, browsing, and code navigation.
Let’s take a look at the application effect of GitHub after the improvement.
Fixing bugs
Fixing bugs is one of the most common work situations encountered in software development. Before fixing it, developers first need to find where the bug is. A large software or project often has multiple systems or repositories, and without code search, developers would have to clone a bunch of repositories and grep through them. Now with GitHub's code search function, developers can quickly find in a large amount of code:
Find the configuration file
In actual development , project configuration is often a hard restriction. GitHub now offers developers the ability to find configuration files. For example, by searching for YAML configuration files containing the word "memory" in the code, you can view some memory usage:
This query function is crucial for resource planning and allocation in development.
In addition, GitHub has also established some rules to avoid security vulnerabilities, such as prohibiting the use of dangerouslySetInnerHTML to inject dangerous strings into the DOM.
After GitHub’s new code search was officially launched, some netizens praised its functions, saying that this is the most impressive product in the past five years, so good that it is comparable to ChatGPT. .
Others say that GitHub’s code search feature is much more useful than Copilot or any large language model (LLM).
But some netizens said that the previous GitHub search effect was very poor, and they were more accustomed to using git -grep.
It seems that the new GitHub code search needs developers to try it themselves to know whether it works well or not.
The above is the detailed content of Officially launched, GitHub opens new code search engine to all users. For more information, please follow other related articles on the PHP Chinese website!