-
Notifications
You must be signed in to change notification settings - Fork 401
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
Source Generator for Bindable Property #1321
Conversation
src/CommunityToolkit.Maui.BindablePropertySG/BindablePropertySG.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.BindablePropertySG/BindablePropertySG.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.BindablePropertySG/BindablePropertySG.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.BindablePropertySG/BindablePropertySG.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.BindablePropertySG/BindablePropertySG.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.BindablePropertySG/Helpers/EquatableArray{T}.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.BindablePropertySG/Helpers/HashCode.cs
Outdated
Show resolved
Hide resolved
{ | ||
var data = attribute.ConstructorArguments[0]; | ||
|
||
return data.Value is null ? throw new NullReferenceException() : data.Value.ToString(); |
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.
should we add a message for NRE describing what is null?
Thanks Pedro! Just FYI - I renamed the new class and its namespace to This opens up the opportunity for us to use this And let's convert all of our |
Hey Pedro! This is looking really really cool! Could you add the ability to include XML comments in the attribute? Right now 👇 Maybe it'd look something like this? [BindableProperty<bool>("IsExpanded", PropertyChangedMethodName = nameof(OnIsExpandedPropertyChanged), XMLComment="<inheritdoc />")] |
@brminnick I didn't have a good approach for XML docs, because they can be small or big, and not sure how that will fit with SG... Maybe let this be solved when C# has OF course, you may have a bunch of |
@pictos do we need any unresolved issues or open questions? Can we merge this PR as it is? |
4542d2f
to
067a1ff
Compare
src/CommunityToolkit.Maui.SourceGenerators.Internal/BindablePropertyAttributeSourceGenerator.cs
Show resolved
Hide resolved
any news? |
4038c78
to
51ff4a9
Compare
… Solution Folder
…on`, Use Collection Expressions, Replace Strings with `nameof`
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.
Thanks Pedro! Thanks Vlad!
This will be used by the lib only, it shouldn't be part of our public nuget, because of that I deleted the template...
I'll point out the code areas that, I believe, can cause questions. In the future should be easier to port the code to the public SG project and delete this one
Fixes #542