The Debug Adapter runs in a separate Node.js process, which is spawned by VS Code when you debug Go code.
Before you start working on your change, please read the contribution guidelines. This document assumes that you are already familiar with the process of building, running, and sideloading the VS Code Go extension.
As a next step, you may want to debug the Debug Adapter, in order to understand how your change work with Delve.
NOTE: Since the Debug Adapter runs in a separate process from the rest of the extension, the steps below only enable you to debug the Debug Adapter code, not the entire extension. To debug the entire extension, as well as the debug adapter, see the instructions below.
vscode-gofolder in VS Code.
Launch as serverdebug configuration.
"debugServer": 4711in the root of the configuration.
You should take this step if your change modifies both the Debug Adapter and the main extension. This setup requires three instances of VS Code.
vscode-gofolder in one instance of VS Code.
Launch Extensiondebug target and run it (F5). This will launch the second instance of VS Code.
"debugServer": 4711to the root of the configuration.
vscode-go/src/debugAdapterfolder in a third VS Code instance. Select the
Launch as serverconfiguration and run it (
F5). Debuggers from the other two VS Code windows are attached to the Debug Adapter and the Go extension, so you can set breakpoints, step through code, and inspect state as needed.
In some very rare cases, you may find it helpful to debug VS Code itself. An example of such a case might be veryfing workbench behavior and state before executing debug adapter API calls.
First, ensure that you can build and run VS Code from source successfully.
Next, follow these steps:
vscode-goextension to the local instance of VS Code. This can be done by copying the contents of the
$HOME/.vscode-oss-dev/extensions/ms-vscode.go(the exact location may vary by OS).
vscodefolder in Visual Studio Code.
Launch VS Codedebug configuraion from the drop-down in the Run view. Add breakpoints as needed.
vscode-gofolder. Choose the
Launch as serverdebug configuration in the Run view. Add breakpoints as desired in the