Skip to content

Commit b0232a0

Browse files
committed
Merge branch 'BugBlipper'
2 parents c858fc6 + cb3fcc8 commit b0232a0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

RetailCoder.VBE/App.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private void ParseComponentAsync(VBComponent component, bool resolve = true)
154154
var tokenSource = RenewTokenSource(component);
155155

156156
var token = tokenSource.Token;
157-
_parser.ParseAsync(component, token).Wait(token);
157+
_parser.ParseAsync(component, token);
158158

159159
if (resolve && !token.IsCancellationRequested)
160160
{
@@ -216,8 +216,6 @@ private void ParseAll()
216216
_parser.Resolve(tokenSource.Token);
217217
}
218218
}
219-
220-
var v = _parser.State.AllDeclarations.Where(d => !d.IsBuiltIn);
221219
}
222220

223221
private void CleanReloadConfig()

Rubberduck.Parsing/VBA/RubberduckParser.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ public RubberduckParser(RubberduckParserState state)
2828
private readonly RubberduckParserState _state;
2929
public RubberduckParserState State { get { return _state; } }
3030

31-
public async Task ParseAsync(VBComponent vbComponent, CancellationToken token)
31+
public Task ParseAsync(VBComponent vbComponent, CancellationToken token)
3232
{
3333
var component = vbComponent;
3434

35+
token.ThrowIfCancellationRequested();
3536
var parseTask = Task.Run(() => ParseInternal(component, token), token);
3637

3738
try
3839
{
39-
await parseTask;
40+
token.ThrowIfCancellationRequested();
41+
parseTask.Wait(token);
4042
}
4143
catch (SyntaxErrorException exception)
4244
{
@@ -45,7 +47,9 @@ public async Task ParseAsync(VBComponent vbComponent, CancellationToken token)
4547
catch (OperationCanceledException)
4648
{
4749
// no need to blow up
48-
}
50+
}
51+
52+
return null;
4953
}
5054

5155
public void Resolve(CancellationToken token)

0 commit comments

Comments
 (0)