PerModulePackageCache: Process events where whole psi file was added

This commit is contained in:
Simon Ogorodnik
2018-12-11 16:21:52 +03:00
parent 1f6fde4bc2
commit f8e7c8856a
@@ -23,6 +23,7 @@ import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.openapi.vfs.newvfs.BulkFileListener
import com.intellij.openapi.vfs.newvfs.events.*
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.PsiTreeChangeEventImpl
import com.intellij.psi.impl.PsiTreeChangePreprocessor
@@ -83,7 +84,7 @@ class KotlinPackageContentModificationListener(private val project: Project) {
class KotlinPackageStatementPsiTreeChangePreprocessor(private val project: Project) : PsiTreeChangePreprocessor {
override fun treeChanged(event: PsiTreeChangeEventImpl) {
val eFile = event.file
val eFile = event.file ?: event.child as? PsiFile
if (eFile == null) LOG.debugInTests("Got PsiEvent: $event without file", true)
val file = eFile as? KtFile ?: return