Skip to content

Debug Apex in VS Code With Breakpoints

Guided help

Set a normal Apex gutter breakpoint and debug a local test through Glade DAP.

  • Set a breakpoint in a path the selected test executes.
  • Start `Debug Local Test`.
  • Open Run and Debug while the session is active.

Before you start

  • The Glade VS Code extension is installed in a clean VS Code profile.
  • No unrelated VS Code extensions are installed in the capture profile.
  • A local data environment is selected.

Steps

1. Set a breakpoint

Open an Apex class or test file. Click the editor gutter beside the line you want to stop on.

VS Code showing an Apex gutter breakpoint

2. Start the local debug session

Click Debug Local Test from CodeLens or use the Glade Debug view action.

Expected: VS Code opens a normal debug toolbar and Glade starts a DAP session.

VS Code showing the Glade debug toolbar

3. Inspect the debug panes and output

Use Step Over, Variables, Watch, and Call Stack first. Open Debug Console or the Glade output channel only when you need logs.

VS Code showing Run and Debug during local Apex debug

Common wrong turn

If debugging starts but does not stop, check that the breakpoint is in a supported .cls or .trigger file and that the test path executes that line.

Next

Glade is local-first Apex tooling.