@@ -135,7 +135,7 @@ import org.jetbrains.kotlin.psi.stubs.impl.KotlinPlaceHolderStubImpl
135135/* * An AST visitor that builds a stream of {@link Op}s to format. */
136136class KotlinInputAstVisitor (
137137 private val options : FormattingOptions ,
138- private val builder : OpsBuilder
138+ private val builder : OpsBuilder ,
139139) : KtTreeVisitorVoid() {
140140
141141 /* * Standard indentation for a block */
@@ -451,7 +451,8 @@ class KotlinInputAstVisitor(
451451 typeConstraintList = property.typeConstraintList,
452452 delegate = property.delegate,
453453 initializer = property.initializer,
454- accessors = property.accessors)
454+ accessors = property.accessors,
455+ )
455456 }
456457 builder.guessToken(" ;" )
457458 if (property.parent !is KtWhenExpression ) {
@@ -644,7 +645,7 @@ class KotlinInputAstVisitor(
644645 */
645646 private fun computeGroupingInfo (
646647 parts : List <KtExpression >,
647- useBlockLikeLambdaStyle : Boolean
648+ useBlockLikeLambdaStyle : Boolean ,
648649 ): List <GroupingInfo > {
649650 val groupingInfos = List (parts.size) { GroupingInfo () }
650651 var lastIndexToOpen = 0
@@ -690,7 +691,7 @@ class KotlinInputAstVisitor(
690691 part : KtExpression ,
691692 index : Int ,
692693 previous : KtExpression ,
693- current : KtExpression
694+ current : KtExpression ,
694695 ): Boolean {
695696 // this is the second, and the first is short, avoid `.` "hanging in air"
696697 if (index == 1 && previous.text.length < options.continuationIndent) {
@@ -1280,7 +1281,7 @@ class KotlinInputAstVisitor(
12801281
12811282 internal enum class DeclarationKind {
12821283 FIELD ,
1283- PARAMETER
1284+ PARAMETER ,
12841285 }
12851286
12861287 /* *
@@ -1302,7 +1303,7 @@ class KotlinInputAstVisitor(
13021303 typeConstraintList : KtTypeConstraintList ? = null,
13031304 initializer : KtExpression ? ,
13041305 delegate : KtPropertyDelegate ? = null,
1305- accessors : List <KtPropertyAccessor >? = null
1306+ accessors : List <KtPropertyAccessor >? = null,
13061307 ): Int {
13071308 val verticalAnnotationBreak = genSym()
13081309
@@ -1821,7 +1822,7 @@ class KotlinInputAstVisitor(
18211822 /* * For example, 'field' in @field:[Inject Named("WEB_VIEW")] */
18221823 override fun visitAnnotationUseSiteTarget (
18231824 annotationTarget : KtAnnotationUseSiteTarget ,
1824- data : Void ?
1825+ data : Void ? ,
18251826 ): Void ? {
18261827 builder.token(annotationTarget.getAnnotationUseSiteTarget().renderName)
18271828 return null
@@ -1842,12 +1843,13 @@ class KotlinInputAstVisitor(
18421843 annotationEntry.calleeExpression,
18431844 null , // Type-arguments are included in the annotation's callee expression.
18441845 annotationEntry.valueArgumentList,
1845- listOf ())
1846+ listOf (),
1847+ )
18461848 }
18471849
18481850 override fun visitFileAnnotationList (
18491851 fileAnnotationList : KtFileAnnotationList ,
1850- data : Void ?
1852+ data : Void ? ,
18511853 ): Void ? {
18521854 for (child in fileAnnotationList.node.children()) {
18531855 if (child is PsiElement ) {
@@ -1912,7 +1914,10 @@ class KotlinInputAstVisitor(
19121914 whenEntry.guard?.let { guard ->
19131915 builder.space()
19141916 emitKeywordWithCondition(
1915- " if" , guard.getExpression(), surroundConditionWithParens = false )
1917+ " if" ,
1918+ guard.getExpression(),
1919+ surroundConditionWithParens = false ,
1920+ )
19161921 }
19171922 }
19181923 }
@@ -2075,7 +2080,10 @@ class KotlinInputAstVisitor(
20752080 builder.breakOp(Doc .FillMode .UNIFIED , " " , expressionBreakIndent)
20762081 builder.block(expressionBreakIndent) {
20772082 visitEachCommaSeparated(
2078- expression.indexExpressions, expression.trailingComma != null , wrapInBlock = true )
2083+ expression.indexExpressions,
2084+ expression.trailingComma != null ,
2085+ wrapInBlock = true ,
2086+ )
20792087 }
20802088 }
20812089 builder.token(" ]" )
@@ -2095,7 +2103,10 @@ class KotlinInputAstVisitor(
20952103 builder.breakOp(Doc .FillMode .UNIFIED , " " , expressionBreakIndent)
20962104 builder.block(expressionBreakIndent) {
20972105 visitEachCommaSeparated(
2098- destructuringDeclaration.entries, hasTrailingComma, wrapInBlock = true )
2106+ destructuringDeclaration.entries,
2107+ hasTrailingComma,
2108+ wrapInBlock = true ,
2109+ )
20992110 }
21002111 }
21012112 builder.token(" )" )
@@ -2273,7 +2284,8 @@ class KotlinInputAstVisitor(
22732284 valOrVarKeyword = parameter.valOrVarKeyword?.text,
22742285 name = parameter.nameIdentifier?.text,
22752286 type = typeReference,
2276- initializer = parameter.defaultValue)
2287+ initializer = parameter.defaultValue,
2288+ )
22772289 }
22782290 }
22792291 }
@@ -2306,7 +2318,8 @@ class KotlinInputAstVisitor(
23062318 receiverExpression.calleeExpression,
23072319 receiverExpression.typeArgumentList,
23082320 receiverExpression.valueArgumentList,
2309- receiverExpression.lambdaArguments)
2321+ receiverExpression.lambdaArguments,
2322+ )
23102323 } else {
23112324 visit(receiverExpression)
23122325 }
@@ -2392,7 +2405,8 @@ class KotlinInputAstVisitor(
23922405 expression.trailingComma != null ,
23932406 prefix = " [" ,
23942407 postfix = " ]" ,
2395- wrapInBlock = ! options.manageTrailingCommas)
2408+ wrapInBlock = ! options.manageTrailingCommas,
2409+ )
23962410 }
23972411 }
23982412
@@ -2575,7 +2589,8 @@ class KotlinInputAstVisitor(
25752589 token,
25762590 Doc .Token .RealOrImaginary .REAL ,
25772591 plusIndentCommentsBefore,
2578- /* breakAndIndentTrailingComment */ Optional .empty())
2592+ /* breakAndIndentTrailingComment */ Optional .empty(),
2593+ )
25792594 }
25802595
25812596 /* *
0 commit comments