Example #1
0
        private ISet <IMethodDeclaration> findMemberCandidates(bool checkInstance)
        {
            MethodSelector selector = methodCall.getSelector();

            if (selector.getParent() == null)
            {
                // if called from a member method, could be a member method called without this/self
                InstanceContext instance = context.getClosestInstanceContext();
                if (instance != null)
                {
                    IType type = instance.getInstanceType();
                    ConcreteCategoryDeclaration cd = context.getRegisteredDeclaration <ConcreteCategoryDeclaration>(type.GetTypeName());
                    if (cd != null)
                    {
                        MethodDeclarationMap members = cd.getMemberMethods(context, selector.getName());
                        if (members != null)
                        {
                            return(new HashSet <IMethodDeclaration>(members.Values));
                        }
                    }
                }
                return(new HashSet <IMethodDeclaration>());
            }
            else
            {
                IType parentType = selector.checkParentType(context, checkInstance);
                return(parentType != null?parentType.getMemberMethods(context, selector.getName()) : new HashSet <IMethodDeclaration>());
            }
        }