void (@NotNull VirtualFile vFile) { ApplicationManager.getApplication().runWriteAction((ExternalChangeAction)() -> { VirtualFile parent = vFile.getParent(); PsiDirectory parentDir = getCachedDirectory(parent); if (parentDir == null) { handleVfsChangeWithoutPsi(vFile); return; } PsiFileSystemItem item = vFile.isDirectory() ? myFileManager.findDirectory(vFile) : myFileManager.findFile(vFile); if (item != null && item.getProject() == myManager.getProject()) { PsiTreeChangeEventImpl treeEvent = new PsiTreeChangeEventImpl(myManager); treeEvent.setParent(parentDir); myManager.beforeChildAddition(treeEvent); treeEvent.setChild(item); myManager.childAdded(treeEvent); } }); }