Add name to argument: do not remove necessary backticks

#KT-30894 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-12-01 21:17:51 +09:00
committed by Yan Zhulanow
parent a492fe7757
commit b56272dc64
10 changed files with 75 additions and 1 deletions
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.psiUtil.isIdentifier
import org.jetbrains.kotlin.resolve.ImportPath
import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments
import org.jetbrains.kotlin.utils.checkWithAttachment
@@ -531,7 +532,12 @@ class KtPsiFactory @JvmOverloads constructor(private val project: Project, val m
appendFixedText("(")
if (name != null) {
appendName(name)
val asString = name.asString()
if (asString.isIdentifier()) {
appendName(name)
} else {
appendFixedText("`$asString`")
}
appendFixedText(" = ")
}