The following example code behaves nicely with Content Assist:
public void test(String a) {
String b =
}
With the cursor placed after the =, Eclipse will suggest a at the top of the Content Assist.
The following will not behave nicely:
public void test(CustomType a) {
CustomType b =
}
Instead of a being on top, instead CustomType will be on top, with a just below it. Why is this? It's driving me crazy. It clearly knows that a is relevant, so why suggest the class? I can't assign a variable of type A to the class A.
I can get around the suggestion by disabling Java Proposals (any of them) and enabling Java Non-Type Proposals in the Advanced settings of the Content Assist. However, this has the downside of disabling auto completion for types completely, which is even worse.
I've noticed this problem in Luna, Mars, and Neon.
Is it a bug? Is there a workaround for this?
CustomType? - nitindSet<String>with the same result. Strangely, when usingList<String>instead, content assist does suggest the variableafirst. I suggest checking Eclipse JDT's Bugzilla whether a fitting bug already exists, if not create it. - Johannes Dorn