[FE] Restore source compatibility in KtPsiFactory
Prevent huge code migration in kt- release branches by returning the
previously available API in deprecated status.
diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt
index d36ceb3..649bac4 100644
--- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt
+++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt
@@ -25,15 +25,23 @@
@JvmOverloads
@JvmName("KtPsiFactory")
-@Suppress("FunctionName", "unused")
-@Deprecated("Use 'KtPsiFactory' constructor instead", level = DeprecationLevel.HIDDEN)
-fun KtPsiFactoryOld(project: Project?, markGenerated: Boolean = true): KtPsiFactory = KtPsiFactory(project!!, markGenerated)
+@Suppress("unused")
+@Deprecated(
+ "Use 'KtPsiFactory' constructor instead",
+ level = DeprecationLevel.WARNING,
+ replaceWith = ReplaceWith("KtPsiFactory(project!!, markGenerated)", "org.jetbrains.kotlin.psi.KtPsiFactory")
+)
+fun KtPsiFactory(project: Project?, markGenerated: Boolean = true): KtPsiFactory = KtPsiFactory(project!!, markGenerated)
@JvmOverloads
@JvmName("KtPsiFactory")
-@Suppress("FunctionName", "unused")
-@Deprecated("Use 'KtPsiFactory' constructor instead", level = DeprecationLevel.HIDDEN)
-fun KtPsiFactoryOld(elementForProject: PsiElement, markGenerated: Boolean = true): KtPsiFactory =
+@Suppress("unused")
+@Deprecated(
+ "Use 'KtPsiFactory' constructor instead",
+ level = DeprecationLevel.WARNING,
+ replaceWith = ReplaceWith("KtPsiFactory(elementForProject.project, markGenerated)", "org.jetbrains.kotlin.psi.KtPsiFactory")
+)
+fun KtPsiFactory(elementForProject: PsiElement, markGenerated: Boolean = true): KtPsiFactory =
KtPsiFactory(elementForProject.project, markGenerated)
private const val DO_NOT_ANALYZE_NOTIFICATION = "This file was created by KtPsiFactory and should not be analyzed\n" +