Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>Comment Directive BreakpointsNew to Visual Studio Code? Get it now.
Comment Directive Breakpoints

Comment Directive Breakpoints

char8x

| (0) | Free
Generates VS Code breakpoints from comment directives in your code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info
English | 简体中文

Comment Directive Breakpoints

Download Download VSIX Version

Generate and manage VS Code breakpoints directly from your source code using comment directives.

Overview

Features & Usage

[!TIP] The built-in JavaScript Debug Terminal in VS Code is highly recommended and works perfectly with this extension. It allows you to debug your Node.js / frontend projects directly without any launch.json configuration!

1. Directive-Based Breakpoints

Set standard, conditional, hit-count breakpoints or logpoints using simple comments. Simply add a comment starting with // @bp (or the appropriate comment style for your language) followed by an optional directive.

Basic Breakpoint

Set a standard breakpoint at the associated line of code.

// @bp
const value = calculate();

Basic Breakpoint

Logpoints (@bp.log)

Log a message to the debug console when the breakpoint is hit. Use {} for expression interpolation.

// @bp.log {user.id} with {Math.random()}
login(user);

Logpoint

Conditional Breakpoints (@bp.expr)

Break execution only when the expression evaluates to true.

for (let i = 0; i < 5; i++) {
  // @bp.expr i > 3
  console.log('index:', i);
}

Conditional Breakpoint

Hit Count Breakpoints (@bp.hit)

Break execution when the hit count condition is met (e.g., > 5, == 10).

for (let i = 0; i < 5; i++) {
  // @bp.hit > 2
  console.log('index:', i);
}

Hit Count Breakpoint

Disabled Breakpoints (.disable)

Add .disable to any directive to create a breakpoint that is initially disabled.

// @bp.disable
// @bp.hit.disable 5
// @bp.log.disable value: {v}

Disabled Breakpoint

2. Real-time Update

Automatically updates breakpoints when you save your file.

When settings.json is configured as follows, the extension completely takes over the generation and removal of breakpoints in the current file.

{
  "comment-directive-breakpoints.general.generateOnSave": true,
  "comment-directive-breakpoints.general.breakpointManagementMode": "replace"
}

Real-time Update

3. Smart Autocompletion

Get context-aware code suggestions for your expressions while writing @bp.log or @bp.expr directives.

Smart Autocompletion

4. Workspace & Open File Scanning

Automatically find and generate breakpoints across your entire workspace or just within your currently opened files.

Scan Workspace

Command: Comment Directive Breakpoints: Generate for Workspace Scans the entire workspace for directives and generates breakpoints.

Workspace Scan

Scan Opened Files

Command: Comment Directive Breakpoints: Generate for Opened Files Scans only the files currently open in your editor.

Opened Files Scan

Configuration

You can configure the extension in your settings.json:

{
  "comment-directive-breakpoints.general.generateOnSave": true,
  "comment-directive-breakpoints.general.supportedLanguages": [
    "javascript",
    "typescript",
    "javascriptreact",
    "typescriptreact",
    "python",
    "go",
    "ruby",
    "java",
    "rust"
  ],
  "comment-directive-breakpoints.general.breakpointManagementMode": "append",
  "comment-directive-breakpoints.ripgrep.path": ""
}

Supported Languages

The extension currently only supports languages with built-in Tree-Sitter WASM parsers. Other languages are not yet supported.

Currently supported:

  • JavaScript / TypeScript / JSX / TSX
  • Python
  • Go
  • Rust
  • Java
  • Ruby

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft