AI-Assisted Coding¶
GitHub Copilot¶
We strongly recommend you to read the official documentation of GitHub Copilot and the VS Code tutorial here. There are detailed instructions and examples on how to use different functions of GitHub Copilot there. Here we just want to share some basic tips for using GitHub Copilot effectively.
What can AI Copilot do?¶
Below we list the commands you can use in the Copilot Chat. However, you do not need to remember them. You can always type /
in the chat to see the options (or even not type /explain
but just ask the AI to explain the code. I guess Github Copilot only optimized the correponding prompt when you use /
).
What really matters is that the list tells you what you can ask AI to help your coding.
Command | Description | Usage |
---|---|---|
/explain | Get code explanations | Open file with code or highlight code you want explained and type: /explain what is the fetchPrediction method? |
/fix | Receive a proposed fix for the problems in the selected code | Highlight problematic code and type: /fix propose a fix for the problems in fetchAirports route |
/tests | Generate unit tests for selected code | Open file with code or highlight code you want tests for and type: /tests |
/help | Get help on using Copilot Chat | Type: /help what can you do? |
/doc | Add a documentation comment | Highlight code and type: /doc. You can also press CMD+I in your editor and type /doc/ inline |
/generate | Generate code to answer your question | Type: /generate code that validates a phone number |
/optimize | Analyze and improve running time of the selected code | Highlight code and type: /optimize fetchPrediction method |
/simplify | Simplify the selected code | Highlight code and type: /simplify |
Other AI Copilot IDEs¶
Beside Github Copilot, there are many other AI coding tools out there, such as Cursor and Windsurf. All tools are evolving very fast and new features are added all the time. Try them out and see which one you like the most.