diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt index 13da8534d8e..62bd56b132e 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt @@ -482,13 +482,19 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m createExpressionByPattern("if ($0) $1", condition, thenExpr)) as KtIfExpression } - fun createArgument(expression: KtExpression?, name: Name? = null, isSpread: Boolean = false): KtValueArgument { - val argumentList = buildByPattern({ pattern, args -> createByPattern(pattern, *args) { createCallArguments(it) } }) { + fun createArgument( + expression: KtExpression?, + name: Name? = null, + isSpread: Boolean = false, + reformat: Boolean = true + ): KtValueArgument { + val argumentList = buildByPattern( + { pattern, args -> createByPattern(pattern, *args, reformat = reformat) { createCallArguments(it) } }) { appendFixedText("(") if (name != null) { appendName(name) - appendFixedText("=") + appendFixedText(" = ") } if (isSpread) { diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/AddNameToArgumentFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/AddNameToArgumentFix.kt index 4555aebb705..e958266aa35 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/AddNameToArgumentFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/AddNameToArgumentFix.kt @@ -60,7 +60,7 @@ class AddNameToArgumentFix(argument: KtValueArgument) : KotlinQuickFixAction) {