read action

This commit is contained in:
Alexey Kudravtsev
2014-09-08 15:12:05 +04:00
parent 3ee8faa7b3
commit 489ef4b7dc
2 changed files with 13 additions and 3 deletions
@@ -167,7 +167,12 @@ public class ClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass, Clas
}
public static Query<PsiClass> search(@NotNull final PsiClass aClass, final boolean checkDeep) {
return search(aClass, aClass.getUseScope(), checkDeep);
return search(aClass, ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
@Override
public SearchScope compute() {
return aClass.getUseScope();
}
}), checkDeep);
}
public static Query<PsiClass> search(@NotNull PsiClass aClass) {
@@ -63,8 +63,13 @@ public class DefinitionsScopedSearch extends ExtensibleQueryFactory<PsiElement,
private final SearchScope myScope;
private final boolean myCheckDeep;
public SearchParameters(@NotNull PsiElement element) {
this(element, element.getUseScope(), true);
public SearchParameters(@NotNull final PsiElement element) {
this(element, ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
@Override
public SearchScope compute() {
return element.getUseScope();
}
}), true);
}
public SearchParameters(@NotNull PsiElement element, @NotNull SearchScope scope, final boolean checkDeep) {