@@ -109,23 +109,23 @@ public void Parse(CancellationTokenSource token)
109
109
// tests do not fire events when components are removed--clear components
110
110
ClearComponentStateCacheForTests ( ) ;
111
111
112
- ExecuteCommenParseActivities ( components , token ) ;
112
+ // invalidation cleanup should go into ParseAsync?
113
+ CleanUpComponentAttributes ( components ) ;
114
+
115
+ ExecuteCommonParseActivities ( components , token ) ;
113
116
114
117
}
115
118
116
- private void ExecuteCommenParseActivities ( List < IVBComponent > components , CancellationTokenSource token )
119
+ private void ExecuteCommonParseActivities ( List < IVBComponent > toParse , CancellationTokenSource token )
117
120
{
118
- SetModuleStates ( components , ParserState . Pending ) ;
121
+ SetModuleStates ( toParse , ParserState . Pending ) ;
119
122
120
123
SyncComReferences ( State . Projects ) ;
121
124
RefreshDeclarationFinder ( ) ;
122
125
123
126
AddBuiltInDeclarations ( ) ;
124
127
RefreshDeclarationFinder ( ) ;
125
128
126
- // invalidation cleanup should go into ParseAsync?
127
- CleanUpComponentAttributes ( components ) ;
128
-
129
129
if ( token . IsCancellationRequested )
130
130
{
131
131
return ;
@@ -134,14 +134,14 @@ private void ExecuteCommenParseActivities(List<IVBComponent> components, Cancell
134
134
_projectDeclarations . Clear ( ) ;
135
135
State . ClearBuiltInReferences ( ) ;
136
136
137
- ParseComponents ( components , token . Token ) ;
137
+ ParseComponents ( toParse , token . Token ) ;
138
138
139
139
if ( token . IsCancellationRequested || State . Status >= ParserState . Error )
140
140
{
141
141
return ;
142
142
}
143
143
144
- ResolveAllDeclarations ( components , token . Token ) ;
144
+ ResolveAllDeclarations ( toParse , token . Token ) ;
145
145
RefreshDeclarationFinder ( ) ;
146
146
147
147
if ( token . IsCancellationRequested || State . Status >= ParserState . Error )
@@ -198,8 +198,8 @@ private void ParseComponents(List<IVBComponent> components, CancellationToken to
198
198
options ,
199
199
component =>
200
200
{
201
- State . ClearStateCache ( component ) ;
202
201
State . SetModuleState ( component , ParserState . Parsing ) ;
202
+ State . ClearStateCache ( component ) ;
203
203
var finishedParseTask = FinishedParseComponentTask ( component , token ) ;
204
204
ProcessComponentParseResults ( component , finishedParseTask ) ;
205
205
}
@@ -255,6 +255,7 @@ private void ProcessComponentParseResults(IVBComponent component, Task<Component
255
255
}
256
256
}
257
257
258
+
258
259
private void ResolveAllDeclarations ( List < IVBComponent > components , CancellationToken token )
259
260
{
260
261
var options = new ParallelOptions ( ) ;
@@ -288,9 +289,12 @@ private void ParseAll(object requestor, CancellationTokenSource token)
288
289
State . RefreshProjects ( _vbe ) ;
289
290
290
291
var components = State . Projects . SelectMany ( project => project . VBComponents ) . ToList ( ) ;
291
-
292
+
292
293
var componentsRemoved = ClearStateCashForRemovedComponents ( components ) ;
293
-
294
+
295
+ // invalidation cleanup should go into ParseAsync?
296
+ CleanUpComponentAttributes ( components ) ;
297
+
294
298
var toParse = components . Where ( component => State . IsNewOrModified ( component ) ) . ToList ( ) ;
295
299
296
300
if ( toParse . Count == 0 )
@@ -304,7 +308,7 @@ private void ParseAll(object requestor, CancellationTokenSource token)
304
308
//return; // returning here leaves state in 'ResolvedDeclarations' when a module is removed, which disables refresh
305
309
}
306
310
307
- ExecuteCommenParseActivities ( components , token ) ;
311
+ ExecuteCommonParseActivities ( toParse , token ) ;
308
312
}
309
313
310
314
/// <summary>
0 commit comments