-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Describe the bug
When code formatting is executed on SQL injected via the @SQL annotation, the base indentation of the SQL ends up further to the right than expected.
Example (before formatting):
@Select
@Sql(
"""
SELECT *
FROM emp
WHERE id = /* employee.employeeId */0
""")
Employee selectInjection(Employee employee);After formatting (current behavior):
@Select
@Sql(
"""
SELECT *
FROM emp
WHERE id = /* employee.employeeId */0
""")
Employee selectInjection(Employee employee);
Problem
The SQL is indented too far, because the formatter is applying extra spaces beyond the expected base indentation.
Expected behavior
The SQL should be formatted with its base indentation calculated as:
- The current indent size, plus
- The indentation width of @SQL("""
- This ensures that injected SQL aligns correctly with the annotation’s starting point.
Screenshots
Desktop :
- IDEA Version 2024.3.6
- Doma Tools Version 2.1.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working