This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251669

Summary: Smarter enum CC
Product: java Reporter: cezariusz <cezariusz>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: VERIFIED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: NetBeans default CC
NetBeans all items CC
Eclipse default CC
Improved but still not perfect enum cc in NetBeans.

Description cezariusz 2015-04-06 12:11:30 UTC
Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 1
Java: 1.8.0_25; Java HotSpot(TM) 64-Bit Server VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b18

When the cursor is in the context of a particular enum, typing part of the enum name should be enough to show enum values, even without the enum class prefix. For example:

public class EnumCodeCompletion {

    enum Sample {

        ONE, TWO, THREE, FOUR
    }
    
    void demo() {
        Sample type;
        type = T|
    }

}

When I call the code completion after the letter "T", it shows me some suggestions, but without expected TWO and THREE enums (see the first screenshot). When I press Ctrl+Space again, I get hundreds of completely unrelated suggestions, with TWO and THREE buried somewhere deeply (see the second screenshot).

When I do the same in Eclipse, it conveniently suggests me matching enums, and automatically fills the necessary class prefix on Enter (see the third screenshot).
Comment 1 cezariusz 2015-04-06 12:14:25 UTC
Created attachment 153050 [details]
NetBeans default CC
Comment 2 cezariusz 2015-04-06 12:14:51 UTC
Created attachment 153051 [details]
NetBeans all items CC
Comment 3 cezariusz 2015-04-06 12:15:10 UTC
Created attachment 153052 [details]
Eclipse default CC
Comment 4 Dusan Balek 2015-04-13 11:20:49 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/ce31ba4f43c7
Comment 5 Quality Engineering 2015-04-14 03:05:25 UTC
Integrated into 'main-silver', will be available in build *201504140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ce31ba4f43c7
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #251669: Smarter enum CC - fixed.
Comment 6 cezariusz 2015-04-17 06:14:15 UTC
Checked in 201504150001 - it works, but could be done a little bit better. When the enum is expected it should be highlighted as the default suggestion, not an optional somewhere at the top of the list. You probably hate to be compared to Eclipse, but please take a look again how it's done there. It might seem to be a minor difference, but it's all about the productivity, when you are coding the whole day.
Comment 7 cezariusz 2015-04-17 06:15:04 UTC
Created attachment 153248 [details]
Improved but still not perfect enum cc in NetBeans.
Comment 8 Dusan Balek 2015-04-17 08:47:14 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/25387c6cedb1
Comment 9 Quality Engineering 2015-04-20 11:57:40 UTC
Integrated into 'main-silver', will be available in build *201504201004* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/25387c6cedb1
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #251669: Smarter enum CC - fix cont.
Comment 10 cezariusz 2015-04-28 14:48:22 UTC
Verified with 201504280001