-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Remove STJ dependency on IncrementalValuesProvider.Collect() #86616
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
Remove STJ dependency on IncrementalValuesProvider.Collect() #86616
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis Issue DetailsAddresses the last outstanding issue from #68353, namely
Slightly refactors the
|
|
|
||
| namespace System.Text.Json.SourceGeneration | ||
| { | ||
| public sealed partial class JsonSourceGenerator |
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.
Moves the Diagnostic descriptors to a standalone file for easier access.
| JsonSourceGenerationMode generationMode, | ||
| CancellationToken cancellationToken) | ||
| { | ||
| IEnumerable<SyntaxNode> attributeArguments = attributeSyntax.DescendantNodes().Where(node => node is AttributeArgumentSyntax); |
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.
Logic moved to ParseJsonSerializableAttribute
|
|
||
| List<ContextGenerationSpec>? contextGenSpecList = null; | ||
|
|
||
| foreach (IGrouping<SyntaxTree, ClassDeclarationSyntax> group in classDeclarationSyntaxList.GroupBy(c => c.SyntaxTree)) |
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.
This grouping was originally included to amortise the cost of the expensive compilation.GetSemanticModel method. However the semantic model is provided to us by the source generator context types, so calling the method is not actually necessary.
Addresses the last outstanding issue from #68353, namely
Slightly refactors the
ParserandEmitterclasses so that they can be used with singularJsonSerializerContextdeclarations, allowing the incremental generator to generate source code for each of its inputs independently and on-demand.Fix #68353.