Is there really no way to generate a switch case for a given variable in IntelliJ?
Ctrl+Space as well as Ctrl+J yield no results.
For enum variables, enter switch (myEnumVar) and press Alt+Enter. Smart completion will suggest: Create missing 'switch' branches
switch (myEnumVar)
Create missing 'switch' branches
Crazy Coder provided the following screenshot showing how to enable the Create Enum Switch Branches intention.
See YouTrack issue 6374.
2.1m questions
2.1m answers
60 comments
57.0k users