-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
For example, if you have an if-then-else expression with a cast and a less-than operation, you might write
return if (foo :: number) < bar
then very + very + very + long + line + right + here + hopefully
else lets + ensure + stylua + writes + this + out + using + multiple + linesWhen the line is long enough for StyLua 2.0.2 with syntax = "Luau" specified in the config to prefer formatting it in this way, with then and else on their own lines, it also chooses to discard the parentheses around the cast expression, leaving
return if foo :: number < bar
then very + very + very + long + line + right + here + hopefully
else lets + ensure + stylua + writes + this + out + using + multiple + linesThis is a syntax error because the parser thinks bar is now a type parameter for number, thanks to < after number, but never finds a closing >.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working