This is the README for the "clang format comment" Visual Studio Code extension.
Features
This extension provides three commands to format C/C++ comments in your code:
Format Comment Selection: Formats the comments in the currently selected text.
Add Comment and Format Comment Selection: Adds a comment marker (//) to uncommented lines and formats the comments in the currently selected text.
Format Comment All: Formats all comments in the active editor.
The formatting follows these rules:
If the code before the comment is shorter than the formatColumn setting (default 100), the comment is padded with spaces or tabs to align with the specified column.
If the code before the comment is longer than the formatColumn setting, the comment is padded with a fixed number of spaces or tabs (10 spaces or 3 tabs).
Usage
You can trigger the commands using the following shortcuts:
alt+/: Format Comment Selection
alt+ctrl+/: Add Comment and Format Comment Selection
alt+shift+/: Format Comment All
Requirements
This extension requires Visual Studio Code version 1.88.0 or later.
Extension Settings
This extension contributes the following setting:
clangFormatComment.formatColumn: The column position for aligning comments (default: 100).
Known Issues
None currently known.
Release Notes
1.0.1
Added a new command: "Add Comment and Format Comment Selection"
1.0.0
Initial release of the "clang format comment" extension.
Format comments based on the formatColumn setting.
Support for formatting selected comments or all comments in the active editor.
Customizable keybindings for the formatting commands.