Skip to content
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

fix(formatter): respect multi-line decl initial comment line #2965

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Jun 12, 2024

This PR fixes the handling of multi-line declaration values to preserve the original position of comments at the top level of declarations.

For example, given the unformatted code:

.a {
    prop:
            /*initial comment*/
        val1
                val2  
}

Before this PR, the comment would be moved to the declaration line:

.a {
    prop: /*initial comment*/
        val1
        val2  
}

After this PR, the comment remains on its own line:

.a {
    prop:
        /*initial comment*/
        val1
        val2  
}

@idoros idoros added bug Unexpected behavior or exception tooling CLI, stylable-scripts boilerplate labels Jun 12, 2024
@idoros idoros self-assigned this Jun 12, 2024
@idoros idoros requested a review from barak007 June 12, 2024 08:24
@idoros idoros force-pushed the ido/fix-formatter-preserve-decl-comments-newline branch from 10b621b to 72604d7 Compare June 12, 2024 09:11
@idoros idoros merged commit d0be0a1 into master Jun 17, 2024
12 checks passed
@idoros idoros deleted the ido/fix-formatter-preserve-decl-comments-newline branch June 17, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior or exception tooling CLI, stylable-scripts boilerplate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants