CreateExpect: fix build for a33

This commit is contained in:
Dmitry Gridin
2019-08-22 19:39:23 +07:00
parent 27d7ee8518
commit eaa28fd4ed
3 changed files with 22 additions and 4 deletions
@@ -12,7 +12,6 @@ import com.intellij.openapi.editor.Editor
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.showOkNoDialog
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
@@ -40,7 +39,6 @@ import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer
import org.jetbrains.kotlin.psi.psiUtil.getSuperNames
import org.jetbrains.kotlin.psi.psiUtil.hasActualModifier
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import java.util.*
sealed class CreateExpectedFix<D : KtNamedDeclaration>(
declaration: D,
@@ -177,7 +175,7 @@ private tailrec fun TypeAccessibilityChecker.findAndApplyExistingClasses(element
private fun showUnknownTypesDialog(project: Project, declarationsWithNonExistentClasses: Collection<KtNamedDeclaration>): Boolean {
if (declarationsWithNonExistentClasses.isEmpty()) return true
val message = StringUtil.escapeXmlEntities(
val message = escapeXml(
declarationsWithNonExistentClasses.joinToString(
prefix = "These declarations cannot be transformed:\n",
separator = "\n",
@@ -198,7 +196,7 @@ private fun showUnknownTypesError(element: KtNamedDeclaration) {
showErrorHint(
element.project,
editor,
"You cannot create the expect declaration from:\n${StringUtil.escapeXmlEntities(getExpressionShortText(element))}",
"You cannot create the expect declaration from:\n${escapeXml(getExpressionShortText(element))}",
"Unknown types"
)
}
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.quickfix.expectactual
import com.intellij.openapi.util.text.StringUtil
fun escapeXml(text: String): String = StringUtil.escapeXmlEntities(text)
@@ -0,0 +1,10 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.quickfix.expectactual
import com.intellij.openapi.util.text.StringUtil
fun escapeXml(text: String): String = StringUtil.escapeXml(text)