# Follow and star Tencent Cloud developers
# Weekly 4 | Goose factory front-line programmers, "test poison" new technologies for you
# Issue 3 | Tencent Mengjian: Evaluation of the new feature experience of VSCode Copilot Chat
GitHub Copilot has only been released for two years, and has helped more than one million developers create more than 46% of the code volume, and has increased the coding speed by up to 55%.
Recently, VScode released version 1.80. This heavy update directly introduces a new feature of GitHub Copilot - Copilot ChatAI chat assistant is coming!
Is it chicken ribs or productivity?
Before the answer is revealed, if you want to experience the latest version and download the VSCode plugin, you can visit: https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
After installation, you will find that there is an additional chat entry in the sidebar, which can be used after linking to the Github account (the account needs to be passed through the waitlist):
Copilot Chat mainly provides an interactive interface.
As we can see in the help documentation, it supports the following capabilities:
▶︎ Explain what a single line of code, an entire file, or a library API does.
▶︎ Find problems and even fix them.
▶︎ Rewrite code to make it more readable or faster.
▶︎ Write new tests and components.
▶︎ Ask questions about VS Code.
▶︎ Ask general programming questions.
▶︎ ……
And of course commands starting with / :
▶︎ /tests - generate unit tests for selected code
▶︎ /fix - Suggest fixes for selected code issues
▶︎ /explain - explains how the selected code works
▶︎ /ext - Questions about VS Code extension development
▶︎ /vscode - Questions about VS Code
▶︎ /help - General help about GitHub Copilot
▶︎ /createWorkspace - Create a project
Just like GPT, we can directly ask questions about parts of the code that we do not understand. After selecting the text, enter the /explain command and add the content we want to ask. (Here, English is returned by default. If you ask questions in Chinese, you can also get Chinese answers).
Here we chose a very complex regularization for testing. We can see that the model understanding is still very good, and it can be explained very carefully. We can also ask questions about the scene and let AI act as your teacher.
In this test, I deliberately changed a variable by mistake (but the syntax is guaranteed to be normal, just a logical error), Copilot can directly find the problem of this change, and give the corrected code. Please look at the picture.
For such independent small functions, Copilot's error correction ability is still good.
You can ask Copilot to help generate test cases for the function, and then run to verify the accuracy of the test cases.
In this case, Copilot helped generate a total of 6 use cases, 5 of which passed and 1 failed. After a closer look, there are some problems with the expected output of this use case. It can be seen that there are still some problems with the accuracy of the use cases generated by the model.
However, from the perspective of completeness, the test cases generated by Copilot still give us a lot of inspiration, which is a great reference and efficiency improvement in writing test cases.
Of course, we can also use Copilot to complete code refactoring, write a new component and other tasks. I believe that you can use Copilot to try out the exploration scenarios that you may also use in your daily life, so we won't repeat them here.
Version 1.8 introduces an interesting little feature that supports the /createWorkspace command, which can help us quickly create a new project:
But when I actually ran it, I found that there were still many problems:
It can be seen that the vue-cli-service used by the project generated by Copilot is outdated, and some babel and webpack configurations are missing. This part should still be limited by the current AI training corpus time. Generally speaking, it is easy to get out of track with the latest current data. This function may require networking capabilities to be better used.
It is worth noting that this plugin still has a lot of room for improvement. Such as the boundary of the model - fantasy problem.
It can be seen that when some difficult questions are asked, Copilot will imagine some non-existent APIs to try to answer. This kind of situation will also happen in GPT, which is also a limitation of the current large model, and some fabrications and fantasies that are not based on facts will be made. In the process of using AI, we need to carefully discern its correctness.
Although there are limitations, in general I think Copilot Chat is still a very useful tool. We have been able to see ta assisting us in many scenarios, such as the two scenarios I personally use:
▶︎ Code understanding : AI is often sought to help understand complex code logic, especially when reading source code.
▶︎ Code completion : It is very helpful to improve efficiency when writing code. You can also perform pair programming with Copilot when writing code to improve your code quality.
I believe that with the continuous update and improvement of the model, Copilot Chat will become more and more useful, and I look forward to embracing the new era of programming in the future.
If you can complete the development by "moving your mouth", what kind of project do you want to do most? Welcome to leave a message. We will select one of the most creative answers, and send Tencent customized programmer cultural shirts to those who leave a message. The draw will be held at 12:00 noon on August 14th.
Follow and star Tencent Cloud Developers
Watch Goose Factory Programmers evaluate new technologies every 4 weeks