Eclipse Java内容辅助工作不起作用 [英] Eclipse Java Content Assist not working

查看:233
本文介绍了Eclipse Java内容辅助工作不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse 3.4和3.5中的内容辅助工具已停止为我工作。当我键入一个类的前几个字符并且命中CRTL空格,然后延迟后,我得到以下错误消息

$ b $请注意,Mylyn应该在内容辅助计算中增加一小部分开销,但是标准内容辅助机制不会报告超时(即,花费更长的时间) 5s来计算提案)。

如果您正在处理的系统非常大,增加的内存不会减少时间以避免消息,您还可以考虑禁用Mylyn特定的内容辅助,如但如果这样做,请对 bug 141457 发表评论。







您可以在这个SO回答

由于您已经尝试增加内存,您可以对错误141457发表评论。



这可能与 bug 281871 ,仅在eclipse 3.5.1和3.6中修复。


我现在看到了。问题是,如果
索引尚不是最新的,代码辅助开始使用Java模型。



您可以要等到索引器完成,或者通过
设置超时,设置启动Eclipse时的' org.eclipse.jdt.ui.codeAssistTimeout 'Java环境变量,例如




  -vmargs -Dorg.eclipse.jdt.ui.codeAssistTimeout = 60000 


The Content Assist in Eclipse 3.4 and 3.5 has stopped working for me. When I type in the first few characters of a class and hit CRTL-space then after a delay I get the following error message alt text http://locuslive.com/webdrive/JDTscreenshot.png

It does not matter what proposals I enable/disable, I will get this (or similar) message.

I have tried:

  • Changing the Xms/Xmx values

  • Starting Eclipse with -clean

  • Creating a new workspace and importing my projects

However none of these have worked.

I have seen some posts suggesting that other apps may be taking over the CRTL-space or otherwise interfering, however I have nothing aside from a fresh Eclipse running and the problem persists.

My problem is very similar to the one covered in this post albeit on a later version and on OSX 10.5.7.

Does anyone have any suggestions for how this might be resolved?

Thanks.

UPDATE: To anyone interested I've had the best results by using Eclipse 3.5 Classic (ie. doesn't include Mylyn). I've also used the settings specified in the bug reports linked to by VonC below.

Interestingly Classic doesn't come with some views eg. Snippets, but these are easy to drop in from another distro.

UPDATE 2: This problem actually persisted even with the latest versions of Eclipse (3.6 M1). It is caused by a large JAR file generated my Altova Mapforce to handle EDIFACT transformations in our application. It is reproducible by adding this JAR to the buildpath and no changes to Content Assist settings help. The bug (and JAR) can be seen at https://bugs.eclipse.org/bugs/show_bug.cgi?id=289057

解决方案

the Mylyn FAQ does mention:

Why do I get an error message when using content assist?

If after invoking Content Assist you see an error message dialog that states:

 The extension took too long to return from the 'computeCompletionProposals()' operation

this is most likely due to something interrupting the proposal operation (e.g. garbage collection). Ignore it if it does not recur, increase Eclipse’s memory if it does (e.g via -Xmx384M command line argument). See bug 141457 for more details.

Note that Mylyn should only add a trivial amount of overhead to content assist computation, however, the standard content assist mechanism will not report timeouts of this sort (i.e. taking longer than 5s to compute proposals).
If the system that you are working on is so large that increasing memory does not reduce the timings to avoid the message, you could also consider disabling the Mylyn-specific content assist, as described above, but if doing so please comment on bug 141457.


You can find good eclipse settings in this SO answer.
Since you have already try increasing memory, you can leave a comment on the bug 141457.

This could be related to the bug 281871, only fixed in eclipse 3.5.1 and 3.6.

I see it now. The problem is that code assist starts to use the Java model if the index is not yet up to date.

You can either wait until the indexer is done or increase the timeout by setting the 'org.eclipse.jdt.ui.codeAssistTimeout' Java environment variable when starting Eclipse, e.g.

 -vmargs -Dorg.eclipse.jdt.ui.codeAssistTimeout=60000

这篇关于Eclipse Java内容辅助工作不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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