Skip to content

Break parents after line comment - #1757

Open
Janther wants to merge 4 commits into
mainfrom
break-parents-after-line-comment
Open

Janther wants to merge 4 commits into
mainfrom
break-parents-after-line-comment

Conversation

@Janther

@Janther Janther commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Fixing a particular bug where a line comment in the middle of an empty list of parameters or arguments would trigger a wrong format.
As a bonus, I added the possibility to print a comment to an empty struct, which was throwing with a Comment not printed error.

// Original
function reserved(
    // parameters will be added later
) public {}

// prettier-plugin-solidity@2.4.1
function reserved(// parameters will be added later) public {}

// This PR
function reserved(
    // parameters will be added later
) public {}

I added the fixtures in the first commit so you can review the fixes by commit.

@Janther
Janther requested a review from fvictorio October 7, 2026 16:12
@Janther Janther added bug Something isn't working comments Comments-related issue format Addresses a change in the format labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working comments Comments-related issue format Addresses a change in the format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant