Skip to content

Commit a5c55c9

Browse files
authored
Merge pull request #2778 from MDoerner/ReparsingModulesInNonReadyState
Added reparsing of modules not in the ready state.
2 parents e5e692f + 3d0d920 commit a5c55c9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Rubberduck.Parsing/VBA/ParseCoordinator.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private void CleanUpComponentAttributes(ICollection<IVBComponent> components)
197197
}
198198
}
199199

200-
private void ExecuteCommonParseActivities(List<IVBComponent> toParse, CancellationToken token)
200+
private void ExecuteCommonParseActivities(ICollection<IVBComponent> toParse, CancellationToken token)
201201
{
202202
token.ThrowIfCancellationRequested();
203203

@@ -256,7 +256,7 @@ private void RefreshDeclarationFinder()
256256
State.RefreshFinder(_hostApp);
257257
}
258258

259-
private void SetModuleStates(List<IVBComponent> components, ParserState parserState, CancellationToken token)
259+
private void SetModuleStates(ICollection<IVBComponent> components, ParserState parserState, CancellationToken token)
260260
{
261261
var options = new ParallelOptions();
262262
options.CancellationToken = token;
@@ -315,7 +315,7 @@ private void RemoveReferences(IEnumerable<Declaration> declarations, ICollection
315315
}
316316
}
317317

318-
private void ParseComponents(List<IVBComponent> components, CancellationToken token)
318+
private void ParseComponents(ICollection<IVBComponent> components, CancellationToken token)
319319
{
320320
token.ThrowIfCancellationRequested();
321321

@@ -410,7 +410,7 @@ private void ProcessComponentParseResults(IVBComponent component, Task<Component
410410
}
411411

412412

413-
private void ResolveAllDeclarations(List<IVBComponent> components, CancellationToken token)
413+
private void ResolveAllDeclarations(ICollection<IVBComponent> components, CancellationToken token)
414414
{
415415
token.ThrowIfCancellationRequested();
416416

@@ -719,7 +719,11 @@ private void ParseAllInternal(object requestor, CancellationToken token)
719719

720720
token.ThrowIfCancellationRequested();
721721

722-
var toParse = components.Where(component => State.IsNewOrModified(component)).ToList();
722+
var toParse = components.Where(component => State.IsNewOrModified(component)).ToHashSet();
723+
724+
token.ThrowIfCancellationRequested();
725+
726+
toParse.UnionWith(components.Where(component => State.GetModuleState(component) != ParserState.Ready));
723727

724728
token.ThrowIfCancellationRequested();
725729

0 commit comments

Comments
 (0)