Switch enum auto-fill

后端 未结 9 2083
故里飘歌
故里飘歌 2020-12-24 00:23

I was typing a switch with an enum in VS 2013 and all case statements filled out automatically after I finished the switch. Now I can\'t repeat it. I was not hallucinating,

9条回答
  •  梦毁少年i
    2020-12-24 00:46

    I've written a free and open source extension, based on Roslyn, for Visual Studio 2015 and 2017, that not only allows to fill the switch case for an enum, but is also capable of adding new cases if enum values (fields) have been added to the enum type definition, or sort the list of cases by value or name.

    It's available here: Enum Case Generator

    This is how to use it:

提交回复
热议问题