protected override IEnumerable <IInspectionResult> DoGetInspectionResults()
        {
            var results = new List <IInspectionResult>();

            var prefilteredReferences = IsMissingDeclarations.SelectMany(decl => decl.References
                                                                         .Where(candidate => !candidate.IsIgnoringInspectionResultFor(AnnotationName)));

            foreach (var reference in prefilteredReferences)
            {
                var parameter = GetParameterForReference(reference);

                if (parameter == null ||
                    parameter.IsOptional &&
                    parameter.AsTypeName.Equals(Tokens.Variant) &&
                    string.IsNullOrEmpty(parameter.DefaultValue) &&
                    !parameter.IsArray)
                {
                    continue;
                }

                results.Add(new IdentifierReferenceInspectionResult(this, InspectionResults.IsMissingOnInappropriateArgumentInspection, State, reference, parameter));
            }

            return(results);
        }
Пример #2
0
        protected override IEnumerable <IInspectionResult> DoGetInspectionResults()
        {
            var results = new List <IInspectionResult>();

            foreach (var reference in IsMissingDeclarations.SelectMany(decl => decl.References.Where(candidate => !IsIgnoringInspectionResultFor(candidate, AnnotationName))))
            {
                var parameter = GetParameterForReference(reference);

                if (parameter != null)
                {
                    continue;
                }

                results.Add(new IdentifierReferenceInspectionResult(this, InspectionResults.IsMissingWithNonArgumentParameterInspection, State, reference));
            }

            return(results);
        }