Analyzing code with Copilot
The recently introduced code analysis features in both PyCharm and VS Code complement GitHub Copilot’s code completion capabilities. It can be accessed via the Copilot menu or the inline chat window using commands such as /fix
/explain
and /test
To use these features, right-click on your code, select Copilot, and you will see the available options. This menu is accessible in both PyCharm and VS Code.
Here is how the menu appears in PyCharm:

Figure 3.17: Copilot code analysis in PyCharm
Here is how the menu appears in VS Code:

Figure 3.18: Copilot code analysis in VS Code
For quicker access, you can use Copilot inline chat commands. In VS Code, press Ctrl + I (cmd + I for Mac).

Figure 3.19: Copilot editor inline chat in VS Code
In PyCharm, press Ctrl + Shift + I (cmd + shift + I for older Mac versions of PyCharm).

Figure 3.20: Copilot inline chat in PyCharm
In the inline chat window, type...