scalacenter / scala-syntax

Scalameta pretty printer for better Scalafix refactorings
Apache License 2.0
17 stars 6 forks source link

Use principled approach for wrapping parentheses #7

Closed olafurpg closed 6 years ago

olafurpg commented 6 years ago

So far we have taken an ad-hoc approach to guessing when parentheses are not sufficient. This does not scale, it's way more tricky than infix operators, it's nearly part of every relationship between a tree node and its children. Early results look very promising, and require minimal changes to the printer. Reasoning about missing parens bugs is a lot simpler now.