20

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

Community
  • 1
  • 1
Damo
  • 11,410
  • 5
  • 57
  • 74

14 Answers14

19

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
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. It does sound like bug 281871. I've added the codeAssistTimeout and it's all working. Now just need to decide whether to stay with Mylyn or EclipseClassic. – Damo Sep 02 '09 at 13:26
12

I´ve runned onto the same, Content Assist not working under Eclipse 3.7.2. Up to this version is pretty stable, tough I don´t know how come it never worked for me.

I haven´t had any error message nor tip on why it wasn´t working and took me a while to find the 'Java Proposals' option.

It is on Eclipse Preferences -> Java -> Editor -> Content Assist -> Advanced.

Make sure that Java Proposals is checked.

You don´t wan´t repeated Java suggestions. Don´t check Java Non-Type Proposal nor Java Type Proposals.

Sebastian Juarez
  • 3,317
  • 2
  • 21
  • 20
2

For me it works by doing prefrerences > general > keys > Restore Defaults

Dont know its crazy but thats what finally works after all the googling and trail following.

Regards, Manish

Manish
  • 21
  • 1
  • 1
    If you read the question you'll see that it was an Eclipse bug relating to large JAR files. This has now been fixed in the 3.6M6 release of Eclipse. – Damo May 27 '10 at 21:31
  • This fixed an issue I had with 3.7 – Tom Kidd Feb 23 '12 at 17:14
1

Looks like your mylyn install may be broken try removing the mylyn plugin and see how you get on.

Paul Whelan
  • 16,574
  • 12
  • 50
  • 83
  • Paul (and Daniel), thanks for the tip on Mylyn. I downloaded Eclipse 3.5 Classic that comes without Mylyn and this has made some difference. At least I can continue working now. Cheers. – Damo Sep 02 '09 at 13:19
1

When I had a similar problem, I simply uninstalled the Mylyn/Java integration. I don't use Mylyn, and although I know some people consider it to be the best thing since sliced bread, I've never found it to be anything other than a way to screw my name completion.

Note that you don't want to disable the "Java Proposals (Task-Focused)" that that error message was trying to tell you about. That'll disable name completion as well.

Daniel Martin
  • 23,083
  • 6
  • 50
  • 70
0

One of my jars was on a network share and it was hanging for over 10 seconds. Copied the JAR to local drive, updated my project to point to the local file and my hang time went away.

User1
  • 39,458
  • 69
  • 187
  • 265
0

I was having the same issue, but my problems started when i upgrade my project from gwt 1.5 to gwt 1.7. I read your comments and i just make two changes. Increase the Xmx to -Xmx768m and unmark Java Proposals (Task-Focused) and mark just Java Proposals. It's being work fine since i did this changes. I hope it can help you.

0

I had the same issue on eclipse 3.5. Upgrading mylyn features resolved it

Thomas
  • 1
0

Mylyn (or its code assist) seems to be rather picky about resources in the build path.

I had the issue and it was caused by binary files which I had accidentally added to the Eclipse built path. That does not cause any compile error or warnings but causes the exception during code completion you mention in your post.

Tobias
  • 1
0

I was facing the same issue.

I added -vm option on top in eclipse.ini file just before -startup option. And it solved the issue!

-vm
C:\Program Files\Java\jdk1.7.0_71\jre\bin\server\jvm.dll
-startup

My eclipse version is 4.4.1 by the way.

Jerodev
  • 32,252
  • 11
  • 87
  • 108
Rohit
  • 33
  • 1
  • 1
  • 7
0

With STS 4.7.0, following throws errors, Arrays.asList("abc", "bbb", UUID.randomUUID()).stream()., but this will not, Arrays.asList("abc", "bbb", UUID.randomUUID().toString()).stream().

0

Try restoring the preferences at Java -> Editor -> Content Assist -> Advanced.

It worked for me !
I use STS 4.14.0.RELEASE and it was showing the same error after there was an unexpected system restart happened. STS was not even allowing me to navigate to other classes by Ctrl+click, search for the class/method/variable references in the project.

Cjo
  • 1,265
  • 13
  • 19
0

I had tried all the above suggested solutions but nothing worked for me. Then I tried manually adding the imports to my Java class and it worked. Give it a try.

0

Configure Eclipse’s content assist, go “Preferences>Java>Editor>Content Assist>Advanced“. Make sure “Other Java Proposals” is ticked. This may be easier solution... :-)

Hrvoje
  • 21
  • 1
  • Read the question a bit more especially the bit under "UPDATE 2". It's an Eclipse bug and no Content Assist settings help. The bug is fixed in Eclipse 3.6M6. – Damo Dec 20 '11 at 22:05