read action

This commit is contained in:
Alexey Kudravtsev
2014-08-29 13:57:17 +04:00
parent 464c12d726
commit 31cfc9eb58
@@ -65,7 +65,12 @@ public class JavaFunctionalExpressionSearcher implements QueryExecutor<PsiFuncti
return aClass.getUseScope();
}
});
final SearchScope useScope = searchScope.intersectWith(classScope);
final SearchScope useScope = ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
@Override
public SearchScope compute() {
return searchScope.intersectWith(classScope);
}
});
final Project project = PsiUtilCore.getProjectInReadAction(aClass);
final GlobalSearchScope scope = useScope instanceof GlobalSearchScope ? (GlobalSearchScope)useScope : new EverythingGlobalScope(project);
final Collection<PsiMethod> lambdaCandidates = ApplicationManager.getApplication().runReadAction(new Computable<Collection<PsiMethod>>() {