Fix "Add name to argument" (disable reformatting in quick-fix text)

Four relevant quick-fix tests should be fixed after it
This commit is contained in:
Mikhail Glukhikh
2018-08-06 16:35:01 +03:00
parent 28484f31e7
commit 06d339639f
2 changed files with 12 additions and 6 deletions
@@ -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) {