Easily add or remove the debugger; statement in your JavaScript (js) / Typescript (ts) files with a simple shortcut.
You can install this extension directly from the Visual Studio Code Marketplace:
- Open the Extensions view in VS Code (
Ctrl+Shift+X). - Search for
vscode-debuggerorstephanebouget.vscode-debugger. - Click Install.
- Or, visit the marketplace page and click Install.
- Toggle behavior: The shortcut adds or removes
debugger;on the selected line. - If the line already contains code,
debugger;is inserted on a new line before the existing code. - Adds
debugger;to the selected line with the shortcut. - Default shortcut: Ctrl+Alt+D (customizable in VS Code keybindings:
Ctrl+K Ctrl+S).
- Place your cursor on the line you want to toggle the
debugger;statement. - Press Ctrl+Alt+D (or your custom shortcut).
- The extension will add or remove
debugger;as needed:- If the line is empty,
debugger;is added directly. - If the line contains code,
debugger;is inserted on a new line above. - If
debugger;is already present, it will be removed.
- If the line is empty,
vscode-debugger is under the MIT license. See the LICENSE file for details.