Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit e18d4c4

Browse files
fix indent of case expressions at the end of R2
1 parent 0b89864 commit e18d4c4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

settings/sql_developer/trivadis_custom_format.arbori

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,6 +3171,22 @@ r2_fix_indent_for_subquery_in_paren:
31713171
}
31723172
}
31733173

3174+
r2_fix_indent_for_case_expr:
3175+
([parent) case_expr | [parent) case_expression)
3176+
& [endcase) 'END'
3177+
& endcase^ = parent
3178+
-> {
3179+
var parent = tuple.get("parent");
3180+
if (getIndent(parent.from).indexOf("\n") == -1) {
3181+
var endcase = tuple.get("endcase");
3182+
var marginDiff = getColumn(parent.from) - getColumn(endcase.from);
3183+
if (marginDiff > 0) {
3184+
addIndent(parent, marginDiff);
3185+
logger.fine(struct.getClass(), "r2_fix_indent_for_case_expr: at " + parent.from + ".");
3186+
}
3187+
}
3188+
}
3189+
31743190
-- --------------------------------------------------------------------------------------------------------------------
31753191
-- R7: SQL keywords are right aligned within a SQL command.
31763192
-- --------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)