Question

I am working on an Android app, using Eclipse 4.2. I have content assist set up almost as I want it. However, when I, for example, start typing int to create a Java int variable, the Android.R.Integer entry in content assist is the primary entry.
I have content assist set up by relevance. This is just an annoyance because every time I want to make an int variable, I have to either hit Esc or hit enter and delete "eger" from the end of the type.

Thanks in advance.

Was it helpful?

Solution

You can use Preferences->Java->Appearance->Type Filters to filter out the suggestions you want to ignore. I'm wondering why you really need content assist to create an int variable, it would be easier to simply type it. But if you really want to, you can type the integer value and then use the Ctrl-2-L shortcut to create the local variable.

OTHER TIPS

None of the solutions posted here really worked, so what I did was to go to

Java -> Appearance -> Type Filters

and add *int* (yes, it's an asterisk followed by int and then another asterisk).

There's a checkbox next to the filter you just added, make sure it is checked.

Problem solved (finally!)

In Java->Appearance>Type Filters

click add

type 'int*' -> click ok.

Then when you type in int , the first is int instead of integer .

Cren I am in the same boat. I have the content assist set to auto activate with every letter because I find it extremely useful that way, but have the same int(eger) problem that you do.

I have come up with a few ways to deal with it and thought I would share them in case you find one of them useful.

You could use a Type Filter as ralph suggested works just fine, you just don't get the assist when you actually want Integer, which isn't that big of a deal.

You could delay the content assist long enough so that you can type "int" and enter before it pops up, giving you a delay always. (In Preferences->Java->Editor->Content Assist there is an Auto activation delay setting)

Or remove 'i', 'n', and 't' from the Auto activation triggers (again in Preferences->Java->Editor->Content Assist). This is the method I am currently trying out, and it seems to work with everything, even Integer, saving me from having to type "ger" :).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top