This is a Visual Studio Code extension that aligns comment indentation.
Demo
Features ✨
Two alignment options for comments:
Left alignment (minimum indentation)
Right alignment (maximum indentation)
Supports multiple programming languages:
TypeScript/JavaScript
Python
Java
C/C++
C#
PHP
Ruby
Go
Rust
Swift
SQL
Gradle (Kotlin DSL)
Usage 💡
Select the code block containing comments you want to format
Right-click and select either:
"Align Comments Left" for minimum indentation
"Align Comments Right" for maximum indentation
Comments will be aligned according to your choice
⚠️ Note:To properly align comments, be sure to select the entire code block from the first to the last character.
Partial selections may lead to unexpected formatting results.
Example
Before:
function example() {
// This is a comment
// Another comment
// One more comment
}
After (Left alignment):
function example() {
// This is a comment
// Another comment
// One more comment
}
After (Right alignment):
function example() {
// This is a comment
// Another comment
// One more comment
}
Change Log 📝
You can checkout all our changes in our CHANGELOG.