Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 251669 - Smarter enum CC
Smarter enum CC
Status: VERIFIED FIXED
Product: java
Classification: Unclassified
Component: Editor
8.0.2
PC Windows 7
: P3 (vote)
: 8.1
Assigned To: Dusan Balek
issues@java
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-06 12:11 UTC by cezariusz
Modified: 2015-04-28 14:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
NetBeans default CC (10.34 KB, image/png)
2015-04-06 12:14 UTC, cezariusz
Details
NetBeans all items CC (15.24 KB, image/png)
2015-04-06 12:14 UTC, cezariusz
Details
Eclipse default CC (29.27 KB, image/png)
2015-04-06 12:15 UTC, cezariusz
Details
Improved but still not perfect enum cc in NetBeans. (13.68 KB, image/png)
2015-04-17 06:15 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
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


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo