chkn / Xamarin.SwiftUI

.NET bindings for SwiftUI
MIT License
98 stars 7 forks source link

Improve C# experience with analyzer and source generator #19

Closed chkn closed 4 years ago

chkn commented 4 years ago

This introduces a C# source generator to bring a couple improvements:

There is also an accompanying analyzer to enforce a couple policies:

This also adds a NuGet dependency to automatically use a new enough build of the Roslyn compiler to enable the source generator in currently shipping Xamarin.iOS and Xamarin.Mac projects. However, if the system mono doesn't also contain a new enough build of Roslyn, the code fixes for the above analyses won't be available in VS Mac.

Still TODO:

CartBlanche commented 4 years ago

Hoping to play with this by the end of the week.