switch code snippet power

Today I discovered the code snippet with the best timesaving ever: switch. You can use it from the snippet menu (CTRL + K, X)

or you can simply type switch and use code completion (CTRL + SPACE and TAB)

Then replace the switch_on placeholder with your expression and press arrow down. Now every enum value is a case statement. No more typing everything.

Whenever I find myself typing stuff that could be concluded from declarations I might end up using a code snippet.

About erictummers

Working in a DevOps team is the best thing that happened to me. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.