-
Notifications
You must be signed in to change notification settings - Fork 509
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
[Fluent] Source generators update #5522
[Fluent] Source generators update #5522
Conversation
Is this obsoleted by #5430? |
No. This is not related. This PR updates source generators packages and API usage to latest version. More work to be done here. |
For reference I am following patterns used in official samples updates from dotnet/roslyn-sdk#739 |
What's up here? Is this ready for review? |
No ready for review, a more work needed to finish. |
👀 |
PR is ready for review. |
Superseeds #5417
TODO
Reference
Changes
The biggest change is switch to new
ISyntaxContextReceiver
so the candidate symbols are filtered before processing using syntax receiver (this is simplest and fastest way to filter). TheOnVisitSyntaxNode
context has access toSemanticModel
so we can resolve candidates and filter them using e.g. attributes to some other desired pattern (e.g. ViewModel suffix).Second change is the that generated attributes (via. AddSource) are added in
Initialize
method instead ofExecute
and this simplifies processing isExecute
method.Also above two changes simplify how we retrieve compilation from
GeneratorExecutionContext
context (the RegisterForPostInitialization adds code to compilation before the syntax nodes are visited using SyntaxReceiver).Set IsRoslynComponent=true in generator project (VS capability that indicates that project supports component debugging).
Removed PropertyGenerator as we only use AutoNotifyGenerator.