Open karlhorky opened 9 months ago
FYI: Currently there exists some very basic support for unnecessary parentheses removal, which covers cases like these:
-- removal of repeated parenthesis
a + ((b + c)) --> a + (b + c)
-- removal of parenthesis around function parameters
my_func(a, (b), ((c + d))) --> my_func(a, b, c + d)
Copied from original
sql-formatter
issue: https://github.com/sql-formatter-org/sql-formatter/issues/684Describe the Feature
New default behavior in
prettier-plugin-sql-cst
to remove unnecessary parentheses in SQL (maybe with a way to disable):Why do you want this feature?
Removing extra unnecessary parentheses can make code simpler and less nested
Prior art
Prettier does this:
Other projects also have had similar requests / implementation:
Keywords for Search
Operator precedence, operators, parenthesis