CreateExpect: fix build for a33
This commit is contained in:
@@ -12,7 +12,6 @@ import com.intellij.openapi.editor.Editor
|
|||||||
import com.intellij.openapi.module.Module
|
import com.intellij.openapi.module.Module
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.openapi.ui.showOkNoDialog
|
import com.intellij.openapi.ui.showOkNoDialog
|
||||||
import com.intellij.openapi.util.text.StringUtil
|
|
||||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
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.getSuperNames
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.hasActualModifier
|
import org.jetbrains.kotlin.psi.psiUtil.hasActualModifier
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
sealed class CreateExpectedFix<D : KtNamedDeclaration>(
|
sealed class CreateExpectedFix<D : KtNamedDeclaration>(
|
||||||
declaration: D,
|
declaration: D,
|
||||||
@@ -177,7 +175,7 @@ private tailrec fun TypeAccessibilityChecker.findAndApplyExistingClasses(element
|
|||||||
|
|
||||||
private fun showUnknownTypesDialog(project: Project, declarationsWithNonExistentClasses: Collection<KtNamedDeclaration>): Boolean {
|
private fun showUnknownTypesDialog(project: Project, declarationsWithNonExistentClasses: Collection<KtNamedDeclaration>): Boolean {
|
||||||
if (declarationsWithNonExistentClasses.isEmpty()) return true
|
if (declarationsWithNonExistentClasses.isEmpty()) return true
|
||||||
val message = StringUtil.escapeXmlEntities(
|
val message = escapeXml(
|
||||||
declarationsWithNonExistentClasses.joinToString(
|
declarationsWithNonExistentClasses.joinToString(
|
||||||
prefix = "These declarations cannot be transformed:\n",
|
prefix = "These declarations cannot be transformed:\n",
|
||||||
separator = "\n",
|
separator = "\n",
|
||||||
@@ -198,7 +196,7 @@ private fun showUnknownTypesError(element: KtNamedDeclaration) {
|
|||||||
showErrorHint(
|
showErrorHint(
|
||||||
element.project,
|
element.project,
|
||||||
editor,
|
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"
|
"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)
|
||||||
Reference in New Issue
Block a user