PerModulePackageCache: Process events where whole psi file was added
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user