Skip to content

Misaligned Indentation When Using Subqueries in Conditions #402

@xterao

Description

@xterao

When a subquery is used within a conditional expression, the indentation for SELECT, FROM, and WHERE statements becomes misaligned.

Example:

AND e.department_id NOT IN ( SELECT d2.id
                                 FROM departments d2
                                WHERE d2.name IN /* excludeDepartments */('HR', 'Finance')
                                   /*%if onlyActiveDepartments */
                                   AND d2.is_active = true
                                   /*%end*/ ) AS d

Problem
The SELECT, FROM, and WHERE keywords inside the subquery are not aligned consistently. This results in a visually uneven format that reduces readability.

Expected Behavior
The subquery should follow consistent indentation rules, aligning SELECT, FROM, WHERE, and conditional directives properly under the subquery’s opening parenthesis.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions