mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
search for method usages in smart mode (EA-65599)
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package com.intellij.psi.impl.search;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.QueryExecutorBase;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
@@ -43,7 +43,7 @@ public class MethodUsagesSearcher extends QueryExecutorBase<PsiReference, Method
|
||||
final boolean[] needStrictSignatureSearch = new boolean[1];
|
||||
final boolean strictSignatureSearch = p.isStrictSignatureSearch();
|
||||
|
||||
final PsiClass aClass = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
|
||||
final PsiClass aClass = DumbService.getInstance(method.getProject()).runReadActionInSmartMode(new Computable<PsiClass>() {
|
||||
public PsiClass compute() {
|
||||
PsiClass aClass = method.getContainingClass();
|
||||
if (aClass == null) return null;
|
||||
@@ -51,8 +51,8 @@ public class MethodUsagesSearcher extends QueryExecutorBase<PsiReference, Method
|
||||
psiManager[0] = aClass.getManager();
|
||||
methodName[0] = method.getName();
|
||||
isValueAnnotation[0] = PsiUtil.isAnnotationMethod(method) &&
|
||||
PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME.equals(methodName[0]) &&
|
||||
method.getParameterList().getParametersCount() == 0;
|
||||
PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME.equals(methodName[0]) &&
|
||||
method.getParameterList().getParametersCount() == 0;
|
||||
needStrictSignatureSearch[0] = strictSignatureSearch && (aClass instanceof PsiAnonymousClass
|
||||
|| aClass.hasModifierProperty(PsiModifier.FINAL)
|
||||
|| method.hasModifierProperty(PsiModifier.STATIC)
|
||||
@@ -65,7 +65,7 @@ public class MethodUsagesSearcher extends QueryExecutorBase<PsiReference, Method
|
||||
|
||||
final SearchRequestCollector collector = p.getOptimizer();
|
||||
|
||||
final SearchScope searchScope = ApplicationManager.getApplication().runReadAction(new Computable<SearchScope>() {
|
||||
final SearchScope searchScope = DumbService.getInstance(method.getProject()).runReadActionInSmartMode(new Computable<SearchScope>() {
|
||||
@Override
|
||||
public SearchScope compute() {
|
||||
return p.getEffectiveSearchScope();
|
||||
@@ -91,7 +91,7 @@ public class MethodUsagesSearcher extends QueryExecutorBase<PsiReference, Method
|
||||
return;
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
DumbService.getInstance(method.getProject()).runReadActionInSmartMode(new Runnable() {
|
||||
public void run() {
|
||||
final PsiMethod[] methods = strictSignatureSearch ? new PsiMethod[]{method} : aClass.findMethodsByName(methodName[0], false);
|
||||
SearchScope accessScope = methods[0].getUseScope();
|
||||
|
||||
Reference in New Issue
Block a user