Eclipse 自动完成在某些 Java 文件中不起作用 [英] Eclipse autocomplete not working in some Java files

查看:21
本文介绍了Eclipse 自动完成在某些 Java 文件中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到自动完成功能在 Eclipse 中的某些 java 文件中不起作用.此外,自动完成功能不起作用的文件会显示一个空心的J"作为 Java 文件的图标.自动完成工作的文件,java文件的图标是一个填充的J"

I have noticed that autocomplete is not working in some of java files in Eclipse. Also, the files where autocomplete is not working, display a hollow "J" as the icon for the Java file. The files where autocomplete is working, icon for java file is a filled "J"

我想知道是否有人可以突然指出出了什么问题,为什么图标的变化以及为什么在带有空心J"图标的文件中关闭了自动完成和语法突出显示?

I am wondering if someone can point out what went wrong all of suddent, why the change in icons and why autocomplete and syntax highlighting is turned-off in the files with a hollow "J" icon?

谢谢.

更新

基本上,我正在按照 VonC 的建议进行操作,但 Eclipse 并没有刷新我为什么认为 VonC 的建议不起作用的原因,刷新后,问题解决了.

Basically, I was doing what VonC has suggested but Eclipse was not refreshing that it why I was thinking that VonC's suggestion isn't working, after doing a refresh, the problem resolved.

推荐答案

在下图中,MyClass.java 有一个空的 J,因为它被明确排除在要构建的源:

In this following picture, MyClass.java has a hollow J, because it is explicitly excluded from the sources to build:

您能否转到项目的属性,Java Build Path"部分,Source"选项卡,看看是否设置了某些排除过滤器?
例如通常定义:

Could you go to the properties of the project, "Java Build Path" Section, "Source" tab and see if some exclusion filter has been set ?
It is usual for instance to define:

**/Test*.java

在第一次构建任何单元测试类时排除(当您有大量源并且不想在自动完成期间显示测试类时,或者不希望在源搜索期间考虑它们时).

to exclude at first building any unit-test class (when you have a large set of sources and do not want to be presented with Test classes during auto-completion, or do not want them considered during source searches).

这篇关于Eclipse 自动完成在某些 Java 文件中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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