Skip to content

Commit 2b8c71a

Browse files
committed
Remove dead code and make resolver run on non-UI thread.
1 parent 2becea5 commit 2b8c71a

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

Rubberduck.Parsing/VBA/RubberduckParser.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ public RubberduckParser(
6262
private void StateOnStateChanged(object sender, EventArgs e)
6363
{
6464
Logger.Debug("RubberduckParser handles OnStateChanged ({0})", _state.Status);
65-
66-
/*if (_state.Status == ParserState.Parsed)
67-
{
68-
_logger.Debug("(handling OnStateChanged) Starting resolver task");
69-
Resolve(_central.Token); // Tests expect this to be synchronous
70-
}*/
7165
}
7266

7367
private void ReparseRequested(object sender, ParseRequestEventArgs e)
@@ -83,10 +77,13 @@ private void ReparseRequested(object sender, ParseRequestEventArgs e)
8377
ParseAsync(e.Component, CancellationToken.None).Wait();
8478

8579
Logger.Trace("Starting resolver task");
86-
Resolve(_central.Token); // Tests expect this to be synchronous
80+
Task.Run(() => Resolve(_central.Token));
8781
}
8882
}
8983

84+
/// <summary>
85+
/// For the use of tests only
86+
/// </summary>
9087
public void Parse()
9188
{
9289
if (!_state.Projects.Any())
@@ -113,12 +110,6 @@ public void Parse()
113110
_componentAttributes.Remove(invalidated);
114111
}
115112

116-
/*foreach (var vbComponent in components)
117-
{
118-
_state.ClearStateCache(vbComponent);
119-
ParseComponent(vbComponent);
120-
}*/
121-
122113
var parseTasks = components.Select(vbComponent => ParseAsync(vbComponent, CancellationToken.None)).ToArray();
123114
Task.WaitAll(parseTasks);
124115

@@ -180,7 +171,7 @@ private void ParseAll()
180171
Task.WaitAll(parseTasks);
181172

182173
Logger.Trace("Starting resolver task");
183-
Resolve(_central.Token); // Tests expect this to be synchronous
174+
Task.Run(() => Resolve(_central.Token));
184175
}
185176

186177
private void AddBuiltInDeclarations(IReadOnlyList<VBProject> projects)

0 commit comments

Comments
 (0)