You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Formatting a single member expression with trailing comments fails
Details
When formatting code that contains member expressions with trailing CommentLine comments, if we have a single member expression, then the member expression is pulled into the previous line thus producing invalid lua (and commenting out the member expression).
Steps to reproduce
Unformatted code
localfoo=bar-- comment after bar
.fizz-- comment after fizz
Formatted code ❌
localfoo=bar-- comment after bar.fizz -- comment after fizz
Expected output
localfoo=bar-- comment after bar
.fizz-- comment after fizz
Bonus
Code that works
When we have multiple member expressions, then the comment positions are preserved
Input code
localfoo=bar-- comment after bar
.fizz-- comment after fizz
.buzz
Formatted code ✅
localfoo=bar-- comment after bar
.fizz-- comment after fizz
.buzz
The text was updated successfully, but these errors were encountered:
Summary
0.14.1
.Details
When formatting code that contains member expressions with trailing
CommentLine
comments, if we have a single member expression, then the member expression is pulled into the previous line thus producing invalid lua (and commenting out the member expression).Steps to reproduce
Unformatted code
Formatted code ❌
Expected output
Bonus
Code that works
When we have multiple member expressions, then the comment positions are preserved
Input code
Formatted code ✅
The text was updated successfully, but these errors were encountered: