代码完成后 NetBeans 参数填充
这是我遇到的一个特别烦人的问题,我不可能是唯一一个对此有问题的人。
在 NetBeans 中,当您键入方法的一部分,然后按 CTRL-SPACE 时,它会显示代码完成弹出窗口,您可以按 Tab 键完成该单词。这太棒了,几乎所有 IDE 都是这样运行的。
示例:
Thread.sl
< CTRL-空格键 >
Thread.sleep
耶!
问题是,在这种情况下,一旦您输入括号,它就会自动用默认名称填充方法的参数,并插入结束括号(无论您是否在首选项页面上禁用了自动关闭它们的选项)用于代码完成)。如果您手动输入全名,则不会出现此行为。
这对任何人有什么帮助?您必须在其上键入要传递的实际变量,并且 NetBeans 没有为您提供阻止代码完成时关闭括号的选项。
有谁有办法解决这个问题,而不必深入研究 netbeans 源代码并仅为这个小问题构建它?
This is a particularly annoying problem I'm having, and I can't be the only one to have issue with it.
In NetBeans, when you type part of a method, then hit CTRL-SPACE, it displays the code-completion popup, whereupon you can hit tab to finish out the word. This is great, and pretty much how all IDE's operate.
Example:
Thread.sl
< CTRL-SPACE >
Thread.sleep
Yay!
Problem is that in this context, once you type in a paren, it auto-fills the parameters for the method with their default names, and inserts a closing paren (regardless of whether you have disabled the option to automatically close them on the preferences page for code completion). This behavior is NOT present if you had manually typed out the full name.
How is this helpful to anyone? You've got to type over it your actual variable that you will be passing, and NetBeans gives you no option to prevent the closing paren on code-completion.
Does anyone have a way to solve this issue, without having to dive into the netbeans source and build it just for this minor of an issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该选项适用于方括号,而不是圆括号。
从完成选择器列表中删除左括号。
替代文本 http://img411.imageshack.us/img411/7287/netbeanscodeassist.png< /a>
That option is for brackets, not parentheses.
Remove the opening parenthesis from the list of completion selectors.
alt text http://img411.imageshack.us/img411/7287/netbeanscodeassist.png
您使用什么版本的 netbeans?
对于我来说(NB 6.9 RC1),当我用参数编写完成一个方法时,我可以使用 RETURN 逐一编辑所有参数,以从一个参数转到另一个参数。非常简单,建议参数是正确的1/2。
请参阅NetBeans 中的代码帮助中的建议参数 IDE Java 编辑器:参考指南/智能代码完成
What version of netbeans do you use ?
For me (NB 6.9 RC1), when I code complete a method with parameter, I can edit one by one all parameters with RETURN to go from one to another. It's very easy, and the suggestings parameters are 1/2 times corrects.
See Suggesting Parameters at Code Assistance in the NetBeans IDE Java Editor: A Reference Guide / Smart Code Completion