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 241008 - isSmart() vs getSortPrioOverride() from CompletionProposal iin conflict with CodeTemplates completion items
Summary: isSmart() vs getSortPrioOverride() from CompletionProposal iin conflict with ...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 240975
  Show dependency tree
 
Reported: 2014-01-27 13:24 UTC by Ondrej Brejla
Modified: 2014-02-14 02:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (1.06 KB, patch)
2014-01-27 13:37 UTC, Ondrej Brejla
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ondrej Brejla 2014-01-27 13:24:42 UTC
I one wants to use "isSmart()" method and feature in Csl completion proposals (to have really "smart" items on top of CC window underlined), then getSortPrioOverride() must return "0".

But when "getSortPrioOverride()" returns "0", then all matching Code Templates will be showed "before" my non-smart CLASSes, IFACES, PACKAGEs and MODULEs. Because CodeTemplate CC items have default sortPriority set to 650, but CLASSES and IFACES have 800 (GsfCompletionItem:144) nad PACKAGES and MODULES have 900 (GsfCompletionItem:141).

So change their priority to some other values to be showed "before" code tmplates. I suggest to change:

800 -> 620
900 -> 640
Comment 1 Ondrej Brejla 2014-01-27 13:37:58 UTC
Created attachment 144408 [details]
Proposed patch
Comment 2 Svata Dedic 2014-01-28 14:38:46 UTC
No real objections; although at the time where the original sorting weights were introduced, they were crafted so that PACKAGE, MODULE, CLASS, INTERFACE follow code templates - the reason for that ordering was not documented, though.


Mito, do you happen to know why the weights/sort prios were chosen the way they were ?
Comment 3 Milutin Kristofic 2014-01-28 16:00:31 UTC
It is probably inherited from JavaCompletionItem, maybe Dusan knows why. I really don't know, it wasn't changed from gsf times.
Comment 4 Ondrej Brejla 2014-01-28 18:39:27 UTC
If it wasn't changed since Gsf times, then I think that we can change it without any doubts. Especially when only Csl languages will be affected by the change and only that languages which uses CLS/IFACE, MODULE/PACKAGE cc item types (so imho just php...maybe javascript). So please, integrate it soon. Thanks.
Comment 5 Svata Dedic 2014-02-05 16:08:34 UTC
Integrated as jet-main#b500fbb45fe0
Comment 6 Quality Engineering 2014-02-14 02:52:33 UTC
Integrated into 'main-silver', will be available in build *201402140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b500fbb45fe0
User: Svata Dedic <sdedic@netbeans.org>
Log: #241008: fixed ordering of completion proposals