Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate switch statement labels on Visual Studio Code?

I want to generate switch statement labels in Visual Studio Code. I searched Google, the extensions marketplace, and the command pallete, but I didn't find anything. Is this action available?

like image 896
Atori Avatar asked Oct 18 '25 14:10

Atori


2 Answers

This works with the OmniSharp extension:

enter image description here

More info here: https://github.com/OmniSharp/omnisharp-vscode/issues/1752

like image 105
opus131 Avatar answered Oct 21 '25 04:10

opus131


No, it is not available.

Visual studio code is a simple editor and hasn't capability like visual studio IDE and can't do this.

In Visual studio 2015 IDE You can generate switch statement labels for enumeration as: 1) write "switch" 2) press two times TAB for details, read Switch enum auto-fill

Also Resharper tool (integerated with Visual studio IDE) can do the same.

For details read: https://blog.jetbrains.com/dotnet/2006/06/14/quick-fixes-help-generate-switch-blocks/

like image 31
M.Hassan Avatar answered Oct 21 '25 03:10

M.Hassan