Don't delete unresolved imports in cleanup inspection (KT-25678)
It looks like they were deleted because of the bug in search for deprecated imports search. #KT-25678 Fixed
This commit is contained in:
@@ -55,7 +55,12 @@ class DeprecatedSymbolUsageFix(
|
||||
}
|
||||
|
||||
fun isImportToBeRemoved(import: KtImportDirective): Boolean {
|
||||
return !import.isAllUnder && import.targetDescriptors().all {
|
||||
if (import.isAllUnder) return false
|
||||
|
||||
val targetDescriptors = import.targetDescriptors()
|
||||
if (targetDescriptors.isEmpty()) return false
|
||||
|
||||
return targetDescriptors.all {
|
||||
DeprecatedSymbolUsageFixBase.fetchReplaceWithPattern(it, import.project) != null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import pack.oldFun1
|
||||
import pack.oldFun2 // should not be removed for non-deprecated overload used
|
||||
import pack.oldFun3
|
||||
import kotlin.reflect.KProperty
|
||||
import some.unresolved.declaration // should not be removed
|
||||
|
||||
class A private()
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import pack.bar
|
||||
import pack.oldFun2 // should not be removed for non-deprecated overload used
|
||||
import kotlin.reflect.KProperty
|
||||
import some.unresolved.declaration // should not be removed
|
||||
|
||||
class A private constructor()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user