intellij-idea - Intellij Idea - 完成下一个参数快捷方式
问题描述
示例:作者 author = new Author("Jack", "Daniels"); 在 Exlipce 中,当填写“Jack”并按下“enter”时 - 它会自动转到第二个参数并让我填写第二个参数。在 Intellij 中,我总是必须用鼠标单击或使用箭头键。Intellij 中是否有使其更快的快捷方式?我自己一个也找不到。
解决方案
自 IntelliJ 2018.2 起
您现在可以跳出右括号或使用 Tab 引用。
基本上,这意味着如果您有:
Author author = new Author("Jack<cursor>");
然后按Tab,光标会这样放置:
Author author = new Author("Jack"<cursor>);
注意:光标最初的位置无关紧要,只要您在引号内的某个位置,当您按下Tab光标时,光标就会移到外面并放在它后面。如果要输入下一个参数,则必须手动键入逗号和字符串。
该选项可以在下面找到:Settings -> Editor -> General -> Smart Keys
并且被称为Jump outside closing bracket/quote with Tab
还有一些其他有用的选项,比如insert pair quote
和insert pair brackets
。
如果您想更高级,可以查看Live Templates。
推荐阅读
- azure-data-factory - 在一项活动中解析多个 json 文件
- python - PySpark 中日期时间的四舍五入时间
- c# - 无法在对象“dbo.Account”中插入重复键。重复键值为 (2)
- php - 在 Laravel 5.7 中测试 PHP 单元测试之间的依赖关系
- embedded-linux - 构建 Petalinux 应用程序时出现“文件格式无法识别”
- c++ - C++ 派生类重写返回类型
- jenkins - 如何使用作业 dsl 配置基本的分支构建策略插件?
- ionic-framework - 离子中的本地通知
- search - 网格中最近点搜索的高效算法
- javascript - 如何保证 websocket 回调的有序处理结果?