Skip to content

Commit

Permalink
Use regular indent for property accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Oct 2, 2023
1 parent a66d25d commit 7cbfac2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public J preVisit(@Nullable J tree, P p) {
} else if (tree instanceof J.Block && tree.getMarkers().findFirst(SingleExpressionBlock.class).isPresent()) {
getCursor().putMessage("indentType", wrappingStyle.getExpressionBodyFunctions().getUseContinuationIndent() ? IndentType.CONTINUATION_INDENT : IndentType.INDENT);
} else if (tree instanceof J.Block ||
tree instanceof K.Property ||
tree instanceof J.If ||
tree instanceof J.If.Else ||
tree instanceof J.ForLoop ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void extensionProperty() {
kotlin(
"""
val String.extension: Any
get() = ""
get() = ""
"""
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2168,4 +2168,18 @@ fun foo(
)
);
}

@Test
void propertyGetter() {
rewriteRun(
kotlin(
"""
class JavaLocation {
val bootClasspath: String
get() = ""
}
"""
)
);
}
}

0 comments on commit 7cbfac2

Please sign in to comment.