@@ -63,10 +63,10 @@ public DeclarationFinder(IReadOnlyList<Declaration> declarations, IEnumerable<IA
63
63
_parametersByParent = declarations . Where ( declaration => declaration . DeclarationType == DeclarationType . Parameter )
64
64
. GroupBy ( declaration => declaration . ParentDeclaration ) . ToConcurrentDictionary ( ) ;
65
65
_userDeclarationsByType = declarations . Where ( declaration => ! declaration . IsBuiltIn ) . GroupBy ( declaration => declaration . DeclarationType ) . ToConcurrentDictionary ( ) ;
66
- _builtinEvents = new Lazy < ConcurrentBag < Declaration > > ( ( ) => FindBuiltInEventHandlers ( declarations ) ) ;
66
+ _builtinEvents = new Lazy < ConcurrentBag < Declaration > > ( ( ) => FindBuiltInEventHandlers ( declarations ) , true ) ;
67
67
68
- _projects = _projects = new Lazy < ConcurrentBag < Declaration > > ( ( ) => new ConcurrentBag < Declaration > ( declarations . Where ( d => d . DeclarationType == DeclarationType . Project ) ) ) ;
69
- _classes = new Lazy < ConcurrentBag < Declaration > > ( ( ) => new ConcurrentBag < Declaration > ( declarations . Where ( d => d . DeclarationType == DeclarationType . ClassModule ) ) ) ;
68
+ _projects = _projects = new Lazy < ConcurrentBag < Declaration > > ( ( ) => new ConcurrentBag < Declaration > ( declarations . Where ( d => d . DeclarationType == DeclarationType . Project ) ) , true ) ;
69
+ _classes = new Lazy < ConcurrentBag < Declaration > > ( ( ) => new ConcurrentBag < Declaration > ( declarations . Where ( d => d . DeclarationType == DeclarationType . ClassModule ) ) , true ) ;
70
70
71
71
var withEventsFields = UserDeclarations ( DeclarationType . Variable ) . Where ( item => item . IsWithEvents ) . ToArray ( ) ;
72
72
var events = withEventsFields . Select ( field =>
@@ -88,7 +88,7 @@ public DeclarationFinder(IReadOnlyList<Declaration> declarations, IEnumerable<IA
88
88
&& member . IdentifierName == item . WithEventsField . IdentifierName + "_" + evnt . IdentifierName ) )
89
89
} )
90
90
. ToDictionary ( item => item . WithEventsField , item => item . Handlers . ToArray ( ) )
91
- ) ) ;
91
+ ) , true ) ;
92
92
93
93
_undeclared = new ConcurrentDictionary < QualifiedMemberName , ConcurrentBag < Declaration > > ( new Dictionary < QualifiedMemberName , ConcurrentBag < Declaration > > ( ) ) ;
94
94
_unresolved = new ConcurrentBag < UnboundMemberDeclaration > ( new List < UnboundMemberDeclaration > ( ) ) ;
@@ -106,12 +106,12 @@ public DeclarationFinder(IReadOnlyList<Declaration> declarations, IEnumerable<IA
106
106
} ) ;
107
107
108
108
_interfaceMembers = new Lazy < ConcurrentDictionary < Declaration , Declaration [ ] > > ( ( ) =>
109
- new ConcurrentDictionary < Declaration , Declaration [ ] > ( interfaceMembers . ToDictionary ( item => item . InterfaceModule , item => item . InterfaceMembers . ToArray ( ) ) ) ) ;
109
+ new ConcurrentDictionary < Declaration , Declaration [ ] > ( interfaceMembers . ToDictionary ( item => item . InterfaceModule , item => item . InterfaceMembers . ToArray ( ) ) ) , true ) ;
110
110
111
111
var implementingNames = new Lazy < IEnumerable < string > > ( ( ) => implementsInstructions . SelectMany ( item =>
112
112
_declarations [ item . IdentifierReference . Declaration . QualifiedName . QualifiedModuleName ]
113
113
. Where ( member => member . DeclarationType . HasFlag ( DeclarationType . Member ) )
114
- . Select ( member => item . IdentifierReference . Declaration . IdentifierName + "_" + member . IdentifierName ) ) ) ;
114
+ . Select ( member => item . IdentifierReference . Declaration . IdentifierName + "_" + member . IdentifierName ) ) , true ) ;
115
115
116
116
var implementableMembers = implementsInstructions . Select ( item =>
117
117
new
@@ -123,7 +123,7 @@ public DeclarationFinder(IReadOnlyList<Declaration> declarations, IEnumerable<IA
123
123
124
124
_membersByImplementsContext = new Lazy < ConcurrentDictionary < VBAParser . ImplementsStmtContext , Declaration [ ] > > ( ( ) =>
125
125
new ConcurrentDictionary < VBAParser . ImplementsStmtContext , Declaration [ ] > (
126
- implementableMembers . ToDictionary ( item => item . Context , item => item . Members ) ) ) ;
126
+ implementableMembers . ToDictionary ( item => item . Context , item => item . Members ) ) , true ) ;
127
127
}
128
128
129
129
public IEnumerable < Declaration > Undeclared
0 commit comments