optimisation: do not compute and cache all inheritors when in EDT

This commit is contained in:
Alexey Kudravtsev
2017-11-10 12:37:03 +03:00
parent 529b06f9ab
commit 62ebe4b99d
@@ -85,6 +85,12 @@ public class JavaClassInheritorsSearcher extends QueryExecutorBase<PsiClass, Cla
return;
}
if (!parameters.isCheckDeep() && ApplicationManager.getApplication().isDispatchThread()) {
// optimisation: if under EDT we've been asked for one inheritor, to improve latency do not bother to compute and cache them all
DirectClassInheritorsSearch.search(baseClass, searchScope).forEach(consumer);
return;
}
Iterable<PsiClass> cached = getOrComputeSubClasses(project, baseClass, searchScope);
for (final PsiClass subClass : cached) {