IJPL-218636 [psi] don't call getCachedPsiFiles unless necessary

GitOrigin-RevId: d34024b817337feba7a34d600a51d712e37121df
This commit is contained in:
Max Medvedev
2025-11-18 14:32:04 +00:00
committed by intellij-monorepo-bot
parent 084affd277
commit f64b595e60
@@ -243,9 +243,13 @@ private class PsiVFSListener(private val project: Project) {
val oldFileViewProvider = fileManager.findCachedViewProvider(vFile)
val oldPsiFile = fileManager.getCachedPsiFile(vFile)
val parent = vFile.parent
val parentDir = if (oldPsiFile != null && parent != null) fileManager.findDirectory(parent) else getCachedDirectory(parent)
val parentDir = run {
val parent = vFile.parent
if (oldPsiFile != null && parent != null)
fileManager.findDirectory(parent)
else
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