void () { final PsiManager psiManager = PsiManager.getInstance(getProject()); psiManager.runInBatchFilesMode(() -> { final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(getProject()).getFileIndex(); getScope().acceptIdempotentVisitor(new PsiRecursiveElementVisitor() { @Override public void visitFile(final @NotNull PsiFile file) { visit(file, fileIndex, psiManager); } }); return null; }); }