diff --git a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.kt b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.kt index b6cc0761e768..e5aa44b30c69 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.kt +++ b/platform/lang-impl/src/com/intellij/psi/impl/file/impl/PsiVFSListener.kt @@ -242,12 +242,6 @@ private class PsiVFSListener(private val project: Project) { val vFile = event.file val oldFileViewProvider = fileManager.findCachedViewProvider(vFile) - if (oldFileViewProvider != null && FileContentUtilCore.FORCE_RELOAD_REQUESTOR == event.requestor) { - // there is no need to rebuild if there were no PSI in the first place - fileManager.forceReload(vFile) - return - } - val oldPsiFile = fileManager.getCachedPsiFile(vFile) val parentDir = run { val parent = vFile.parent @@ -257,6 +251,12 @@ private class PsiVFSListener(private val project: Project) { getCachedDirectory(parent) } + if (oldFileViewProvider != null && FileContentUtilCore.FORCE_RELOAD_REQUESTOR == event.requestor) { + // there is no need to rebuild if there were no PSI in the first place + fileManager.forceReload(vFile) + return + } + // do not suppress reparse request for light files if (parentDir == null) { var fire = VirtualFile.PROP_NAME == propertyName && vFile.isDirectory