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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For enum variables, enter
switch (myEnumVar)and press Alt+Enter. Smart completion will suggest:Create missing 'switch' branchesCrazy Coder provided the following screenshot showing how to enable the Create Enum Switch Branches intention.
See YouTrack issue 6374.