public static Query<JSFunction> doFindOverridenFunctionStatic(final JSFunction elt) { PsiElement parent = JSResolveUtil.findParent(elt); if(parent instanceof JSClass) { return JSFunctionsSearch.searchOverridingFunctions(elt, true); } final String qName = JSResolveUtil.getQNameToStartHierarchySearch(elt); if(qName != null) { final ArrayList<JSFunction> result = new ArrayList<JSFunction>(); return new CollectionQuery<JSFunction>(result); } return new CollectionQuery<JSFunction>(Collections.<JSFunction>emptyList()); }
@NotNull public Query<VirtualFile> getDirectoriesByPackageName(@NotNull final String packageName, final boolean includeLibrarySources) { // Note that this method is used in upsource as well, hence, don't reduce this method's visibility. List<VirtualFile> result = myPackageDirectoryCache.getDirectoriesByPackageName(packageName); if (!includeLibrarySources) { result = ContainerUtil.filter(result, new Condition<VirtualFile>() { @Override public boolean value(VirtualFile file) { DirectoryInfo info = getInfoForFile(file); return info.isInProject() && (!info.isInLibrarySource() || info.isInModuleSource() || info.hasLibraryClassRoot()); } }); } return new CollectionQuery<VirtualFile>(result); }
@Nullable protected Query<PsiElement> search(final PsiElement elt) { List<PsiElement> result = new ArrayList<PsiElement>(); PyClass containingClass = PsiTreeUtil.getParentOfType(elt, PyClass.class); if (containingClass != null && elt instanceof PyTargetExpression) { for (PyClass ancestor : containingClass.getAncestorClasses(null)) { final PyTargetExpression attribute = ancestor.findClassAttribute(((PyTargetExpression)elt).getReferencedName(), false); if (attribute != null) { result.add(attribute); } } } return new CollectionQuery<PsiElement>(result); }
@Override public Query<VirtualFile> getDirsByPackageName(@NotNull String packageName, boolean includeLibrarySources) { return new CollectionQuery<VirtualFile>(findDirectoriesByPackageName(packageName)); }