Exemplo n.º 1
0
 protected override bool IsResultReference(IdentifierReference reference, DeclarationFinder finder)
 {
     return(reference.IsNonIndexedDefaultMemberAccess &&
            !reference.IsProcedureCoercion &&
            !reference.IsInnerRecursiveDefaultMemberAccess &&
            !reference.IsIgnoringInspectionResultFor(AnnotationName));
 }
 protected override bool IsResultReference(IdentifierReference reference)
 {
     return(reference.IsIndexedDefaultMemberAccess &&
            reference.DefaultMemberRecursionDepth > 1 &&
            !(reference.Context is VBAParser.DictionaryAccessContext) &&
            !reference.IsIgnoringInspectionResultFor(AnnotationName));
 }
Exemplo n.º 3
0
        protected override bool IsResultReference(IdentifierReference reference, DeclarationFinder finder)
        {
            // prefilter to reduce search space
            if (reference.IsIgnoringInspectionResultFor(AnnotationName))
            {
                return(false);
            }

            var usageContext = UsageContext(reference);

            var setter = usageContext is VBAParser.LExprContext lexpr &&
                         lexpr.Parent is VBAParser.SetStmtContext
                ? lexpr.Parent
                : null;

            if (setter is null)
            {
                return(usageContext is VBAParser.MemberAccessExprContext ||
                       !(usageContext is VBAParser.CallStmtContext) &&
                       !ContextIsNothing(usageContext));
            }

            var assignedTo = AssignmentTarget(reference, finder, setter);

            return(assignedTo != null &&
                   IsUsedBeforeCheckingForNothing(assignedTo));
        }
Exemplo n.º 4
0
 private bool IsImplicitDefaultMemberAssignment(IdentifierReference reference)
 {
     return(reference.IsNonIndexedDefaultMemberAccess &&
            reference.IsAssignment &&
            !reference.IsSetAssignment &&
            !reference.HasExplicitLetStatement &&
            !reference.IsIgnoringInspectionResultFor(AnnotationName));
 }
Exemplo n.º 5
0
 protected bool IsIgnoringInspectionResultFor(IdentifierReference reference, string inspectionName)
 {
     return(reference != null && reference.IsIgnoringInspectionResultFor(inspectionName));
 }