void (@NotNull PsiFile file) { final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile != null) { String relative = ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), myProject, true, false); myContext.incrementJobDoneAmount(myContext.getStdJobDescriptors().BUILD_GRAPH, relative); } if (file instanceof PsiBinaryFile || file.getFileType().isBinary()) { return; } 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(); }