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"..
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.
Now Content Assist is more flexible:
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With