@Override
    public void visitFile(@NotNull PsiFile file) {
      if (!(file instanceof PsiBinaryFile) && !file.getFileType().isBinary()) {
        final FileViewProvider viewProvider = file.getViewProvider();
        final Set<Language> relevantLanguages = viewProvider.getLanguages();
        for (Language language : relevantLanguages) {
          try {
            visitElement(viewProvider.getPsi(language));
          }
          catch (ProcessCanceledException | IndexNotReadyException e) {
            throw e;
          }
          catch (Throwable e) {
            if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
              LOG.error(file.getName(), e);
            }
            else {
              LOG.error(new RuntimeExceptionWithAttachments(e, new Attachment("diagnostics.txt", file.getName())));
            }
          }
        }
        myPsiManager.dropResolveCaches();
      }
      final VirtualFile virtualFile = file.getVirtualFile();
      if (virtualFile != null) {
        executeTask(() -> {
          String relative =
            ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), myProject, true, false);
          myContext.incrementJobDoneAmount(myContext.getStdJobDescriptors().BUILD_GRAPH, relative);
        });
      }
    }
@Override
    public void visitFile(@NotNull PsiFile file)