Skip to content

Add support for re-indenting block comments. #791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2024

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