简体   繁体   中英

Eclipse Content Assist with custom types

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?

This looks to be a bug in Eclipse's JDT.

I have created an entry in their bugzilla.

I don't think there is a workaround for this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM