Skip to content

Commit 2c54a19

Browse files
authored
Merge pull request #1810 from Hosch250/parserIssues
Make parser/resolver run more asynchronously.
2 parents 004c054 + dab5be0 commit 2c54a19

File tree

3 files changed

+693
-206
lines changed

3 files changed

+693
-206
lines changed

Rubberduck.Parsing/VBA/ComponentParseTask.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,26 @@ public void Start(CancellationToken token)
7575
Tokens = stream,
7676
Attributes = attributes,
7777
Comments = comments,
78-
Annotations = annotationListener.Annotations
78+
Annotations = annotationListener.Annotations,
79+
Component = _component
7980
});
8081
}
8182
catch (COMException exception)
8283
{
8384
_logger.Error(exception, "Exception thrown in thread {0}.", Thread.CurrentThread.ManagedThreadId);
8485
ParseFailure.Invoke(this, new ParseFailureArgs
8586
{
86-
Cause = exception
87+
Cause = exception,
88+
Component = _component
8789
});
8890
}
8991
catch (SyntaxErrorException exception)
9092
{
9193
_logger.Error(exception, "Exception thrown in thread {0}.", Thread.CurrentThread.ManagedThreadId);
9294
ParseFailure.Invoke(this, new ParseFailureArgs
9395
{
94-
Cause = exception
96+
Cause = exception,
97+
Component = _component
9598
});
9699
}
97100
catch (OperationCanceledException)
@@ -124,6 +127,7 @@ private IEnumerable<CommentNode> QualifyAndUnionComments(QualifiedModuleName qua
124127

125128
public class ParseCompletionArgs
126129
{
130+
public VBComponent Component { get; internal set; }
127131
public ITokenStream Tokens { get; internal set; }
128132
public IParseTree ParseTree { get; internal set; }
129133
public IDictionary<Tuple<string, DeclarationType>, Attributes> Attributes { get; internal set; }
@@ -133,6 +137,7 @@ public class ParseCompletionArgs
133137

134138
public class ParseFailureArgs
135139
{
140+
public VBComponent Component { get; internal set; }
136141
public Exception Cause { get; internal set; }
137142
}
138143

0 commit comments

Comments
 (0)