Fixed a corner case for invalidate package cache for default package

relates to KT-25264
This commit is contained in:
Vladimir Dolzhenko
2019-07-19 18:02:20 +02:00
parent 5ed6573a60
commit 0f6c381cd7
@@ -106,7 +106,10 @@ class KotlinPackageStatementPsiTreeChangePreprocessor(private val project: Proje
LOG.debugIfEnabled(project, true) { "Got PsiEvent: $event without parent" }
return
}
if (!event.isGenericChange && (parent.getChildrenOfType<KtPackageDirective>().any() || parent is KtPackageDirective))
val childrenOfType = parent.getChildrenOfType<KtPackageDirective>()
if ((!event.isGenericChange && (childrenOfType.any() || parent is KtPackageDirective)) ||
(childrenOfType.any { it.name.isEmpty() } && parent is KtFile)
)
ServiceManager.getService(project, PerModulePackageCacheService::class.java).notifyPackageChange(file)
}
else -> {