core icon indicating copy to clipboard operation
core copied to clipboard

enumgen: support ability to extend an original enum type with new string values

Open rcoreilly opened this issue 1 year ago • 1 comments

Describe the feature

code keymap extends core keymap.Functions with new key functions. It merges its add-on maps with the default core keymaps, which obviously can only know about the original Functions enum type. Therefore, to be able to properly view etc these updated keymaps, we need to be able to extend the original Functions enum string values from a different package.

given that enum data is not exported, this would require some kind of hook that the new package calls, to merge its values into the original data structures.

@kkoreilly also said he wants to think about more generics-based enum logic, which might help with this.

This is a very general issue with any app extending keymap.Functions, and may be relevant to icons, and is a generally useful feature to support for any enum type.

Relevant code

No response

rcoreilly avatar Jun 04 '24 21:06 rcoreilly

Reminder that icons are not enums.

kkoreilly avatar Jun 04 '24 21:06 kkoreilly