Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Eclipse's Content-assist be made more flexible?

In Eclipse the auto complete is very very strict. Is there a way to have it slightly looser? For instance:

getData()
setData()

I want to type "data", and have the two functions above be found but because both functions have "get" or "set" at the start, it doesn't suggest these functions, I have to type get or getD to finally be able to get it in the auto complete.

I was wondering if there was a setting to have it include 'any' functions that have the search term within it, not just starts with?

I have tried doing searches on Google, but without knowing the the terms I am only getting people asking for help saying 'its not working'. I just want to change from "startswith" to "contains"..

like image 302
WORMSS Avatar asked Jan 31 '14 14:01

WORMSS


Video Answer


3 Answers

The Eclipse Code Recommenders project includes subwords completion which seems to be exactly what you are looking for.

Keep in mind that with the upcoming 2.1 release (together with Eclipse Luna on the 25th of June, 2014), the subwords completion is no longer activated by default. Go to Preferences > Code Recommenders > Completions and activate the Subwords-Completion Processor.

like image 163
Johannes Dorn Avatar answered Sep 23 '22 17:09

Johannes Dorn


Eclipse Neon (4.6)

Now Content Assist is more flexible:

autocomplete

The feature is described here:

Content Assist now supports substring patterns. Enter any part of the desired proposal's text, and Content Assist will find it! For example, completing on selection proposes all results containing selection as a substring.

like image 30
ROMANIA_engineer Avatar answered Sep 24 '22 17:09

ROMANIA_engineer


Unfortunately there is no preferences setting to enable or change that. There are several ways to tweak the behavior of Content Assist under Preferences > Java > Editor > Content Assist, such as enabling "camel caps" matching (eg, typing gD will findgetData()), but I see nothing about sub-string matching. It would be a good feature request, though. Please consider entering it in Eclipse's Bugzilla.

like image 42
E-Riz Avatar answered Sep 24 '22 17:09

E-Riz