Search code examples
javaeclipsecontent-assist

Can I increase the scope of options being displayed in the autocomplete (Content Assist)?


I don't know the name of this functionality, so I think it's better to use an example: imagine you have an object player with a getScore() method.

If you type player.sco, it will present you the attributes and methods that start with "sco", and not the getScore() method. I've been using MonoDevelop for a while and it displays any option that has an occurrence of the string you typed, so getScore() would be there. Is it possible to set eclipse to do the same?


Solution

  • Since Eclipse Juno (v4.2), there is a Code Recommenders code assist plugin integrated which can do exactly what you want.

    By default, only the smart completion is enabled, but in Window -> Preferences -> Code Recommenders menu, you can enable Chains and, in your case, Subwords.

    Make sure you also enable Subwords to be shown (Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced).

    Here's a simple example with System.setOut() method that was shown just for out substring:

    example of Recommenders Subwords