Skip to content

Incorrect Line Break Formatting in Subgroups Within Conditional Directives #397

@xterao

Description

@xterao

Describe the bug
In SQL that uses Doma conditional directives, there are specific cases where subgroups under a conditional directive are incorrectly line-broken.

The subgroup following the IN clause is being incorrectly recognized as a different block class.
As a result, it inherits the formatting rules of the parent conditional directive and is line-broken unnecessarily.

Example

SELECT *
  FROM employee
 WHERE id = 1 
   AND
       /*%if !employee.isSet() */ 
       members IN /* employee.memberIds*/ 
      ('1', '2') -- This should not break into a new line
       /*%end */

Expected behavior
The subgroup following the IN clause should not break into a new line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions