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
@Janther
Janther force-pushed the break-parents-after-line-comment branch 2 times, most recently from 7d5f480 to f502086 Compare October 16, 2026 11:24
@Janther
Janther force-pushed the break-parents-after-line-comment branch from f502086 to d6d60c6 Compare October 19, 2026 15:59
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