File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Rubberduck.Parsing/VBA/Parsing Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,7 @@ public override void ExitSubStmt(VBAParser.SubStmtContext context)
63
63
private void ResetScope ( )
64
64
{
65
65
_currentScope = _moduleScope ;
66
- _currentScopeAttributes = _attributes . TryGetValue ( _currentScope , out var attributes )
67
- ? attributes
68
- : new Attributes ( ) ;
66
+ _currentScopeAttributes = null ;
69
67
}
70
68
71
69
public override void EnterFunctionStmt ( VBAParser . FunctionStmtContext context )
@@ -154,7 +152,8 @@ public override void ExitAttributeStmt(VBAParser.AttributeStmtContext context)
154
152
155
153
var scopeName = attributeNameParts [ 0 ] ;
156
154
157
- if ( scopeName . Equals ( _currentScope . scopeIdentifier , StringComparison . OrdinalIgnoreCase ) )
155
+ //Might be an attribute for the enclosing procedure, function or poperty.
156
+ if ( _currentScopeAttributes != null && scopeName . Equals ( _currentScope . scopeIdentifier , StringComparison . OrdinalIgnoreCase ) )
158
157
{
159
158
AddOrUpdateAttribute ( _currentScopeAttributes , attributeName , context ) ;
160
159
return ;
You can’t perform that action at this time.
0 commit comments