preamble
This article is mainly AI tool Copilot interpretation of the article, if there is any need to improve the place also please point out the big brother
catalogs
1. What is Copilot
Copilot (
https://copilot.github.com/) is an AI coding aid powered by Github that provides coding advice based on AI learning during the coding process. In many cases, Copilot can instance complete code with just comments or function names.
Copilot is not yet fully open and you need to apply for permission to open it. Visit its official website
https://copilot.github.com/To apply for the license, click the “Sign up” button. Once you have signed up, you can use Copilot on Github.
2. Idea Installation Copilot
Requirement: Idea version should be no less than 2021.2Otherwise, the Copilot plugin cannot be searched.
![AI Integration ChatGPT Knocking Code Magic Copilot AI Integration ChatGPT Knocking Code Magic Copilot](https://imgs.developpile.com/imgs/b8f1e4fb9f9c45ab80c14375e7ff05d6.png)
After restarting the
idea it is ready to use
3. Idea to use Copilot
After installing and rebooting, click tools->Copilot and log in to gitHub to get access to it.
![AI Integration ChatGPT Knocking Code Magic Copilot AI Integration ChatGPT Knocking Code Magic Copilot](https://imgs.developpile.com/imgs/2e294f22fb79419d89a617ffd5518d53.png)
strike (on the keyboard)
Cop and Open
![AI Integration ChatGPT Knocking Code Magic Copilot AI Integration ChatGPT Knocking Code Magic Copilot](https://imgs.developpile.com/imgs/6e75758d0b4541eb8aaf692cf2bd6220.png)
Copy the device code here for authorization
3.1 Code Completion
Copilot completes the entire line and automatically fills it with the parameter
![AI Integration ChatGPT Knocking Code Magic Copilot AI Integration ChatGPT Knocking Code Magic Copilot](https://imgs.developpile.com/imgs/6a9d3b4f09104924985892df3fdcf21f.png)
Copilot also automatically recognizes the workbook variable and its getSheetAt method as it appears in the above article, with no problems with syntax errors.
![AI Integration ChatGPT Knocking Code Magic Copilot AI Integration ChatGPT Knocking Code Magic Copilot](https://imgs.developpile.com/imgs/2ef06c357e5e4513b4b21fa27c9ba236.png)
Although the complementation worked better in the previous example and there were no problems with syntax errors, Copilot still generates code snippets with syntax errors in many cases. As shown in the figure below, the StringUtils class is created in the local project, and there is only one readTestFile method under the class, yet Copilot generates the print method because Copilot learns from hundreds of millions of open source code and can’t learn the code information of the local project in a timely manner, so essentially like TabNine it is There will be syntax error problems, just that the probability of error is smaller because the model is more powerful, but once the local engineering code is involved, the probability of error will be very high.
4. Shortcut Keys
Copilot also provides some shortcuts that can be easily used.
JetBrains IDE
Keyboard shortcuts for macOS
act |
shortcuts |
Acceptance of inreach recommendations |
Tab |
Rejection of inline recommendations |
Esc |
Show next inline suggestions |
Option (⌥) or Alt+] |
Show last inline suggestion |
Option (⌥) or Alt+[ |
Trigger inline recommendations |
Option (⌥)+\ |
Open GitHub Copilot (other suggestions in a separate pane) |
Option (⌥) or Alt+Return |
Keyboard Shortcuts for Windows
act |
shortcuts |
Acceptance of inreach recommendations |
Tab |
Rejection of inline recommendations |
Esc |
Show next inline suggestions |
Alt+] |
Show last inline suggestion |
Alt+[ |
Trigger inline recommendations |
Alt+\ |
Open GitHub Copilot (other suggestions in a separate pane) |
Alt+Enter |
Keyboard Shortcuts for Linux
act |
shortcuts |
Acceptance of inreach recommendations |
Tab |
Rejection of inline recommendations |
Esc |
Show next inline suggestions |
Alt+] |
Show last inline suggestion |
Alt+[ |
Trigger inline recommendations |
Alt+\ |
Open GitHub Copilot (other suggestions in a separate pane) |
Alt+Enter |
Visual Studio Code IDE
Keyboard shortcuts for macOS
act |
shortcuts |
command name |
Acceptance of inreach recommendations |
Tab |
MIT editor. Action.inlineSuggest.com |
Rejection of inline recommendations |
Esc |
editor.action.inlineSuggest.hide |
Show next inline suggestions |
Option (⌥)+] |
editor.action.inlineSuggest.showNext |
Show last inline suggestion |
Option (⌥)+[ |
editor.action.inlineSuggest.showPrevious |
Trigger inline recommendations |
Option (⌥)+\ |
Editor. Action. InlineSuggest. The trigger |
Open GitHub Copilot (other suggestions in a separate pane) |
Ctrl+Return |
github.copilot.generate |
Turning GitHub Copilot on/off |
No default shortcut |
github.copilot.toggleCopilot |
Keyboard Shortcuts for Windows
act |
shortcuts |
command name |
Acceptance of inreach recommendations |
Tab |
MIT editor. Action.inlineSuggest.com |
Rejection of inline recommendations |
Esc |
editor.action.inlineSuggest.hide |
Show next inline suggestions |
Alt+] |
editor.action.inlineSuggest.showNext |
Show last inline suggestion |
Alt+[ |
editor.action.inlineSuggest.showPrevious |
Trigger inline recommendations |
Alt+\ |
Editor. Action. InlineSuggest. The trigger |
Open GitHub Copilot (other suggestions in a separate pane) |
Ctrl+Enter |
github.copilot.generate |
Turning GitHub Copilot on/off |
No default shortcut |
github.copilot.toggleCopilot |
Keyboard Shortcuts for Linux
act |
shortcuts |
command name |
Acceptance of inreach recommendations |
Tab |
MIT editor. Action.inlineSuggest.com |
Rejection of inline recommendations |
Esc |
editor.action.inlineSuggest.hide |
Show next inline suggestions |
Alt+] |
editor.action.inlineSuggest.showNext |
Show last inline suggestion |
Alt+[ |
editor.action.inlineSuggest.showPrevious |
Trigger inline recommendations |
Alt+\ |
Editor. Action. InlineSuggest. The trigger |
Open GitHub Copilot (other suggestions in a separate pane) |
Ctrl+Enter |
github.copilot.generate |
Turning GitHub Copilot on/off |
No default shortcut |
github.copilot.toggleCopilot |
5. Other intelligent code completion tools
TabNine supports the widest variety of languages and IDEs, and has a high memory footprint in native mode;
AliCloud Cosy's code search function is more practical and can be used with other tools;
Kite is only for Python developers, and the complement is not really amazing;
Codota is no longer maintained and can be disregarded;
IntelliCode is not very practical and might be integrated with GitHub Copilot in the future;
AIXcoder is middling and lacks flair;