Closed fvet closed 2 years ago
Sounds good. I'll add it. But what about the location of the new file? The "CRS: Reorganize - Current file" could be an option, but if some people use it differently.. Maybe it's also an option to place it at the same directory as the current file?
Hi Frédéric, I've released a new version v1.0.7 which has this feature included. See the demo in the demo section of my readme. https://github.com/DavidFeldhoff/al-codeactions#refactor-option-to-enum I'm looking forward to your feedback!
Hi @DavidFeldhoff, thanks for this new feature, it works super!
One small remark:
I tend to add ', Locked = true' for blank options (' '), since those require no translations.
So instead of ...
value(0; " ")
{
Caption = ' ';
}
... I normally add
value(0; " ")
{
Caption = ' ', Locked = true;
}
That makes much sense indeed. I'll add it definitely.
The 'Locked = true' update seems not yet to be included in the v1.0.8 version.
Yes, you're totally right, I have gotten over it. I noticed it after the release, that's why I've removed the released label. Nevertheless, thanks for the reminder.
In v1.0.9 it's added 😉
It would be nice if we could have a code action that allows (on a table field of datatype 'option') the creation of a new enum (new enum name to be asked via commandpalette) based on the OptionMembers / OptionCaption and replace the datatype of the table field by the new enum (+ remove OptionCaption / OptionMembers)
Before
After