-
Notifications
You must be signed in to change notification settings - Fork 0
Ignore multi unbalanced open/close pairs on the same line. #3
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR prevents the MultiLineItemFormatter from reformatting lines that contain multiple types of unbalanced opening brackets/braces on the same line (e.g., [m, { where both [ and { remain open).
Key changes:
- Added
isMultiUnbalancedOpenClosePairmethod to detect when both square brackets and curly braces have unbalanced opening counts on a single line - Integrated this check into the formatting condition chain to skip reformatting in such cases
- Added explicit
return falsestatement at the end ofisMatchingDoubleArrayOrArrayCurlymethod
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/formatters/MultiLineItemFormatter.ts | Added new method isMultiUnbalancedOpenClosePair to detect multiple unbalanced bracket/brace pairs on same line, integrated it into the formatting condition, and added explicit return statement to isMatchingDoubleArrayOrArrayCurly |
| src/formatters/MultiLineItemFormatter.spec.ts | Added test cases for the new functionality and pre-existing isMatchingDoubleArrayOrArrayCurly behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
95dddbb to
90f97ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.