Esempio n. 1
0
        private ICandidate[] GetCandidates(IRuleNameUsage ruleNameUsage)
        {
            var ruleName        = ruleNameUsage.Name;
            var ruleDeclaration = ruleName.RuleNameReference.Resolve().DeclaredElement as IRuleDeclaration;

            if (ruleDeclaration != null)
            {
                var psiRuleSignature = new PsiRuleSignature(ruleDeclaration);
                var candidates       = new ICandidate[1];
                candidates[0] = new PsiParameterInfoCandidate(psiRuleSignature);
                return(candidates);
            }
            return(null);
        }
        public PsiParameterInfoCandidate(PsiRuleSignature signature)
        {
            myParameters      = signature.Parameters.ToArray();
            myParameterRanges = new TextRange[myParameters.Length];

            mySignature = "[";

            int i = 0;

            foreach (var parameter in myParameters)
            {
                mySignature += parameter.ShortName;
                if (i < myParameters.Count() - 1)
                {
                    mySignature += ",";
                }
                ++i;
            }
            mySignature += "]";
        }