in core/src/main/java/com/facebook/ktfmt/format/RedundantImportDetector.kt [107:127]
fun takeImportList(importList: KtImportList, superBlock: () -> Unit) {
if (!enabled) {
return superBlock.invoke()
}
importCleanUpCandidates =
importList
.imports
.filter { import ->
import.isValidImport &&
!import.isAllUnder &&
import.identifier != null &&
requireNotNull(import.identifier) !in OPERATORS &&
!COMPONENT_OPERATOR_REGEX.matches(import.identifier.orEmpty())
}
.toSet()
isImportElement = true
superBlock.invoke()
isImportElement = false
}