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

Source generated formatters that support private members #1802

Merged
merged 5 commits into from May 7, 2024
Merged

Conversation

AArnott
Copy link
Collaborator

@AArnott AArnott commented Apr 20, 2024

Closes #1745

@AArnott AArnott changed the base branch from master to develop April 20, 2024 03:44
@AArnott AArnott added this to the v3.0 milestone Apr 20, 2024
@AArnott AArnott force-pushed the fix1745 branch 3 times, most recently from cc9590f to 69a3911 Compare April 22, 2024 15:24
@AArnott AArnott requested a review from neuecc April 22, 2024 15:24
@AArnott AArnott marked this pull request as ready for review April 22, 2024 15:24
@AArnott
Copy link
Collaborator Author

AArnott commented Apr 22, 2024

I still need to add reporting of the added diagnostics.

As the formatter must have access (per C# rules) to the private members, the formatter must be nested under the data type.
This requires the data type (and any nesting types of that data type) to be declared as `partial` so that the source generated code can add the formatter as an `internal` member of it.
Since traditionally data types haven't been required to be partial, we only nest the formatter under the data type when private members must be serialized; otherwise we continue to generate the formatter as nested under the generated resolver.

Closes #1745
@neuecc
Copy link
Member

neuecc commented Apr 30, 2024

thanks, I'll check soon(1-2days)

@AArnott
Copy link
Collaborator Author

AArnott commented May 6, 2024

Last call, @neuecc. :)

@neuecc
Copy link
Member

neuecc commented May 7, 2024

Sorry.
I'll look at it now.

Copy link
Member

@neuecc neuecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the very delayed check.
I checked the feature and impl, it is good!

@AArnott AArnott merged commit 3d80df1 into develop May 7, 2024
5 checks passed
@AArnott AArnott deleted the fix1745 branch May 7, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source generate formatters as nested under the types they format for private member access
2 participants