Netbeans 自动代码补全变量 [英] Netbeans automatic code completion of variables

查看:26
本文介绍了Netbeans 自动代码补全变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了一个有趣的 Stackoverflow 主题,但它是一个旧主题,我担心人们不会再有反应了,所以我希望可以创建一个新主题.

I found an interesting Stackoverflow topic, but it is an old one and I'm afraid people won't be reacting anymore, so I hope it is ok to create a new one.

首先,我使用的是 Netbeans 7.2,我想更多地使用自动代码完成.它适用于带有 '.' 的方法/类.已经,但我也希望它用于变量名.

First of, I am using Netbeans 7.2 and I want to use automatic code completion more. It works nice on methods/classes with the '.' already, but I would like it for the variable names aswell.

所以我找到了这个话题:如何在 netbeans 中自动完成包括变量和方法?,更准确地说是公认的答案.

So I found this topic: How can I make auto completion in netbeans include both variables as well as methods? , more precisly the accepted answer.

这就是我一直想要的!除了一个问题,如果只有一个结果可用,它决定自动插入名称,而我仍在输入不知道这一事实.

This is what I have always wanted! Except one issue, it decides to automatically insert the name if only one result is available, while I am still typing unaware of that fact.

我尝试禁用自动插入单个建议(工具 -> 选项 -> 编辑器 -> 代码完成),它确实有效.但是一旦我输入下一个字母,它仍然决定自动完成.

I have tried disabling Insert Single Proposals Automatically (Tools -> Options -> Editor -> Code Completion), and it does kind of work. But once I type the next letter, it still decides to complete it automatically.

有没有人知道解决此问题的方法或实现相同目标的其他方法?

Does anyone know a fix for this or another way to achieve the same?

问候.

推荐答案

啊,我现在找到了:如果你像我在开篇文章中描述的那样想要它,那么在 Java 中为 Completion Selectors 设置这个:

Ah, I found it now: If you want it as I described in the opening post, then set this for Completion Selectors in Java:

[.,;:([+-=](注意末尾的额外空格,它很重要.

[.,;:([+-=] (Note the extra white space on the end, it is important.

现在它不会再对任何字符自动完成,但仍会为您提供建议框.

Now it will not autocomplete on any character anymore, but still give you the suggestions box.

这篇关于Netbeans 自动代码补全变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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