Skip to content

Commit f3166b6

Browse files
Merge pull request #95 from dynatrace-oss/feature/dpl/configuration-indent
[DPL] Fixing indent on the left side of the configuration expression
2 parents bf69e85 + 29dc6fc commit f3166b6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
### Bug fixes
3030

3131
- [#87] Avoiding outdated document modifications during injected fragments reformat action
32+
- DPL configuration expression will now be properly indented on the left side of the expression
3233

3334
## [1.3.0] - 2026-01-11
3435

src/main/java/pl/thedeem/intellij/dpl/style/DPLBlock.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,21 @@ private Indent getChildIndent(@NotNull ASTNode child) {
6868
if (parent instanceof DPLExpressionsSequence) {
6969
return Indent.getNoneIndent();
7070
}
71-
if (parent instanceof DPLGroupExpression || parent instanceof DPLConfigurationExpression) {
71+
if (parent instanceof DPLGroupExpression) {
7272
if (childType == DPLTypes.L_PAREN || childType == DPLTypes.R_PAREN) {
7373
return Indent.getNoneIndent();
7474
}
7575
return Indent.getNormalIndent();
7676
}
77+
if (parent instanceof DPLConfigurationExpression) {
78+
if (childType == DPLTypes.L_PAREN || childType == DPLTypes.R_PAREN) {
79+
return Indent.getNoneIndent();
80+
}
81+
if (child.getPsi() instanceof DPLConfigurationContent) {
82+
return Indent.getNormalIndent();
83+
}
84+
return Indent.getNoneIndent();
85+
}
7786
if (parent instanceof DPLCharacterGroupExpression) {
7887
if (childType == DPLTypes.L_BRACKET || childType == DPLTypes.R_BRACKET) {
7988
return Indent.getNoneIndent();

0 commit comments

Comments
 (0)