void () { final AnalysisScope scope = getScope(); if (scope == null) { return; } if (!myDeclarationsFound.getAndSet(true)) { long before = System.currentTimeMillis(); startTaskWorkers(); try { if (!Registry.is("batch.inspections.visit.psi.in.parallel")) { scope.accept(myProjectIterator); } else { final PsiManager psiManager = PsiManager.getInstance(myProject); scope.accept(vFile -> { executeTask(() -> { final PsiFile file = psiManager.findFile(vFile); if (file != null && ProblemHighlightFilter.shouldProcessFileInBatch(file)) { file.accept(myProjectIterator); } }); return true; }); } } finally { waitForWorkersToFinish(); LOG.info("Total duration of processing project usages: " + (System.currentTimeMillis() - before) + "ms"); } } }