| Summary: | Improve 'Open Resource' dialog filtering sort order | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Adam Hawthorne <adamh> | ||||
| Component: | IDE | Assignee: | Platform-UI-Inbox <Platform-UI-Inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P2 | CC: | akurtakov, bsd, daniel_megert, deepakazad, gautier.desaintmartinlacaze, jan, lbullen, markus.kell.r, siegmaralber | ||||
| Version: | 3.7.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=525974 | ||||||
| Whiteboard: | stalebug | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 109670, 387126 | ||||||
| Attachments: |
|
||||||
|
Description
Adam Hawthorne
(In reply to comment #0) > (This probably does not belong in JDT, but I'm not sure what the platform > product name is, sorry) > np > The 'Open Resource' dialog (Ctrl/Cmd+Shift+R) should sort classes with fewer > capital letters earlier than those with more. > > For instance, I have two files: > > ConstantStringMap.java > ConstString.java I assume you wanted: ConstantStringMap.java ConstStringMap.java otherwise your examples will do what you expect i.e. CSM or ConstStrM will only return 1 result. > Currently, they sort in the above order. This means I *must* leave the home > row and arrow down to get to the ConstString file. If they sorted in the > opposite order, one could type 'CSM' or 'ConstStrM' to eliminate the > ConstString item from the list, and hit <enter> directly from the input field. > The camel-caps matching already significantly improves opening resources with > long names. The UI's current behavior of preferring longer names limits its > utility for short resources. > I don't agree that the length of a name (segment) should be used to tweak the sort order. Personally I'd close this as WONTFIX. (In reply to comment #1) > > I assume you wanted: > ConstantStringMap.java > ConstStringMap.java > otherwise your examples will do what you expect i.e. CSM or ConstStrM will > only return 1 result. No, not quite. I want to be able to reach 'ConstString.java' by typing (something like) 'CS' and hitting <enter> Currently, if I type 'CS', I get: ConstantStringMap.java ConstString.java > > I don't agree that the length of a name (segment) should be used to tweak the > sort order. Personally I'd close this as WONTFIX. Sorry for being unclear - it's not the _length_ of the name so much as the number of capital letters. If names with fewer capital letters sorted earlier, typing 'CS' would show: ConstString.java ConstStringMap.java I could select ConstString.java by hitting <enter>, or I could select ConstStringMap.java simplay by adding an 'M', and both are reachable through the camel caps shortcut. (In reply to comment #2) > Sorry for being unclear - it's not the _length_ of the name so much as the > number of capital letters. If names with fewer capital letters sorted earlier, > typing 'CS' would show: > > ConstString.java > ConstStringMap.java I just tried this in my dev workspace with 'CS' and 'SWT', and I think the ordering here is random. e.g. with 'CS' as filter I get the following order :) CancelSearchAction.java CaseStatement.java ChangeSignatureProcessor.java (In reply to comment #3) > > I just tried this in my dev workspace with 'CS' and 'SWT', and I think the > ordering here is random. e.g. with 'CS' as filter I get the following order :) > > CancelSearchAction.java > CaseStatement.java > ChangeSignatureProcessor.java Hmm... I wonder if it's in order by package name? Those two classes happen to be in the same package for me. (In reply to comment #4) > Hmm... I wonder if it's in order by package name? Those two classes happen to > be in the same package for me. Nope, file paths are also random. The only ordering I see in Open Resource dialog (and in Open Type dialog) is that camel case matches appear before exact matches (which I dislike) e.g. with filter as 'SWT'. (In reply to comment #3) > I just tried this in my dev workspace with 'CS' and 'SWT', and I think the > ordering here is random. e.g. with 'CS' as filter I get the following order :) > > CancelSearchAction.java > CaseStatement.java > ChangeSignatureProcessor.java Doesn't look random to me -- it's just alphabetic, ignoring case. If we touch this for camel case patterns, then we need to make sure that the results don't change their order as the user continues typing more characters. And we need the same logic in Open Type (such that "SWT" shows SWT before SimpleWildcardTester). (In reply to comment #5) > Nope, file paths are also random. Definitely not. But there's one caveat with paths, as the help page says: "If the pattern matches many files with the same name, the files that are closer to the currently edited or selected resource are shown on top of the matching items list." This e.g. makes sure that typing "makef" prefers the makefile in the current folder. This was once fixed in the Open Type dialog, see bug 170885. But the fix was only effective for the old Open Type implementation (TypeInfoViewer). The relevant part of the comparator needs to be implemented in the FilteredItemsSelectionDialog as well. Note that a 1:1 copy of the code will probably not do it due to the bad code quality of FilteredItemsSelectionDialog (e.g. matchesRawNamePattern(Object) is not used anywhere). *** Bug 387126 has been marked as a duplicate of this bug. *** *** Bug 394919 has been marked as a duplicate of this bug. *** Created attachment 229780 [details]
Possible fix
Checks if the first character is upper case, then compares the number of initials (upper case letters). The result with fewer initials goes first.
I reused some internal code from platform UI to collect the initials. For the find resource dialog we can x-friend the usage, but it would be better if someone provides an API for working with camel case.
(In reply to comment #11) > Created attachment 229780 [details] [diff] > Possible fix > > Checks if the first character is upper case, then compares the number of > initials (upper case letters). The result with fewer initials goes first. > > I reused some internal code from platform UI to collect the initials. For > the find resource dialog we can x-friend the usage, but it would be better > if someone provides an API for working with camel case. Please see comment 6 and comment 8. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |