Revert "IJPL-339 [psi] don't infer parentDir unless necessary"

This reverts commit 7e61c5b17b6ad99cf879ea5489d6180507356df9.

GitOrigin-RevId: 3b7f2763b3f4da91073d2591a9bc4db0ac77e38b
This commit is contained in:
Max Medvedev
2025-11-15 12:57:34 +00:00
committed by intellij-monorepo-bot
parent 71392d56ea
commit c1dada05e1
@@ -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