@@ -41,14 +41,6 @@ protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
41
41
. Concat ( builtinHandlers )
42
42
. Concat ( userDeclarations . Where ( item => item . IsWithEvents ) ) ) ;
43
43
44
- bool HasArgumentReferencesWithIsAssignmentFlagged ( QualifiedContext < ParserRuleContext > context )
45
- => contextLookup . TryGetValue ( context . Context . GetChild < VBAParser . ArgContext > ( ) , out Declaration decl )
46
- ? decl . References . Any ( rf => rf . IsAssignment ) : false ;
47
-
48
- Declaration GetSubStmtParentDeclaration ( QualifiedContext < ParserRuleContext > context )
49
- => contextLookup . TryGetValue ( ( VBAParser . SubStmtContext ) context . Context . Parent , out Declaration decl )
50
- ? decl : null ;
51
-
52
44
return Listener . Contexts
53
45
. Where ( context => context . Context . Parent is VBAParser . SubStmtContext
54
46
&& HasArgumentReferencesWithIsAssignmentFlagged ( context ) )
@@ -62,6 +54,20 @@ Declaration GetSubStmtParentDeclaration(QualifiedContext<ParserRuleContext> cont
62
54
. Select ( result => new DeclarationInspectionResult ( this ,
63
55
string . Format ( InspectionResults . ProcedureCanBeWrittenAsFunctionInspection , result . IdentifierName ) ,
64
56
result ) ) ;
57
+
58
+ bool HasArgumentReferencesWithIsAssignmentFlagged ( QualifiedContext < ParserRuleContext > context )
59
+ {
60
+ return contextLookup . TryGetValue ( context . Context . GetChild < VBAParser . ArgContext > ( ) , out Declaration decl )
61
+ ? decl . References . Any ( rf => rf . IsAssignment )
62
+ : false ;
63
+ }
64
+
65
+ Declaration GetSubStmtParentDeclaration ( QualifiedContext < ParserRuleContext > context )
66
+ {
67
+ return contextLookup . TryGetValue ( context . Context . Parent as VBAParser . SubStmtContext , out Declaration decl )
68
+ ? decl
69
+ : null ;
70
+ }
65
71
}
66
72
67
73
public class SingleByRefParamArgListListener : VBAParserBaseListener , IInspectionListener
0 commit comments