-->

Eclipse autocomplete not working

2020-03-01 10:41发布

问题:

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.

Thanks in advance,

回答1:

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.



回答2:

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.



回答3:

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.



回答4:

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.



回答5:

Also a possible problem that solved for me: http://blog.rtwilson.com/how-to-solve-the-ctrl-space-auto-complete-not-working-problem-in-eclipse/



回答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!!!!



回答7:

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.