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)); }
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)); }
private bool IsImplicitDefaultMemberAssignment(IdentifierReference reference) { return(reference.IsNonIndexedDefaultMemberAccess && reference.IsAssignment && !reference.IsSetAssignment && !reference.HasExplicitLetStatement && !reference.IsIgnoringInspectionResultFor(AnnotationName)); }
protected bool IsIgnoringInspectionResultFor(IdentifierReference reference, string inspectionName) { return(reference != null && reference.IsIgnoringInspectionResultFor(inspectionName)); }