@Override @NotNull public PsiMethod[] getMethodsByName(@NotNull String name, @NotNull final GlobalSearchScope scope) { Collection<PsiMethod> methods = StubIndex.getElements(JavaStubIndexKeys.METHODS, name, myManager.getProject(), new JavaSourceFilterScope(scope), PsiMethod.class); if (methods.isEmpty()) return PsiMethod.EMPTY_ARRAY; List<PsiMethod> list = filterMembers(methods, scope); return list.toArray(new PsiMethod[list.size()]); }
@Override public boolean processFieldsWithName(@NotNull String name, @NotNull Processor<? super PsiField> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) { return StubIndex.getInstance().processElements(JavaStubIndexKeys.FIELDS, name, myManager.getProject(), new JavaSourceFilterScope(scope), filter, PsiField.class, processor); }
@Override public boolean processMethodsWithName(@NonNls @NotNull String name, @NotNull Processor<? super PsiMethod> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) { return StubIndex.getInstance().processElements(JavaStubIndexKeys.METHODS, name, myManager.getProject(), new JavaSourceFilterScope(scope), filter, PsiMethod.class, processor); }
@Override public boolean processClassesWithName(@NotNull String name, @NotNull Processor<? super PsiClass> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) { return StubIndex.getInstance().processElements(JavaStubIndexKeys.CLASS_SHORT_NAMES, name, myManager.getProject(), new JavaSourceFilterScope(scope), filter, PsiClass.class, processor); }
public void testResolveScopeWithFragmentContext() throws Exception { PsiElement physical = configureByFile("codeFragment/LocalVariable.java").getElement(); JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(myProject) .createExpressionCodeFragment("ref", physical, null, true); fragment.forceResolveScope(new JavaSourceFilterScope(physical.getResolveScope())); assertFalse(fragment.getResolveScope().equals(physical.getResolveScope())); PsiExpression lightExpr = JavaPsiFacade.getElementFactory(myProject).createExpressionFromText("xxx.xxx", fragment); assertEquals(lightExpr.getResolveScope(), fragment.getResolveScope()); }
@Override @NotNull public PsiMethod[] getMethodsByName(@NotNull String name, @NotNull final GlobalSearchScope scope) { Collection<PsiMethod> methods = StubIndex.getInstance().get(JavaStubIndexKeys.METHODS, name, myManager.getProject(), new JavaSourceFilterScope(scope)); if (methods.isEmpty()) return PsiMethod.EMPTY_ARRAY; List<PsiMethod> list = filterMembers(methods, scope); return list.toArray(new PsiMethod[list.size()]); }
@Override public Collection<PsiJavaModule> get(@NotNull String name, @NotNull Project project, @NotNull GlobalSearchScope scope) { Collection<PsiJavaModule> modules = StubIndex.getElements(getKey(), name, project, new JavaSourceFilterScope(scope), PsiJavaModule.class); if(modules.size() > 1) { modules = filterVersions(project, modules); } return modules; }
@Override public Collection<PsiMethod> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiMethod.class); }
@Override @NotNull public PsiMethod[] getMethodsByName(@NotNull String name, @NotNull final GlobalSearchScope scope) { Collection<PsiMethod> methods = StubIndex.getElements(JavaStubIndexKeys.METHODS, name, myManager.getProject(), new JavaSourceFilterScope(scope), PsiMethod.class); if(methods.isEmpty()) { return PsiMethod.EMPTY_ARRAY; } List<PsiMethod> list = filterMembers(methods, scope); return list.toArray(new PsiMethod[list.size()]); }
@Override public boolean processFieldsWithName(@NotNull String name, @NotNull Processor<? super PsiField> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) { return StubIndex.getInstance().process(JavaStubIndexKeys.FIELDS, name, myManager.getProject(), new JavaSourceFilterScope(scope), filter, processor); }
@Override public boolean processMethodsWithName(@NonNls @NotNull String name, @NotNull Processor<? super PsiMethod> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) { return StubIndex.getInstance().process(JavaStubIndexKeys.METHODS, name, myManager.getProject(), new JavaSourceFilterScope(scope), filter, processor); }
@Override public boolean processClassesWithName(@NotNull String name, @NotNull Processor<? super PsiClass> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) { return StubIndex.getInstance().process(JavaStubIndexKeys.CLASS_SHORT_NAMES, name, myManager.getProject(), new JavaSourceFilterScope(scope), filter, processor); }
@Override public Collection<PsiReferenceList> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiReferenceList.class); }
@Override public Collection<PsiField> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiField.class); }
@Override public Collection<PsiClass> get(@NotNull final Integer integer, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), integer, project, new JavaSourceFilterScope(scope), PsiClass.class); }
public Collection<PsiMember> getStaticMembers(final String name, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), name, project, new JavaSourceFilterScope(scope), PsiMember.class); }
@Override public Collection<PsiAnnotation> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnnotation.class); }
public Collection<PsiMember> getStaticMembers(@NotNull final String shortTypeText, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(JavaStubIndexKeys.JVM_STATIC_MEMBERS_TYPES, shortTypeText, project, new JavaSourceFilterScope(scope), PsiMember.class); }
@Override public Collection<PsiClass> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiClass.class); }
@Override public Collection<PsiAnonymousClass> get(@NotNull final String s, @NotNull final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getElements(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnonymousClass.class); }
@Override public Collection<PsiReferenceList> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), s, project, new JavaSourceFilterScope(scope), PsiReferenceList.class); }
@Override public Collection<PsiField> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), s, project, new JavaSourceFilterScope(scope), PsiField.class); }
@Override public Collection<PsiClass> get(final Integer integer, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), integer, project, new JavaSourceFilterScope(scope), PsiClass.class); }
public Collection<PsiMember> getStaticMembers(final String name, final Project project, @NotNull final GlobalSearchScope scope) { return super.get(name, project, new JavaSourceFilterScope(scope)); }
@Override public Collection<PsiMethod> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), s, project, new JavaSourceFilterScope(scope), PsiMethod.class); }
@Override public Collection<PsiAnnotation> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnnotation.class); }
public Collection<PsiMember> getStaticMembers(@NotNull final String shortTypeText, final Project project, @NotNull final GlobalSearchScope scope) { return super.get(shortTypeText, project, new JavaSourceFilterScope(scope)); }
@Override public Collection<PsiClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), s, project, new JavaSourceFilterScope(scope), PsiClass.class); }
@Override public Collection<PsiAnonymousClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return StubIndex.getInstance().safeGet(getKey(), s, project, new JavaSourceFilterScope(scope), PsiAnonymousClass.class); }
@Override public Collection<PsiReferenceList> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return super.get(s, project, new JavaSourceFilterScope(scope)); }
@Override public Collection<PsiField> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return super.get(s, project, new JavaSourceFilterScope(scope)); }
@Override public Collection<PsiMethod> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return super.get(s, project, new JavaSourceFilterScope(scope)); }
@Override public Collection<PsiAnonymousClass> get(final String s, final Project project, @NotNull final GlobalSearchScope scope) { return super.get(s, project, new JavaSourceFilterScope(scope)); }