call indicator.setIndeterminate() in various strategic places to avoid "this indicator is indeterminate" assertion

GitOrigin-RevId: c7f4418c4b8f608ef1bf22785101f258080847ba
This commit is contained in:
Alexey Kudravtsev
2021-04-19 18:42:25 +03:00
committed by intellij-monorepo-bot
parent 057148b9ff
commit 7281c9f0fc
2 changed files with 4 additions and 2 deletions
@@ -291,7 +291,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper {
progress.pushState();
try {
progress.setText(IndexingBundle.message("psi.scanning.files.progress"));
progress.setIndeterminate(false);
Processor<PsiElement> localProcessor = localProcessor(searcher, processor);
@@ -93,6 +93,7 @@ public final class GenericInlineHandler {
}
Consumer<ProgressIndicator> perform = indicator -> {
indicator.setIndeterminate(false);
for (int i = 0; i < usages.length; i++) {
indicator.setFraction((double) i / usages.length);
inlineReference(usages[i], element, inliners);
@@ -106,7 +107,8 @@ public final class GenericInlineHandler {
if (Registry.is("run.refactorings.under.progress")) {
((ApplicationImpl)ApplicationManager.getApplication())
.runWriteActionWithNonCancellableProgressInDispatchThread(commandName, project, null, perform);
} else {
}
else {
perform.accept(new EmptyProgressIndicator());
}
});