-
Notifications
You must be signed in to change notification settings - Fork 0
Fix IN Clause Formatting #404
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
Fix IN Clause Formatting #404
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 fixes IN clause formatting issues by implementing dedicated handling for conditional directives in SQL formatting, ensuring that test data in IN clauses maintains proper formatting without unwanted line breaks.
- Introduced a dedicated
SqlInGroupBlockto explicitly handle IN clause formatting - Added a method to determine conditional directive positioning relative to parent blocks
- Updated parent-child relationship logic for conditional directives to ensure proper formatting control
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
SqlFormatterTest.kt |
Added new test methods for conditional clause formatting scenarios |
SqlBlockGenerator.kt |
Added generation logic for IN group blocks and WHERE group blocks |
NotQueryGroupHandler.kt |
Updated IN keyword detection and function/alias context handling |
SqlBlockRelationBuilder.kt |
Enhanced parent-child relationship handling for conditional directives |
SqlInGroupBlock.kt |
New dedicated block class for handling IN clause formatting |
SqlWhereGroupBlock.kt |
New WHERE group block implementation |
| Various test data files | Test cases demonstrating proper conditional directive formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
This PR fixes an issue where test data used inside an IN clause was unintentionally broken into multiple lines during SQL formatting.
Relation
#397
Details
Impact