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

Identifiers in function calls with an object are now processed #693

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

Janther
Copy link
Contributor

@Janther Janther commented Jun 24, 2022

closes #680

Had to add Comments.sol to the list of tests that should not be formatted twice because of this:

// Original
purchaseData[0] = DomainPurchaseData({
  /* test */prices: _rootPrices,
  // test2
  subdomainMintingEnabled: /* test3 */_rootPrices.short > 0,
  allowSubdomainsToMint: true, // test4
  wasAllowedToSubdomainMintOnCreation: true
});

// 1st format
purchaseData[0] = DomainPurchaseData({
    /* test */
    prices: _rootPrices,
    // test2
    subdomainMintingEnabled: /* test3 */
    _rootPrices.short > 0,
    allowSubdomainsToMint: true, // test4
    wasAllowedToSubdomainMintOnCreation: true
});

// 2nd format
purchaseData[0] = DomainPurchaseData({
    /* test */
    prices: _rootPrices,
    // test2
    subdomainMintingEnabled: _rootPrices.short > 0, /* test3 */
    allowSubdomainsToMint: true, // test4
    wasAllowedToSubdomainMintOnCreation: true
});

As you see the second format places the comment /* test3 */ at the end of the whole line instead of between the identifier and the value.

It's something that will be reviewed but for now this is a great improvement.

@fvictorio We are no longer using the names attribute for this printer. Maybe it can be removed from the parser.

@Janther Janther requested a review from fvictorio June 24, 2022 09:23
@Janther Janther merged commit 1a77fe1 into main Jul 11, 2022
@Janther Janther deleted the comments-inside-object-argument branch July 11, 2022 02:57
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.

Error when formatting inline struct creation
1 participant