void () { assert project != null; final List<PsiElement> files = getPsiElementsToProcess(); final MatchContext matchContext = getMatchContext(); final ProgressIndicator progress = matchContext.getSink().getProgressIndicator(); if (progress != null) progress.setFraction((double)scannedFilesCount/totalFilesToScan); ++scannedFilesCount; if (files.isEmpty()) return; for (final PsiElement file : files) { if (file instanceof PsiFile) { matchContext.getSink().processFile((PsiFile)file); } ReadAction.nonBlocking( () -> { if (!file.isValid()) return; match(file); } ).inSmartMode(project).executeSynchronously(); } }