-
Notifications
You must be signed in to change notification settings - Fork 0
Fix subquery formatting under conditional directives #405
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
Co-authored-by: Copilot <[email protected]>
|
Merge after #404 |
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 subquery formatting under conditional directives by improving indentation calculation to properly consider parent-child relationships between conditional directives and subsequent blocks.
- Updates conditional directive handling to calculate proper indentation for blocks following directives
- Refactors keyword group block organization by moving option-related blocks to a dedicated package
- Adds comprehensive test coverage for various conditional directive scenarios
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| SqlElConditionLoopCommentBlock.kt | Core logic changes for conditional directive indentation calculation |
| SqlSubQueryGroupBlock.kt | Updates subquery indentation logic for conditional directive context |
| SqlBlockGenerator.kt | Adds support for new IN and WHERE group blocks |
| SqlInGroupBlock.kt | New block type for handling IN keyword formatting |
| SqlWhereGroupBlock.kt | New block type for WHERE clause formatting |
| Package refactoring files | Moves option keyword blocks to dedicated package structure |
| Test files | Comprehensive test data for conditional directive formatting scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Problem
When writing a subquery under a conditional directive, the indentation was less than expected. This was due to not properly considering the parent-child relationship of conditional directives.
Solution
This fix ensures that when a block immediately follows a conditional directive and is not the directive itself, the indentation calculation also takes into account the text length of the parent block of the conditional directive. This results in correct indentation for subqueries under conditional directives.