-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incremental Generator Work Tracking API Implementation #55469
Incremental Generator Work Tracking API Implementation #55469
Conversation
This comment has been minimized.
This comment has been minimized.
8059b7c
to
4891c50
Compare
f1da0a8
to
93292b6
Compare
bccf607
to
4fb1289
Compare
4fb1289
to
d1be32b
Compare
src/Compilers/Core/Portable/SourceGeneration/IncrementalContexts.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/IncrementalGeneratorRunStep.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/ValueSourceExtensions.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/TransformNode.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/TransformNode.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/TransformNode.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/TransformNode.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/WellKnownGeneratorInputs.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/SyntaxInputNode.cs
Outdated
Show resolved
Hide resolved
_transformTable.RemoveEntries(); | ||
_filterTable.TryRemoveEntries(TimeSpan.Zero, ImmutableArray<(IncrementalGeneratorRunStep, int)>.Empty, out ImmutableArray<SyntaxNode> removedNodes); | ||
|
||
for (int i = 0; i < removedNodes.Length; i++) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, beforehand we did not accurately create enough "Removed" entries in the table, but since entries with the Removed
state were ignored in later stages anyway (only kept in very specific scenarios), the bug was unnoticed.
src/Compilers/Core/Portable/SourceGeneration/Nodes/SyntaxInputNode.cs
Outdated
Show resolved
Hide resolved
@@ -65,20 +76,30 @@ public Builder(SyntaxReceiverInputNode owner, DriverStateTable driverStateTable) | |||
|
|||
public ISyntaxInputNode SyntaxInputNode { get => _owner; } | |||
|
|||
[MemberNotNullWhen(true, nameof(_inputSteps))] | |||
private bool TrackIncrementalSteps => _nodeStateTable.TrackIncrementalSteps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We produce the value for _nodeStateTable
in the constructor based partially on the trackIncrementalSteps
parameter in the constructor.
src/Compilers/Core/Portable/SourceGeneration/Nodes/SyntaxReceiverInputNode.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests.cs
Outdated
Show resolved
Hide resolved
…rator-work-tracking
@cston I've addressed your feedback and got CI on this PR back to green. Do you have any more feedback? |
Implement incremental generator work tracking API proposed in #54832 and update incremental generator API tests to use it to validate incrementality.
Fixes #54832