简体   繁体   English

禁用intellij IDEA中的括号插入

[英]Disable parenthesis insertion in intellij IDEA

The auto insertion of parenthesis can get very annoying. 自动插入括号会很烦人。

Say I was typing object.get and it suggested object.getName , I'd select it and it inserts object.getName() and then by habit I type () and I end up with object.getName()(); 假设我正在输入object.get并建议使用object.getName ,我会选择它并插入object.getName() ,然后按习惯输入(),最后得到object.getName()();

And with object.setName it inserts object.setName( , so I end up with object.setName(("object name); 并且使用object.setName插入object.setName( ,所以我最终得到object.setName(("object name);

Is there a way to disable this annoying feature? 有没有办法禁用此烦人的功能?

My suggestion will be to try to get what Intellij IDEA gives. 我的建议是尝试获取Intellij IDEA的功能。 I think that the guys in JetBrains do quite good job. 我认为JetBrains中的人员做得很好。

About getters 关于吸气剂

When you choose some getter it will add it together with braces specially for you and will put the cursor after this because normally you shouldn't have any parameters to the getters. 当您选择某种吸气剂时,它将特别为您添加大括号,并在此之后放置光标,因为通常您对吸气剂没有任何参数。 Then you can straight away use some method from the object that you get or just type ; 然后,您可以直接从所获取的对象中使用某种方法,或者只是键入; and go for the next line. 并转到下一行。

About setters 关于二传手

In my IDEA (I am using the latest 13.1.4) when I add setter auto insertion adds method together with the braces as well, but puts the cursor between them because you should have a parameter which you are going to set to this object. 在我的IDEA(我使用的是最新的13.1.4)中,当我添加setter时,自动插入方法也将方法与括号一起添加,但是将光标置于它们之间,因为您应该有一个要设置为此对象的参数。

Seems to be quite comfortable to use. 似乎使用起来很舒服。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM