generated from nvim-treesitter/module-template
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Hello,
I've just found this plugin, which looks very interesting.
A thing I have to do sometimes is create switch statements for enum-types, mapping out every single element. So I'd propose a feature request, to generate switch statements from enum definitions.
For example from
enum Seasons {
SPRING, SUMMER, FALL, WINTER
};
Generate:
Seasons s = // ...
switch ( s ) {
case SPRING:
break;
case SUMMER:
break;
case FALL:
break;
case WINTER:
break;
}
While we're at it, a separate function to generate a code to convert the enum from String and to String would be swell as well. E.g.
std::string txt = // ...
if ( txt == "WINTER" ) {
return WINTER;
} else if ( ...
and
Seasons s = // ...
switch ( s ) {
case SPRING:
return "SPRING";
case ...
This is just a feature request. Thank you for your work, even if you don't find this feature interesting enough the implement.
Kind Regards,
snaums
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers