Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class NativeImagePlugin : Plugin<Project> {
add("--future-defaults=all")
add("--link-at-build-time=org.jetbrains.ktfmt")
add("--initialize-at-build-time=org.jetbrains.ktfmt")
add($$"--initialize-at-build-time=com.google.googlejavaformat.Indent$Const")
add("--add-opens=java.base/java.util=ALL-UNNAMED")
add("--color=always")
add("-H:+ReportExceptionStackTraces")
Expand Down
93 changes: 64 additions & 29 deletions core/api/ktfmt.api

Large diffs are not rendered by default.

764 changes: 37 additions & 727 deletions core/src/main/kotlin/org/jetbrains/ktfmt/format/KotlinInputAstVisitor.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ abstract class AbstractFormatterVisitor : KtTreeVisitorVoid(), KotlinAstFormatte
}

override fun visitArgument(argument: KtValueArgument) {
formatArgument(argument)
formatArgument(argument, wrapInBlock = true, brokeBeforeBrace = null)
}

override fun visitSuperTypeList(list: KtSuperTypeList) {
Expand Down Expand Up @@ -221,7 +221,7 @@ abstract class AbstractFormatterVisitor : KtTreeVisitorVoid(), KotlinAstFormatte
}

override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) {
formatLambdaExpression(lambdaExpression)
formatLambdaExpression(lambdaExpression, brokeBeforeBrace = null)
}

override fun visitThisExpression(expression: KtThisExpression) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.jetbrains.ktfmt.format.visitor

import com.google.googlejavaformat.Doc
import com.google.googlejavaformat.Indent.Const.ZERO
import org.jetbrains.kotlin.psi.KtAnnotatedExpression
import org.jetbrains.kotlin.psi.KtAnnotation
import org.jetbrains.kotlin.psi.KtAnnotationEntry
import org.jetbrains.kotlin.psi.KtAnnotationUseSiteTarget
import org.jetbrains.kotlin.psi.KtBlockExpression
import org.jetbrains.kotlin.psi.KtLambdaExpression
import org.jetbrains.kotlin.psi.KtReturnExpression
import org.jetbrains.ktfmt.format.visitor.Indentation.Companion.ZERO

interface AnnotationFormatter : KotlinAstFormatter {
override fun formatAnnotatedExpression(expression: KtAnnotatedExpression) {
Expand Down Expand Up @@ -90,11 +90,11 @@ interface AnnotationFormatter : KotlinAstFormatter {
format(useSiteTarget)
builder.token(":")
}
formatCallElement(
formatFunctionCall(
annotationEntry.calleeExpression,
null, // Type-arguments are included in the annotation's callee expression.
annotationEntry.valueArgumentList,
listOf(),
null,
)
}
}
Loading