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

Add support for nullable enums, and improve standalone facets #86

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

Nytra
Copy link
Contributor

@Nytra Nytra commented Dec 22, 2024

This works, however there is a bit of semi-duplicated code because the handling for this needs to be slightly different from the normal handling of config keys

Also I'm not sure if these work with the standalone facets (haven't tested it yet)

@Nytra Nytra requested a review from Banane9 December 22, 2024 20:01
@Nytra
Copy link
Contributor Author

Nytra commented Dec 22, 2024

There are some test keys for this in TooltipConfig that might need to be removed

@Nytra
Copy link
Contributor Author

Nytra commented Dec 23, 2024

I'm pretty sure the last commits broke normal config keys (non-nullable ones)

@Nytra
Copy link
Contributor Author

Nytra commented Dec 23, 2024

I would also like to look at consolidating the enum flags generation since right now there are two methods that do it

@Banane9
Copy link
Member

Banane9 commented Dec 23, 2024

Hmmm, seemed fine when I gave it a quick test, but definitely have a look at it. And yea, consolidating the enum generation would be nice. If you want, you can have a go at creating the "sync bool field with (nullable) enum value" methods that I mentioned in fieldextensions too. They'd basically do what the settings do now.

@Nytra
Copy link
Contributor Author

Nytra commented Dec 23, 2024

The only problem with this now is that you cannot turn off the NONE flag (Flag 0) in the test flag enums. This is likely something wrong in GenerateFlagsEnumFields

edit: actually that might not be a bug, it might just be how bitflags work

@Banane9
Copy link
Member

Banane9 commented Dec 23, 2024

Yea, ANDing a full zero pattern always matches with the zero pattern in the end. Flags don't need a None option in that sense.

@Nytra Nytra changed the title Add nullable enums Add support for nullable enums, and improve standalone facets Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants