[3.0] Apply MaybeBool transformation to fields/properties#2574
Open
Exanite wants to merge 14 commits into
Open
[3.0] Apply MaybeBool transformation to fields/properties#2574Exanite wants to merge 14 commits into
Exanite wants to merge 14 commits into
Conversation
…for simplicity The performance difference is negligible.
Not actually sure if this is ever going to be used, but I guess it will at least be consistent in behavior with BoolTransformer
Contributor
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 783e662 |
Exanite
commented
May 18, 2026
Member
Author
Exanite
left a comment
There was a problem hiding this comment.
Self review completed. Note that OpenAL/GL don't really have structs so no bindings changes there.
| /// Types to treat as boolean and their boolean schemes if different to default. | ||
| /// Types to treat as boolean and their boolean schemes if different from the default. | ||
| /// </summary> | ||
| public Dictionary<string, string?>? BoolTypes { get; init; } |
Member
Author
There was a problem hiding this comment.
Saving an allocation is not worth the complexity of null checking. Also, performance difference is negligible either way.
| node.AttributeLists.GetNativeTypeName() ?? node.Declaration.Type.ToString(); | ||
| if ( | ||
| config.BoolTypes.TryGetValue(nativeType, out var scheme) | ||
| || (nativeType == "bool" && node.Declaration.Type.ToString().Trim() != "bool") // stdbool.h, hopefully... |
Member
Author
There was a problem hiding this comment.
I'm not familiar enough with C library headers (specifically, where bool might be used) to say whether the bool handling here is important or not. This just copies the behavior from BoolTransformer.
Exanite
commented
May 18, 2026
This was used by the syntax-based renamer (extremely old at this point)
Exanite
commented
May 20, 2026
| /// </summary> | ||
| /// <param name="syn">The member with the identifiers.</param> | ||
| /// <returns>The identifiers.</returns> | ||
| public static IEnumerable<string> MemberIdentifiers(this MemberDeclarationSyntax syn) => |
Member
Author
There was a problem hiding this comment.
This is leftover code from the old, old syntax-based renamer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
This adds MaybeBool transformation to fields and properties in
TransformProperties, similar to howBoolTransformerforTransformFunctionscurrently works.Related issues, Discord discussions, or proposals
Discord thread: https://discord.com/channels/521092042781229087/1499733234714546286
Further Comments
Tasks: