
A simple yet powerful VS Code extension that provides a one-click solution to toggle all console.log statements in the active editor between commented and uncommented states.
📺 Demo

Watch how Console.log Toggle Comment instantly toggles all console statements with a single click
Extension Info
| Property |
Value |
| Name |
Console.log Toggle Comment |
| Extension ID |
DotJumpDot.consolelog-toggle-comment |
| Description |
One-click solution to toggle all console.log statements in the active editor between commented and uncommented states |
| Version |
1.0.6 |
| Publisher |
DotJumpDot (JM) |
| Marketplace |
VS Marketplace |
Features
- One-Click Toggle: Instantly toggle all console statements with a single click
- Status Bar Icon: Convenient button in the bottom-left status bar for quick access
- Keyboard Shortcut: Default
Ctrl+Alt+L (Windows/Linux) or Cmd+Alt+L (Mac)
- Multiple Console Methods: Supports
console.log, console.error, console.warn, console.info, and console.debug
- Smart Detection: Only toggles actual console statements, preserving other code
- Custom Keybinding: Map your own keyboard shortcut via the command palette
- Visual Feedback: Shows count of toggled statements with active/commented breakdown
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Console.log Toggle Comment"
- Click "Install"
From Source
Clone this repository:
git clone https://github.com/DotJumpDot/Console.logToggleComment.git
cd Console.logToggleComment
Install dependencies:
npm install
Build the extension:
npm run compile
Package the extension:
vsce package
Install the generated .vsix file in VS Code
Usage
Using Status Bar
- Open any JavaScript or TypeScript file
- Click the Toggle Console button in the bottom-left status bar
- All console statements will be toggled between commented and uncommented states
Using Keyboard Shortcut
Press Ctrl+Alt+L (Windows/Linux) or Cmd+Alt+L (Mac) to toggle console statements.
Using Command Palette
- Press
Ctrl+Shift+P to open the Command Palette
- Type "Console.log Toggle Comment: Toggle Console Statements"
- Press Enter to execute
Custom Keybinding
- Press
Ctrl+Shift+P to open the Command Palette
- Type "Console.log Toggle Comment: Map Key"
- Press Enter to open the keybindings.json file
- Add your custom keybinding:
{
"key": "your-custom-keybinding",
"command": "consolelogToggle.toggle"
}
Examples
Before Toggle
function calculateSum(a, b) {
console.log("Calculating sum...");
const result = a + b;
console.log("Result:", result);
return result;
}
console.error("This is an error");
console.warn("This is a warning");
console.info("This is info");
console.debug("Debugging information");
After Toggle
function calculateSum(a, b) {
// console.log('Calculating sum...');
const result = a + b;
// console.log('Result:', result);
return result;
}
// console.error('This is an error');
// console.warn('This is a warning');
// console.info('This is info');
// console.debug('Debugging information');
Toggle Again to Restore
Click the status bar button or use the keyboard shortcut again to uncomment all console statements.
Supported Console Methods
console.log()
console.error()
console.warn()
console.info()
console.debug()
Configuration
No configuration is required. The extension works out of the box with the default settings.
Requirements
- VS Code version 1.80.0 or higher
- Node.js 18.0.0 or higher (for development)
Development
Prerequisites
Setup
Clone the repository
Install dependencies:
npm install
Run the extension in debug mode:
- Open the project in VS Code
- Press
F5 or go to Run > Start Debugging
- A new VS Code window will open with the extension loaded
Building
npm run compile
Testing
npm run test
Linting
npm run lint
Changelog
See CHANGELOG.md for a detailed history of changes.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add some amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
DotJumpDot - 2026
Support
If you encounter any issues or have questions, please open an issue on GitHub.
Acknowledgments