void (final VirtualFile file, final Project project) { final FileManagerImpl fileManager = (FileManagerImpl)PsiManagerEx.getInstanceEx(project).getFileManager(); if (fileManager.findCachedViewProvider(file) != null) { ModalityUiUtil.invokeLaterIfNeeded(ModalityState.defaultModalityState(), project.getDisposed(), () -> WriteAction.run(() -> fileManager.forceReload(file)) ); } }