Skip to content

Add support for re-indenting block comments.#791

Merged
allevato merged 1 commit intoswiftlang:mainfrom
shawnhyam:support-block-comment-reindent
Aug 12, 2024
Merged

Add support for re-indenting block comments.#791
allevato merged 1 commit intoswiftlang:mainfrom
shawnhyam:support-block-comment-reindent

Conversation

@shawnhyam
Copy link
Contributor

Re-indent all lines of a block comment with the current indentation level. The comment must not have anything other than whitespace preceding it on the line, and all lines must have at least that level of whitespace (or be empty).

Re-indent all lines of a block comment with the current indentation
level. The comment must not have anything other than whitespace
preceding it on the line, and all lines must have at least that level
of whitespace (or be empty).
Copy link
Member

@allevato allevato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly my efforts to divert people away from using /* ... */ comments by not formatting them well have been in vein 😛

@allevato allevato merged commit 021a5ab into swiftlang:main Aug 12, 2024
@thomasvl
Copy link

thomasvl commented Sep 6, 2024

@shawnhyam - I think you might want to look at adding a test case with some blank lines in the multiline comments, i.e. –

        /* Comment

           Comment after blank */
        /*
           Comment

           Comment after blank
         */

It looks like this is inserting the leading whitespace on the blank lines rather than leaving the blank lines completely blank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants