6

Eclipse gives suggestions that starts with what I type: enter image description here

But IntelliJ IDEA gives suggestions that has (in the middle or at the beginning) what I type: enter image description here

I guess Eclipse Luna has the same feature (based on this presentation), but I cannot make it work. Any help?

siva636
  • 16,109
  • 23
  • 97
  • 135

2 Answers2

7

This functionality is provided by the Code Recommenders plugin. It comes with the Eclipse Luna for Java SE, but for some reason it is not bundled in the EE version. Of course you can install it manually from the eclipse marketplace.

To activate it go to Window -> Preferences -> Code Recommenders -> Completions -> Check enable intelligent code completion. You can also select in which type of completions you are interested in. The exact feature you are looking for is called "Subwords completion processor" (and I cannot live without it :D)

enter image description here

Svetlin Zarev
  • 14,713
  • 4
  • 53
  • 82
  • Works perfectly in my Eclipse Juno. Do you have any idea if Eclipse Luna has this 'enable intelligent code completion' feature inbuilt? – Prudhvi Apr 15 '15 at 20:07
  • As I've said in my post, it depends on which flavor of eclipse you are using. Code recommenders come pre-instaled in the Eclipse for Java (SE), but not in the Eclipse for Java EE. And as I've already said, you can install it from the marketplace. – Svetlin Zarev Apr 15 '15 at 20:09
  • 1
    Unfortunately, this plugin is archived and no longer available in the marketplace. We can still download the jar and install it from local. However, soon there will be a day when it will be no longer compatible with the current eclipse version and a good plugin will have seen it end. – Naved Alam Aug 23 '19 at 07:27
  • 1
    Yes, it is no longer available in the marketplace. But for an easy setup of this plugin, go to `Install New Software` menu and enter this url: https://repo.eclipse.org/content/shadows/releases.unzip/org/eclipse/recommenders/stable/2.5.4/stable-2.5.4.zip-unzip/ and select only `Code Recommenders for Java Developers` (you may have issues if others are selected). – Antoine Martin Sep 21 '19 at 20:56
  • This is a bit of an old thread, but you can achieve the desired behavior by turning on `Show subword matches` under `Java > Editor > Content Assist`. The reason for archiving Recommenders might be because Eclipse provides this feature without plugin. – ToxicWaste Aug 07 '20 at 11:18
2

I think the closest is the 'Show camel case matches' option (configured in the Preferences in Java > Editor > Content Assist).

With that enabled you have to type the first letter of each part of the name, so for 'createNamedQuery' you can type 'cNQ'

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • 4
    But that is not the OP is asking. According to OP, the IDE should suggest every method that has the letter the user types. – Prudhvi Apr 15 '15 at 19:52