No completions available, strange Eclipse behavior
Asked Answered
M

13

27

I think I tried every suggested solution, but this Eclipse auto-complete problem is quite particular:

  1. I launch Eclipse, content assist works fine;
  2. I want to create a LineBorder in my Swing project;
  3. I type LineBorder panelBorder = new Li and hit Ctrl+Space;
  4. No popup appears and in the status bar it writes in red "No completion available";
  5. I try Ctrl+Space on the elements where content assist worked fine 2 secs earlier, it doesn't work anymore.
  6. I try the same thing on other project, on the same project after closing and reopening it, after cleaning it and content assist works just fine before I try using LineBorder constructor, then it crashes.

What I tried:

  1. Reset to defaults in 'Preferences->Java->Editor->Content Assist->Advanced';
  2. Check every single checkbox in the same menu;
  3. Create a new workspace and try it there;
  4. Delete .index files and 'savedIndexNames.txt' in .metadata/.plugins/org.eclipse.jdt.core;
  5. Check for the duplicate libraries.

What I didn't try is reinstalling Eclipse. The version I use is Eclipse IDE for Java Developers (Juno).

Nothing seems to work.

UPDATE:

Checked the logs as iGili suggested. There are some exceptions raised at the time of failure:

org.eclipse.e4.core.di.InjectionException: org.eclipse.core.commands.ExecutionException: While executing the action, an exception occurred
Caused by: org.eclipse.core.commands.ExecutionException: While executing the action, an exception occurred
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
    at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findConstructorParameterNames(InternalCompletionProposal.java:257)
    at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findParameterNames(InternalCompletionProposal.java:1456)
    at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.appendUnboundedParameterList(CompletionProposalLabelProvider.java:113)
    at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createMethodProposalLabel(CompletionProposalLabelProvider.java:272)
    at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createStyledLabel(CompletionProposalLabelProvider.java:570)
    at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.computeDisplayString(LazyJavaCompletionProposal.java:262)
    at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getStyledDisplayString(LazyJavaCompletionProposal.java:238)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.handleSetData(CompletionProposalPopup.java:841)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$24(CompletionProposalPopup.java:831)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup$3.handleEvent(CompletionProposalPopup.java:593)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
    at org.eclipse.swt.widgets.Table.checkData(Table.java:1166)
    at org.eclipse.swt.widgets.Table.wmNotifyChild(Table.java:6749)
    at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5534)
    at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1896)
    at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:5086)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4584)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
    at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1627)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2069)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:4989)
    at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
    at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2440)
    at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:564)
    at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:430)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)

and it goes on, I don't know what is the convention for posting long stack traces

Mcconnell answered 31/3, 2013 at 11:11 Comment(10)
When I check on my Eclipse it works fine, I use the same Eclipse. Does it happen only to this example or CTRL + Space doesn't work at all?Festivity
Ctrl+Space works pretty much everywhere before I try this example and doesn't work at all after it.Mcconnell
check this blog.rtwilson.com/…Festivity
I don't think Ctrl+Space is assigned to some other task because in that case it wouldn't work at all. In my case it works again when I restart Eclipse/reopen the project/clean the project until I try to use autocomplete for the given exampleMcconnell
I would suggest re-install Eclipse, I think is a quick way. Let me know if it solved the problemFestivity
Reinstalling didn't solve the problem, though I expected it to.Mcconnell
have u tried this: go to your workspace directory and go to .metadata\.plugins\org.eclipse.jdt.core. Close Eclipse, rename that directory, and reopen the workspace ?Festivity
check in workspace/.metadata/.log or eclipse/configuration/<timestamp>.log for interesting exceptions. post here if there are any from the time that autocomplete crashed. you can also look at Window > Show View > PDE Runtime > Error Log when it happens.Furious
@Furious There are indeed some interesting exceptions, I updated the post. As I mentioned there I don't know if I should post the whole stack trace or the part I find important when the stack trace is too long.Mcconnell
@Festivity I tried it now, no effectMcconnell
G
80

I had the same. Windows -> Preferences -> Java -> Editor -> Content Assist -> Advanced. Make sure "Java Proposals" checkbox is ticked at default content assist list (1st panel of the pop up).

By clicking "Restore Defaults" button at the bottom "Java Proposals" could be checked automatically.

Generosity answered 10/11, 2013 at 20:55 Comment(1)
This actually worked for me, but very strange that this option is disabled by default!You
P
5

Go back to the Advanced Content Assist preference page and Restore Defaults. Close the dialog using the OK button.

Plea answered 31/3, 2013 at 15:16 Comment(1)
That's exactly what I did multiple times. Doesn't helpMcconnell
R
2

I had the same problem. Actually I had the content assist pop up, but that was smaller than a couple of pixels.(Who shrunk this and why was it shrunk no idea whatsoever...) But if you see something strange(in my case, that was the letters 'Rp', but I guess it can be anything) where normally the content assist should appear, try to expand it, and you might get it back. Good luck.

Rinaldo answered 20/9, 2013 at 12:29 Comment(0)
O
2

None of these answers helped me: Java Proposals was ticked, and restoring defaults didn't do anything. It started working only after I restarted Eclipse.

Orthogenic answered 7/2, 2014 at 1:27 Comment(0)
B
2

Windows -> Preferences -> Java -> Editor -> Content Assist -> Advanced ( Java Proposals) need to be choosen.

Bristow answered 13/5, 2019 at 10:25 Comment(0)
T
1

What worked for me was to create a new workspace and copy all the projects to that workspace. The issue now only occurs on the previous workspace.

Tepid answered 13/12, 2015 at 0:30 Comment(0)
F
0

I think you are running into a known defect in 3.6. see here

try to download a newer release- it is fixed since 3.7

[edit] I just realized that you've wrote 'Juno'- are you using the latest (4.2.2)?

Furious answered 31/3, 2013 at 15:39 Comment(2)
I am using 4.2, I have reported the bug after failing to find a reasonable explanationMcconnell
I was going to suggest exactly thatFurious
A
0

I just fixed the same problem in Juno switching workspace and then switching back. Other solutions didn't work.

Aerification answered 24/7, 2013 at 12:41 Comment(0)
L
0

I had the same problem but in only one particular file in my project (completion worked fine on other files). I'm also using Eclipse Juno.

I fixed the problem by removing some warnings due to unused imports in the file where completion failed... and it started working again!

Levo answered 29/8, 2013 at 15:27 Comment(0)
A
0

This checkbox "java proposals" will be ticked until I have failed and got "No completions available". After that, it will show as unticked the next time I am opening the settings.

Ase answered 4/5, 2016 at 23:2 Comment(0)
B
0

Go to Eclipse → Preferences → Java → Editor → Content Assist → Restore Defaults

and then Project → Clean

Bioscopy answered 10/1, 2019 at 19:42 Comment(0)
U
0

I couldn't expand sysout this morning. After a couple of wasted hours, I found that I was trying to put System.out.println() outside a method. When I did it inside a method, it all worked perfectly.

Undertint answered 22/4, 2019 at 8:44 Comment(0)
S
0

I had the same issue just now with Eclipse version 2019-06 (4.12). For me a Project clean solved the problem.

Splay answered 28/8, 2019 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.