在IntelliJ IDEA中的参数列表中,如何在方法调用后添加分号? [英] How to add semicolon after method call when inside parameter list in IntelliJ IDEA?

查看:206
本文介绍了在IntelliJ IDEA中的参数列表中,如何在方法调用后添加分号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我终于通过Eclipse将这次航行带回了IntelliJ。目前我的Eclipse已设置好,如果我目前有一个这样的语句(其中^表示我的光标当前所在的位置):

I'm finally making the voyage back to IntelliJ via Eclipse. Currently my Eclipse is set up so that if I currently have a statement such as this (where ^ denotes where my cursor currently sits):

foo.bar("hello"^)

我点击了分号(;)键,它会自动将分号放在语句的末尾:

and I hit the semi-colon (;) key, it will automatically put the semi-colon at the end of the statement:

foo.bar("hello");

目前IntelliJ执行此操作:

Currently IntelliJ does this:

foo.bar("hello";)

意思是我将拥有在键入分号之前显式键入右括号。

Meaning I will have to explicitly type the closing bracket before typing the semi-colon.

显然不是一个很大的问题,但我发现自己将分号放在错误的地方几次今天,当我转换回IntelliJ并认为它可能更有效(对于我的手指和大脑)不必键入结束括号。

Not a huge problem obviously but I have found myself putting the semi-colon in the wrong place a few times today as I make the transition back to IntelliJ and thought that it may be more efficient (for both my fingers and brain) not to have to type the closing bracket.

推荐答案

对于 Windows 用户, Ctrl + Shift + 输入

For Windows users, Ctrl+Shift+Enter.

对于 macOS / OS X 用户,⌘命令 + ⇧Shift + 输入

For macOS/OS X users, ⌘ Command+⇧ Shift+Enter.

完成您目前正在撰写的声明。在几种不同的情况下尝试它,比如if语句,for循环等,你会看到它会完成这一行并在必要时为你打开一些花括号。

That finishes the statement you're currently writing. Try it in a few different situations, like in if statements, for loops etc, and you'll see that it'll complete the line and open some curly braces for you if necessary.

这篇关于在IntelliJ IDEA中的参数列表中,如何在方法调用后添加分号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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