25

I am not entirely comfortable with way how Eclipse autocompletes code. I like the way how IntelliJ prompts suggestions (some say it's rather aggresive, but I like it that way).

So I went to: Window -> Preferences -> Java -> Editor -> Content Assist and set delay to 0ms and autoactivation trigger to ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.

Now Eclipse looks really fast with autocompletion but there's one very annoying thing: It completes proposed names of variables on every space hit.

So when I want to type:

String joe = "Joe";

eclipse is fast enough to ruin it to:

String joeString = ...;

In other words , pressing: String joe[space]makesjoeString. I hope I was clear enoguh, thanks for suggestions :)

Xorty
  • 18,367
  • 27
  • 104
  • 155
  • 4
    One of the most annoying issues I've ever seen in an IDE. – Avi Shukron Apr 24 '14 at 17:37
  • Agreed,very-very annoying behaviour. And not only with space, Eclipse does it with the semicolon too, so if you say: String joe; Eclipse "corrects" it to: String joeString; It's a pity there's no solution to this. – soger Oct 02 '14 at 16:34
  • Possible duplicate of [Stop spacebar keypress from triggering autocomplete in Eclipse](https://stackoverflow.com/questions/14297735/stop-spacebar-keypress-from-triggering-autocomplete-in-eclipse) – Pyves Dec 20 '18 at 21:56

3 Answers3

8

You can uncheck 'Window -> Preferences -> Java -> Editor -> Content Assist -> Insert single proposals automatically'. Once done, you should only get a popup window with the proposal but it will not be inserted automatically in the editor.

Deepak Azad
  • 7,903
  • 2
  • 34
  • 49
  • 1
    This doesn't work for me. You can try that with joeString example. – Xorty Oct 14 '11 at 15:47
  • Ok, you have to press 'Esc' to make the proposal popup go away. Pressing 'Space' just selects the first proposal and I do not see a way out of it (selection with space works nicely when content assist is not autoactivated everywhere and I do not think we are going to change that) – Deepak Azad Oct 14 '11 at 16:18
  • 3
    Yep I realized I have to press Esc but that's too annoying to get used to :/ – Xorty Oct 14 '11 at 16:27
  • 1
    agree, the problem is that the auto-activation everywhere is kind of a hack/trick and things are not really designed for this. You can open a bug against JDT UI (https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT), and describe the problem you are facing. – Deepak Azad Oct 14 '11 at 17:36
  • 1
    This doesn't fix the issue. In fact it appears to not do anything at all. One has to wonder: What DOES that option even do? – pete Jun 02 '15 at 18:56
4

Increase the delay so that you can still type short things without stopping. I'm not sure there is another way to solve it as you are asking Eclipse to always instantaneously autocomplete, and space chooses it's current autocomplete guess.

Josh Pordon
  • 289
  • 1
  • 9
  • 3
    Sorry, but this is not what I am looking for. – Xorty Oct 14 '11 at 15:45
  • I don't see why users have to dumb down their productivity just to workaround an egregious oversight by Eclipse developers. Why not have the best of both worlds? Instant pop-up, and don't force-insert unless we press enter. I'm no coding master but surely this must be a laughably easy task????? – pete Jun 02 '15 at 18:59
0

There is a solution on the issue tracker for this. Copy the jar in the eclipse/dropins folder. With the next restart space is diabled as autocompletion trigger.

Pascalius
  • 14,024
  • 4
  • 40
  • 38