anzwdev / al-code-outline

AL Code Outline for Visual Studio Code
MIT License
51 stars 13 forks source link

If Expression in a Case-statement is an option/enum list all members #501

Closed Floris-G closed 11 months ago

Floris-G commented 1 year ago

Is it possible to create a Case-statement for an option/enum where all members are automatically listed? Such a feature exists in C#, but I would find it very nice for AL too.

Example:

Enum Prize with three values bronze, silver and gold.

When typing Case Prize of... I would like to have the option to fill the Case like this: Case Prize of Bronze: begin end; Silver: begin end; Gold: begin end; end;

When having to write code for enums with lots of members in it this feature would save lots of time.

anzwdev commented 11 months ago

Thank you for the idea. I've implemented in and released in the latest version of the extension (3.0.54).

The change adds a new code action to the case statement: image