mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
wait for user input out of read action (IDEA-115944, consequence of IDEA-115258)
This commit is contained in:
@@ -36,6 +36,8 @@ import com.intellij.openapi.module.ModuleManager;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.progress.util.ProgressWrapper;
|
||||
import com.intellij.openapi.progress.util.TooManyUsagesStatus;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -282,7 +284,10 @@ public class FindInProjectUtil {
|
||||
final int[] offset = {0};
|
||||
int count = 0;
|
||||
int found;
|
||||
ProgressIndicator indicator = ProgressWrapper.unwrap(ProgressManager.getInstance().getProgressIndicator());
|
||||
TooManyUsagesStatus tooManyUsagesStatus = TooManyUsagesStatus.getFrom(indicator);
|
||||
do {
|
||||
tooManyUsagesStatus.pauseProcessingIfTooManyUsages(); // wait for user out of read action
|
||||
found = ApplicationManager.getApplication().runReadAction(new Computable<Integer>() {
|
||||
@Override
|
||||
@NotNull
|
||||
|
||||
@@ -353,7 +353,6 @@ public class UsageViewManagerImpl extends UsageViewManager {
|
||||
ProgressIndicator indicator = ProgressWrapper.unwrap(ProgressManager.getInstance().getProgressIndicator());
|
||||
if (indicator != null && indicator.isCanceled()) return false;
|
||||
TooManyUsagesStatus tooManyUsagesStatus = TooManyUsagesStatus.getFrom(indicator);
|
||||
tooManyUsagesStatus.pauseProcessingIfTooManyUsages();
|
||||
boolean incrementCounter = !isSelfUsage(usage, mySearchFor);
|
||||
|
||||
if (incrementCounter) {
|
||||
|
||||
Reference in New Issue
Block a user