IntelliJ自动完成功能替换功能名称 [英] IntelliJ autocomplete to replace the function name
问题描述
我已经从Eclipse切换到IntelliJ,有些东西我也找不到,谷歌:
I've switched from Eclipse to IntelliJ and there is something which I couldn't find yet nor google:
如何获取自动完成功能以替换功能名称? 在Eclipse中,它是 ctrl + enter 功能.
How to get the autocomplete to replace the name of the function? In Eclipse, it would be the ctrl+enter functionality.
例如
userController.setAmount();
假设我不想叫setAmount()
而是setDefaultPassword()
,我将插入符号放在set
之后,然后将 ctrl + 空格放置为自动完成, setDefaultPassword()
出现,但是如果我按Enter键,它将不会替换Amount()
,最后我会得到
suppose I would like not to call the setAmount()
but a setDefaultPassword()
, I place my caret after the set
then ctrl+space to autocomplete, the setDefaultPassword()
shows up but if I press enter, it won't replace Amount()
and I'll end up with
userController.setDefaultPassword();Amount();
所以很明显,我想要用setDefaultPassword()
替换setAmount()
.
So obviously what I wanted is to replace the setAmount()
by setDefaultPassword()
.
推荐答案
按Tab键而不是Enter键以选择项目,然后标识符将被替换.另请参见 http://jetbrains.dzone.com/articles/top-20- code-completions-intellij-idea
Press Tab instead of Enter to select the item, and the identifier will be replaced. See also http://jetbrains.dzone.com/articles/top-20-code-completions-in-intellij-idea
这篇关于IntelliJ自动完成功能替换功能名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!