Try agent mode in VS Code!
Dismiss this update
GitHub Copilot can help improve your debugging workflow in Visual Studio Code. Copilot can assist with the setup of the debug configuration for your project and provide suggestions for fixing issues discovered during debugging. This article gives an overview of how to use Copilot for debugging applications in VS Code.
Copilot can help with the following debugging tasks:
copilot-debug
to start a debugging session from the terminal.If you don't yet have a Copilot subscription, you can use Copilot for free by signing up for the Copilot Free plan and get a monthly limit of completions and chat interactions.
VS Code uses the launch.json
file to store debug configuration. Copilot can help you create and customize this file to set up debugging for your project.
/startDebugging
command.Alternatively, you can use a natural language prompt like:
The copilot-debug
terminal command simplifies the process of configuring and starting a debugging session. Prefix the command you'd use for starting your application with copilot-debug
to have Copilot automatically configure and start a debugging session.
Open the integrated terminal (⌃` (Windows, Linux Ctrl+`)).
Enter copilot-debug
followed by your application's start command. For example:
copilot-debug node app.js
or
copilot-debug python manage.py
Copilot launches a debugging session for your application. You can now use the built-in debugging features in VS Code.
Learn more about debugging in VS Code.
You can use Copilot Chat to help you fix coding issues or improve your code.
Open your application code file.
Open one of these views:
Enter a prompt like:
Learn more about using Copilot Chat and Copilot Edits in VS Code.
To fix coding issues for your application code without writing a prompt, you can use the editor smart actions.
Open your application code file.
Select the code you want to fix.
Right-click and select Copilot > Fix.
Copilot provides a code suggestion to fix the code.
Optionally, refine the generated code by providing additional context in the chat prompt.