How to fix Eclipse autocomplete not working
Asked Answered
C

17

70

The autocomplete of eclipse is not working now and I searched for hours but I couldn't find an answer to solve it. I haven't used it for long time then the first thing after opening it was to install SWT and windows builder even though I had swing installed. What I mean is, it is may possibly be because of some conflict caused by swt and swing(I read something about a conflict but I don't if this is possible).

Strange thing is it doesn't show anything when I press ctrl+space but when I go Edit-> Content Assist -> Default(it says Ctrl+Space nearby it), it shows things needed to be shown/works as desired.

public class Dsada {
    String sssss;
    public Dsada(){
        sss //pressing ctrl+space is not working,Edit->ContentAssist->Default works fine
    }
}

The solution is not to tick/untick some stuff under Windows->Preferences->...->Content Assist-> Advanced. I checked if "ctrl+space" is hijacked by some other thing which is not and checked keyboard language which is English (Those are suggested in mkyong).

I read something about a bug but I couldn't understand. I tried to delete eclipse and re-install again but I guess some settings just stayed in the machine so that it didn't work.

Cortes answered 13/2, 2014 at 5:53 Comment(3)
Please consider changing the accepted answer to the one made by Pete Kelley. I just found his answer to be exact in 2020.Coenzyme
To really make the suggestions automatic read the answers here: #6202723Jacobson
I found below link worked for me #908989Rollins
B
24

The hot key combination ctrl+space might be conflict with other settings in system if you are using windows.

Try modify this combination like alt+/, i always use this one since the first time i knew eclipse. It works well.

Hope it works for you.

Browbeat answered 13/2, 2014 at 8:29 Comment(7)
It worked a bit. If there is only one possible word, then it completes, but if more it is not bringing the possible templates.Cortes
That's weird. Actually, there are two places to be modified, window -> preferences -> General -> Keys, find Content Assist, modify the Binding to Alt+/ if it wasn't, and find Word Completion, modify the Binding to Alt+. if it wasn't. Those two options sometimes conflict with system's. After doing so, try with Alt+/ or Alt+..Browbeat
I did that way but it worked as I said. I tried Ctrl+Shift+Space as well, the result is same. I couldnt think of any solution for that but do you think it is possible that if I completely delete everything about eclipse it will work? Or there is a bigger problem than that?Cortes
I deleted everything related to eclipse, and re-unzip it. Then did what you have proposed. Now, I'm not able to use ctrl+space (while changing key, it is accepting ctrl+space) but ctrl+shift+space works fine :) at least better than not working at all. Still, I wish, I could be able to use ctrl+spaceCortes
If you are using window OS, ctrl+space is the system default hotkey for changing input method. So that is the problem with eclipse itself, since ctrl+space is the default setting come up with eclipse. Anyway, changing it would be a good solution. And so far as i know, it was a common issue which i have no idea why eclipse team didn't change it.Browbeat
If using Ubuntu check answer regarding ibus!Knockwurst
Nb: please add JRE system library and server runtime in Java build path library. You can get proposals through this. 🙂 I got the proposals once I add these to my Java build path select project→right click→properties→java build path→library→add libraryGopher
S
249

This is recurring for me. I'm using Eclipse 2019-03 in Windows 10. The steps below work for my case, and does not require a restart.

Window->Preferences->Java->Editor->Content Assist->Advanced

The following options are de-selected, and when I set them the autocomplete worked as before. No restart needed.

 1. Java Non-Type Proposals 
 2. Java Proposals 
 3. Java Type Proposals
 4. Java Proposals (Task-focused)

I don't know what's triggering this but it only happens after I've created a new project. Usually doesn't. It simply doesn't happen often enough for me to notice a pattern to follow up on more. Clearly this problem occurs with a variety of causes, so review the other answers to see if they match your case.

Salliesallow answered 5/7, 2019 at 15:55 Comment(13)
This worked for me. I noticed Eclipse changed the Content Assist for some reason after I loaded another workspace that didn't show the problem before. Maybe some settings got messed up while switching.Dowse
Not sure why It happened. Normally it works out of the box. The above steps actually worked.Jaguar
It worked for me when I only checked these ones: API Tools Proposals, Java Proposals, JAX-WS Proposals, JAXB Proposals, JPA Proposals, SWT Template Proposals, Template Proposals.Bazooka
Same problem, same solution. Maybe it's caused by converting the workspace from older version. Anyway, your answer has saved me from re-creating the workspace from scratch.Crowning
Guess what, Eclipse 2020-03 and this answer is still the solution.Tambour
besides, I needed to disable the main ContentAssist option for better experience, otherwise whenever I click ctrl+space, it asks me which assistant type I need, which is inconvenientCocktail
This worked for me too! I though I had broken it with lombook but this was the real issue.Josh
It worked for me after restarting EclipseCreolacreole
I'm using 2021-06 and sure enough the problem arose as soon as I created a second workspace. Nothing worked. Autocomplete definitively broken.Surra
2021-06 - 'Restore defaults' disables most of these - I wonder whether that's the problem?Veljkov
Was having this issue with 2022-03 but this solution worked.Solicitor
Eclipse 2022-09 same issue after opening workspace of 2022-03 and selected convert. This solution helped.Fowkes
Had this problem with Eclipse 2024-06. Thanks a stack!Dumpling
B
24

The hot key combination ctrl+space might be conflict with other settings in system if you are using windows.

Try modify this combination like alt+/, i always use this one since the first time i knew eclipse. It works well.

Hope it works for you.

Browbeat answered 13/2, 2014 at 8:29 Comment(7)
It worked a bit. If there is only one possible word, then it completes, but if more it is not bringing the possible templates.Cortes
That's weird. Actually, there are two places to be modified, window -> preferences -> General -> Keys, find Content Assist, modify the Binding to Alt+/ if it wasn't, and find Word Completion, modify the Binding to Alt+. if it wasn't. Those two options sometimes conflict with system's. After doing so, try with Alt+/ or Alt+..Browbeat
I did that way but it worked as I said. I tried Ctrl+Shift+Space as well, the result is same. I couldnt think of any solution for that but do you think it is possible that if I completely delete everything about eclipse it will work? Or there is a bigger problem than that?Cortes
I deleted everything related to eclipse, and re-unzip it. Then did what you have proposed. Now, I'm not able to use ctrl+space (while changing key, it is accepting ctrl+space) but ctrl+shift+space works fine :) at least better than not working at all. Still, I wish, I could be able to use ctrl+spaceCortes
If you are using window OS, ctrl+space is the system default hotkey for changing input method. So that is the problem with eclipse itself, since ctrl+space is the default setting come up with eclipse. Anyway, changing it would be a good solution. And so far as i know, it was a common issue which i have no idea why eclipse team didn't change it.Browbeat
If using Ubuntu check answer regarding ibus!Knockwurst
Nb: please add JRE system library and server runtime in Java build path library. You can get proposals through this. 🙂 I got the proposals once I add these to my Java build path select project→right click→properties→java build path→library→add libraryGopher
T
20

Window->Preferences->Java->Editor->Content Assist->Advanced

The following options have to be selected, then the autocomplete worked . No restart is required.

Java Proposals  (must be selected, not sure the follows)

Java Non-Type Proposals
Java Type Proposals
Java Proposals (Task-focused)
Thankyou answered 16/5, 2020 at 20:52 Comment(1)
Works for me on Version 2021-03 (Oxygen.3?). Indeed where not selected by default. Thanks @caot!Amylo
A
14

I was facing the same issue. If you use OS X Eclipse Ctrl+Space shortcut can be interfering with OS X system's "Selecting previous input source" using Ctrl+Space shortcut as default.

It is necessary to edit System Preferencies/Keyboard/Shortcuts/Input Source and uncheck the "Selecting previous input source" or change the shortcut on something else. Eclipse should work after that even without restart.

Alfonso answered 10/1, 2017 at 17:53 Comment(3)
Thanks for the reminder of this classic. The funny thing was that it did work without addressing this for a couple of months. Then I had do this (macOS 11 Big Sur).Disentomb
That was also in my case, macOS Monterey, Eclipse 03-2022, you have to switch off the Apple Shortcuts first!Swedenborgianism
In my case the latest macOS Update stole my shortcut... share.cleanshot.com/FbGBN5HFAmalee
D
6

I faced hot key problem with use Ctrl+Space. I tried to fix the issue first by Windows->Preferences->...->Content Assist-> Advanced and selected Select the proposal kinds contained in the 'default' content assist list:

  • Other Java Proposals,
  • List item
  • SWT Template Proposals
  • Template Proposals
  • Type Proposals

but didn't help.

Therefore, I tried another solution. There would be multiple languages on your computer which could be eating up your Ctrl command. To solve this Go to Control Panel -> Region and Language -> Keyboards and Languages (tab) and then Change Keyboards.

You’ll see a list of languages installed – remove any that you don’t want (click the language and then click the Remove button) until you only have the ones you want left. That fixed it for me, but you can also check the Advanced Key Settings tab to make sure that none of the keyboard short-cuts that are set include Ctrl-Space.

Once you’ve done that, Ctrl-Space should work nicely!!!!

Djerba answered 10/3, 2016 at 10:42 Comment(1)
my mac was using this shortcut to switch the keyboard... you saved my day man, thanks !Hoxha
P
4

Go to Windows >> Preferences » Java » Editor » Content Assist. Then Check the Auto activation triggers for java, Add this in the text box .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

Polyester answered 14/7, 2022 at 3:17 Comment(0)
D
2

I had the same Problem on Ubuntu 14.04. The problem for me was that ibus used Ctrl+Space as a shortcut. I solved it by starting the program ibus-setup and chaning the shortcut to something else than Ctrl+Space.

Degroot answered 6/5, 2015 at 13:2 Comment(0)
R
1

Recently, I also faced this issue. When I install neon version eclipse. By (1) deleting respective class, (2) restoring defaults appearance and (3) restarting eclipse, solved the problem for me. Hope it will help someone.

Retch answered 30/6, 2016 at 22:42 Comment(0)
B
1

For Mac user, you can try : Preferences -> Java > Editor > Content Assist and then :

  • tick the field "Enable auto activation"
  • in the field Auto activation trigger for Java, you can input the text alphabet ".abcdefghijklmnopqrstuvwxyz"
Bouzoun answered 20/1, 2023 at 13:3 Comment(0)
B
1

Didn't work anymore after I upgraded to MacOS Ventura 13.3.1. Resetting content assist in Eclipse did not work until I removed the Ctrl-Space binding for Mac in Setting->Keyboard shortcuts->Input Sources.

Brothel answered 7/6, 2023 at 15:23 Comment(0)
S
1

"In case of Mac, I followed the following link. Which worked perfectly

In short, Go to

  • Java
    • Editor
      • Content Assist
        • Auto activation triggers for Java

In the place of "Auto activation triggers for Java" replace

'.'

with

.@(#&$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

Spurtle answered 29/10, 2023 at 13:36 Comment(0)
L
0

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

I checked windows has no conflict of ctrl+space (of eclipse autosuggestion) with windows.

This is mere configuration issue of eclipse. reinstallation would fix it.

Thanks.

Lorsung answered 10/2, 2021 at 19:44 Comment(0)
R
0

I select all the parameters in Preferences -> Java -> Editor -> Content Assist -> Advanced. It help me and resolve the my problem. Cltr+space work using this step.

Roeser answered 10/1, 2022 at 16:27 Comment(0)
E
0

Saving my work and restarting Eclipse solved this for me. I hadn't shut down Eclipse in a while, maybe weeks.

Elviselvish answered 23/4, 2022 at 15:44 Comment(0)
A
0

I had the same problem (MacOS Monterey, Eclipse 06-2022). Turned out it works with pressed fn button.

Anikaanil answered 27/6, 2022 at 13:1 Comment(0)
B
0

I am currently using macOS Sonoma V14.3.1

In eclipse Go to Window->Preferences->Java->Editor->Content Assist->Advanced

Make sure you have these options selected:

  1. Java Non-Type Proposals
  2. Java Proposals
  3. Java Type Proposals
  4. Java Proposals (Task-focused)

Then go to System Settings Preferencies/Keyboard/Shortcuts/Input Source and uncheck the "Selecting previous input source"

This fix doesn't require a restart, hope it helps!

Burnaby answered 22/2 at 9:26 Comment(2)
As far as I can tell, everything in your answer is already stated in the other [18] answers. Did I miss something? Is there something in your answer that does not appear in the other answers?Feoff
@Feoff You didn't miss anything I just wanted to add my specific macOS version and join the responses that applied for myself. Thank you for your comment.Burnaby
J
0

I tried several answered options but found one that worked for me:

Window > Preferences > Java > Editor > Content Assist

Leave only the options checked:

  1. Completion inserts

  2. Insert single proposals automatically

  3. Insert common prefixes automatically

  4. Add import instead of qualified name

  5. Use static import (only 1.5 or higher)

  6. Fill method arguments and show guessed arguments

  7. Insert parameter names

  8. Show camel case matches

  9. Show subword matches

  10. Hide proposals not visible in the invocation context

  11. Enable auto activation

  12. Auto activation delay (ms): 20

  13. Auto activation triggers for java: .@(#&$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

  14. Auto activation triggers for Javadoc: @#

'Content Assist' image


Window > Preferences > Java > Editor > Content Assist > Advanced

Configure the behavior of the content assist (Ctrl+Space) command

In (Select the proposal kinds contained in the 'default' content assist list:), leave only the mentioned options selected and uncheck all others:

  1. API Tools Proposals
  2. Chain Template Proposals
  3. Java Non-Type Proposals
  4. Java Postfix Template Proposals
  5. Java Proposals
  6. Java Type Proposals
  7. SWT Template Proposals
  8. Tempate Proposals
  9. Word Proposals

'Advanced 1' image

In (Content key binding can be assigned to each proposal kind on the 'keys' preference page), leave only the mentioned options selected and uncheck all others:

  1. Tempate Proposals
  2. SWT Template Proposals
  3. Chain Template Proposals
  4. API Tools Proposals

Timeout for fetching a parameter name from attached Javadoc (ms): 50

(x) Enable non-blocking completion (does not affect open editor)

'Advanced 2' image

Jeri answered 28/6 at 16:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.