KT-39869 Remove redundant performDelayedRefactoringRequests call
- In `ObsoleteExperimentalCoroutinesInspection` it is redundant because it is performed immediately after the single `bindToFqName` call, so there is no reason to postpone the refactoring and then immediately invoke it - In `ObsoleteKotlinJsPackagesInspection` there are no reason to call it at all (no refactorings are postponed)
This commit is contained in:
committed by
Roman Golyshev
parent
5cf6b860a6
commit
637d3430ff
+1
-4
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.config.LanguageVersion
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
|
||||
import org.jetbrains.kotlin.idea.codeInsight.shorten.performDelayedRefactoringRequests
|
||||
import org.jetbrains.kotlin.idea.imports.importableFqName
|
||||
import org.jetbrains.kotlin.idea.references.KtSimpleNameReference
|
||||
import org.jetbrains.kotlin.idea.references.mainReference
|
||||
@@ -119,9 +118,7 @@ private class ObsoleteTopLevelFunctionUsageReporter(
|
||||
val element = descriptor.psiElement
|
||||
if (element !is KtSimpleNameExpression) return
|
||||
|
||||
element.mainReference.bindToFqName(FqName(fqName), KtSimpleNameReference.ShorteningMode.DELAYED_SHORTENING)
|
||||
|
||||
performDelayedRefactoringRequests(project)
|
||||
element.mainReference.bindToFqName(FqName(fqName), KtSimpleNameReference.ShorteningMode.FORCED_SHORTENING)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.backend.common.serialization.findPackage
|
||||
import org.jetbrains.kotlin.config.LanguageVersion
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.idea.KotlinBundle
|
||||
import org.jetbrains.kotlin.idea.codeInsight.shorten.performDelayedRefactoringRequests
|
||||
import org.jetbrains.kotlin.idea.references.resolveMainReferenceToDescriptors
|
||||
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
|
||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||
@@ -85,8 +84,6 @@ private object KotlinBrowserFullyQualifiedUsageReporter : ObsoleteCodeProblemRep
|
||||
|
||||
val newQualifier = KtPsiFactory(oldQualifier).createExpression(KOTLINX_BROWSER_PACKAGE)
|
||||
oldQualifier.replace(newQualifier)
|
||||
|
||||
performDelayedRefactoringRequests(project)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user