IntelliJ:生成开关盒 [英] IntelliJ: Generate switch case

查看:113
本文介绍了IntelliJ:生成开关盒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否真的无法为IntelliJ中的给定变量生成开关案例?



Ctrl + Space以及Ctrl + J不会产生任何结果。

解决方案

对于枚举变量,输入 switch(myEnumVar)并按 ALT + 输入。智能完成将建议:创建缺少的'switch'分支




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

Crazy Coder provided the following screenshot showing how to enable the Create Enum Switch Branches intention.

See YouTrack issue 6374.

这篇关于IntelliJ:生成开关盒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆