Debug Remote Environments Using Visual Studio Code
Microsoft's VS Code is the most popular IDE amongst software developers.
Using Raftt allows devs to continue working and debugging in their favorite IDE with their own setup and configuration while enjoying all the benefits of an environment running remotely.
Raftt currently supports debugging Python, Go and Node.js code. Join our Slack community or contact us to enquire about upcoming support for additional languages.
Installing the extension
To debug with Raftt, you must first install the Raftt extension. This could be done from VS Code Marketplace or from the IDE extension tab. Guidance on how to install and manage VS Code extensions can be found here.
Configuration
To configure VS Code to debug with Raftt you need to add the raftt
attribute to an existing launch configuration, i.e., the launch.json
file. The value of the raftt
key is a dict with a single key - workload
, whose value is the workload you want to debug (see example below).
Create multiple launch configuration in the launch.json
to debug different workloads with Raftt.
For example, here's a launch.json
that contains the configuration for debugging a workload called web
, written in Python and a workload called live-backend
written in Go.
{
"version": "0.2.0",
"configurations": [
{
"name": "web",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/app.py",
"console": "integratedTerminal",
"raftt": {
"workload": "web"
}
},
{
"name": "live-backend",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/live_backend/main.go",
"raftt": {
"workload": "live-backend"
}
}
]
}
If you don't have an existing launch configuration, here you'll find help on how to create one.
Debugging
Once the plugin is installed and configured, you can debug the workload just like you would if it ran locally, e.g., add breakpoints, view symbol, and more.