align_multiline_comment: add option to control indentation of closing */
#8158
FeBe95
started this conversation in
Feature ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue
When using
align_multiline_commentwithcomment_typeset toall_multiline, some comments look odd after executing the fix command. The fixer does not distinguish between different "types" of multi-line comments.Example 1:
A classic multi-line comment with leading asterisks in each line: Fixed code looks good to me, all asterisks are horizontally aligned. This is what the fixer was probably designed for.
Example 2:
Multi-line comment that surrounds unused lines of code: Another use case for multi-line comments is skipping parts of code by putting a
/*before the first line and a*/after the last line of code. After running the fix command, the closing tag (*/) is indented with one additional whitespace.Example 3:
Multi-line comment that acts as a section description. This type of comment is often used in configuration files. Each line starts with the same character (vertical bar in this case). Again, the closing tag (
*/) gets indented with one additional whitespace.(config file example: laravel/config/app.php at 11.x · laravel/laravel)
Suggestion
Add option to enhance multi-line comment indentation for different comment types. Currently the fixer indents the closing tag by an additional whitespace to horizontally align the asterisks. With this enhancement, the fixer would distinguish between different "types" of multi-line comments and fix the syntax accordingly.
The logic could be as simple as:
Examples
Beta Was this translation helpful? Give feedback.
All reactions