Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>line-commenterNew to Visual Studio Code? Get it now.
line-commenter

line-commenter

DeepStack

|
1 install
| (1) | Free
It comments specified lines in your code if you want like we do in production or local. !cheers Coders!
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Fixed Line Commenter

Toggle comments on fixed lines of code — configurable per project.

Getting Started

  1. Install the extension: You can install the extension from the Visual Studio Code Marketplace.
  2. Configure your lines:
    • Open the file where you want to configure fixed comments.
    • Right-click on a line you want to add to the toggle list and select Fixed Comment: Add Line from the context menu.
    • Alternatively, you can add lines to the uncomment-only list by selecting Fixed Uncomment: Add Line.
  3. Toggle comments:
    • Use the status bar button $(comment) Toggle Fixed to toggle the comments on the configured lines.
    • You can also use the keybinding Ctrl+Alt+C or run the command Fixed Comment: Toggle from the Command Palette.

Features

  • Configure Fixed Comment Lines: Specify which lines in a file should be commented or uncommented.
  • Toggle with a Single Command: Comment or uncomment all configured lines in the active file with a single command.
  • Interactive Commands: Add and remove lines from the configuration directly from the editor.
  • Status Bar Button: A convenient button in the status bar for quick access to the toggle command.
  • Workspace-level Configuration: All settings are stored in your workspace's .vscode/settings.json file, making it easy to share with your team.

Commands

Command Description
Fixed Comment: Toggle Toggles comments on all configured lines in the active file.
Fixed Comment: Add Line Adds the current line to the list of lines to be toggled.
Fixed Comment: Remove Line Removes the current line from the list of lines to be toggled.
Fixed Uncomment: Add Line Adds the current line to the list of lines that will be toggled.
Fixed Uncomment: Remove Line Removes the current line from the list of lines that will be toggled.
Fixed Comment: Clear All Clears all configured lines for the entire workspace.

Configuration

All the commands modify the workspace's .vscode/settings.json file for you. You can also edit this file manually.

{
  "fixedCommenter.lines": {
    "src/extension.ts": [10, 15, 20],
    "src/test/extension.test.ts": [5]
  },
  "fixedCommenter.uncommentLines": {
    "src/extension.ts": [25, 30]
  }
}
  • fixedCommenter.lines: An object where keys are file paths (relative to the workspace root) and values are arrays of line numbers to be toggled.
  • fixedCommenter.uncommentLines: An object where keys are file paths and values are arrays of line numbers to be toggled.

Keybindings

  • Ctrl+Alt+C: Toggle comments on all configured lines.

Contributing

Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue on the GitHub repository.

If you want to contribute to the code, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with a descriptive commit message.
  4. Push your changes to your fork.
  5. Open a pull request to the main repository.

License

This extension is licensed under the MIT License.

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