Skip to content

Commit

Permalink
Added reparsing of modules not in the ready state.
Browse files Browse the repository at this point in the history
  • Loading branch information
MDoerner committed Mar 3, 2017
1 parent e5e692f commit 3d0d920
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Rubberduck.Parsing/VBA/ParseCoordinator.cs
Expand Up @@ -197,7 +197,7 @@ private void CleanUpComponentAttributes(ICollection<IVBComponent> components)
}
}

private void ExecuteCommonParseActivities(List<IVBComponent> toParse, CancellationToken token)
private void ExecuteCommonParseActivities(ICollection<IVBComponent> toParse, CancellationToken token)
{
token.ThrowIfCancellationRequested();

Expand Down Expand Up @@ -256,7 +256,7 @@ private void RefreshDeclarationFinder()
State.RefreshFinder(_hostApp);
}

private void SetModuleStates(List<IVBComponent> components, ParserState parserState, CancellationToken token)
private void SetModuleStates(ICollection<IVBComponent> components, ParserState parserState, CancellationToken token)
{
var options = new ParallelOptions();
options.CancellationToken = token;
Expand Down Expand Up @@ -315,7 +315,7 @@ private void RemoveReferences(IEnumerable<Declaration> declarations, ICollection
}
}

private void ParseComponents(List<IVBComponent> components, CancellationToken token)
private void ParseComponents(ICollection<IVBComponent> components, CancellationToken token)
{
token.ThrowIfCancellationRequested();

Expand Down Expand Up @@ -410,7 +410,7 @@ private void ProcessComponentParseResults(IVBComponent component, Task<Component
}


private void ResolveAllDeclarations(List<IVBComponent> components, CancellationToken token)
private void ResolveAllDeclarations(ICollection<IVBComponent> components, CancellationToken token)
{
token.ThrowIfCancellationRequested();

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

token.ThrowIfCancellationRequested();

var toParse = components.Where(component => State.IsNewOrModified(component)).ToList();
var toParse = components.Where(component => State.IsNewOrModified(component)).ToHashSet();

token.ThrowIfCancellationRequested();

toParse.UnionWith(components.Where(component => State.GetModuleState(component) != ParserState.Ready));

token.ThrowIfCancellationRequested();

Expand Down

0 comments on commit 3d0d920

Please sign in to comment.