@@ -154,7 +154,7 @@ private void ResolveType(ParserRuleContext context, string expression)
154154 var boundExpression = _bindingService . ResolveType ( _moduleDeclaration , _currentParent , expression ) ;
155155 if ( boundExpression != null )
156156 {
157- _boundExpressionVisitor . AddIdentifierReferences ( boundExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context , boundExpression . Context ) ) ) ;
157+ _boundExpressionVisitor . AddIdentifierReferences ( boundExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context , exprCtx ) ) ) ;
158158 }
159159 }
160160
@@ -447,9 +447,9 @@ public void Resolve(VBAParser.ForNextStmtContext context)
447447 if ( firstExpression != null )
448448 {
449449 // each iteration counts as an assignment
450- _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , firstExpression . Context ) , true ) ) ;
450+ _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , exprCtx ) , true ) ) ;
451451 // each iteration also counts as a plain usage
452- _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , firstExpression . Context ) ) ) ;
452+ _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , exprCtx ) ) ) ;
453453 }
454454 for ( int exprIndex = 1 ; exprIndex < context . valueStmt ( ) . Count ; exprIndex ++ )
455455 {
@@ -463,9 +463,9 @@ public void Resolve(VBAParser.ForEachStmtContext context)
463463 if ( firstExpression != null )
464464 {
465465 // each iteration counts as an assignment
466- _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , firstExpression . Context ) , true ) ) ;
466+ _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , exprCtx ) , true ) ) ;
467467 // each iteration also counts as a plain usage
468- _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , firstExpression . Context ) ) ) ;
468+ _boundExpressionVisitor . AddIdentifierReferences ( firstExpression , ( exprCtx , identifier , declaration ) => CreateReference ( context . valueStmt ( ) [ 0 ] , identifier , declaration , RubberduckParserState . CreateBindingSelection ( context . valueStmt ( ) [ 0 ] , exprCtx ) ) ) ;
469469 }
470470
471471 for ( int exprIndex = 1 ; exprIndex < context . valueStmt ( ) . Count ; exprIndex ++ )
0 commit comments