[FE] Restore source compatibility in KtPsiFactory
Prevent huge code migration in kt- release branches by returning the previously available API in deprecated status.
This commit is contained in:
@@ -25,15 +25,23 @@ import org.jetbrains.kotlin.utils.checkWithAttachment
|
||||
|
||||
@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" +
|
||||
|
||||
Reference in New Issue
Block a user