Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Java Content Assist not working

Tags:

eclipse

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

like image 236
Damo Avatar asked Sep 02 '09 12:09

Damo


People also ask

How do I enable Content Assist in Eclipse?

To enable the Content Assist window to open automatically, go to the Content Assist Preferences page, accessed from Window | Preferences | PHP | Editor | Content Assist and mark the 'Enable auto-activation' checkbox.

Why Eclipse suggestions are not working?

Go to Preferences » Java » Editor » Content Assist » Advanced. Make sure Other Java Proposals is ticked/checked.

How do I enable Java suggestions in eclipse?

Step 1: Open your Eclipse or Spring Tool Suite, then go to the Window > Preferences as shown in the below image. Step 2: In the next screen go to the Java > Editor > Content Assist > Auto activation triggers for Java as shown in the below image.

Why my Ctrl space is not working?

Make sure (Ctrl + Space) combination key is not hijacked by other application. For examples, My desktop computer (Ctrl + Space) combination key is hijacked by my Windows text input feature.


1 Answers

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

http://wiki.eclipse.org/images/0/0a/Mylyn-content-assist-timeout.gif

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
like image 90
VonC Avatar answered Oct 05 '22 14:10

VonC