Debugging in VS Code

Harry · 13 Sep 2026 · 1 views

The Debug View

Click the bug icon or press Ctrl+Shift+D to open the Debug view. It hosts the run configuration list, breakpoint list, call stack and watch expressions.

Create a Configuration

VS Code needs a launch.json per runtime. The simplest node example:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "program": "app.js"
    }
  ]
}

The Add Configuration dropdown generates templates for Node, Python, Java, .NET and others.

Run and Control

Set breakpoints with a click in the gutter, press F5 to start, then use F10 (step over), F11 (step into), Shift+F11 (step out) and Shift+F5 (stop).

Data Inspection

Hover any variable, or add it to the Watch panel. The call stack plus local variables let you reason about state at each frame.

Logpoints and Conditional Breakpoints

Right-click a breakpoint for a conditional break: log a message (logpoint), only pause after 10 hits, or only when an expression is true.

Key Points

  • launch.json defines per-project debug setup.
  • F5/F10/F11 drive the session.
  • Watches and call stack reveal state.
  • Logpoints avoid restarting for prints.
Share this post:

Comments (0)

Please login or register to comment.