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

StackOverflow https://stackoverflow.com/questions/14605744

  •  06-03-2022
  •  | 
  •  

Domanda

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?

È stato utile?

Soluzione

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

Altri suggerimenti

I looked over Eclipse Content Assist configuration and I do not found anything to change the filter, from "starts with" to "contains" for example.

Its possible to be another way to do that, but, I dont know how to do it.

But, I have a suggestion for you.

Do you know that if you type the initial letters in lower camel case you can get a better result, for example:

In your object player you have the getScore() method. If you type:

player.gS

Then use CTRL + Space the getScore() method will be suggest for you.

Maybe this is not what you wanted, but maybe it helps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top