Skip to content
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

Merged

Conversation

wieslawsoltes
Copy link
Contributor

@wieslawsoltes wieslawsoltes commented Apr 2, 2021

Superseeds #5417

TODO

  • Updates source generators to latest Roslyn API

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). The OnVisitSyntaxNode context has access to SemanticModel 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 of Execute and this simplifies processing is Execute 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.

@molnard
Copy link
Contributor

molnard commented Apr 8, 2021

Is this obsoleted by #5430?

@wieslawsoltes
Copy link
Contributor Author

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.

@wieslawsoltes
Copy link
Contributor Author

For reference I am following patterns used in official samples updates from dotnet/roslyn-sdk#739

@molnard
Copy link
Contributor

molnard commented May 3, 2021

What's up here? Is this ready for review?

@wieslawsoltes
Copy link
Contributor Author

What's up here? Is this ready for review?

No ready for review, a more work needed to finish.

@molnard
Copy link
Contributor

molnard commented Aug 17, 2021

👀

@pull-request-size pull-request-size bot added size/L and removed size/M labels Aug 18, 2021
@wieslawsoltes wieslawsoltes marked this pull request as ready for review August 18, 2021 09:03
@wieslawsoltes
Copy link
Contributor Author

PR is ready for review.

@danwalmsley danwalmsley merged commit ed72d8d into WalletWasabi:master Aug 23, 2021
@wieslawsoltes wieslawsoltes deleted the vdg/SourceGeneratorsUpdate branch September 3, 2021 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants