boolean (@NotNull Project project, @NotNull VirtualFile virtualFile) { return ReadAction.compute(() -> { if (project.isDisposed() || !virtualFile.isValid()) return false; PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile); return psiFile != null && hasErrors(psiFile); }); }