Bug 576927 - Improve OpenType behavior to suggest types from source first
Summary: Improve OpenType behavior to suggest types from source first
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.21   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-28 04:23 EDT by Gayan Perera CLA
Modified: 2021-11-02 02:48 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gayan Perera CLA 2021-10-28 04:23:39 EDT
Today when you search for a type in OpenType dialog you see all types contributed from workspace classpath entries. This sometimes leads to opening a Binary class instead of the Source class in the workspace project.

One suggestion is to when 
- Searching for types, first show types that matches in Source classpath entries, if nothing is found then search on binary classpath entries.

- Introduce a key shortcut like in SpringTools Symbol Viewer to switch from source entry mode to both source+binary entry mode.
Comment 1 Gayan Perera CLA 2021-10-28 04:26:51 EDT
A quick win should be to start with Java Main Sources workingset and introduce a shortcut to toggle it which should give the same described behavior.
Comment 2 Andrey Loskutov CLA 2021-10-28 04:41:23 EDT
Proposed behavior change makes sense, but I haven't checked if or how it could be implemented.

One thing I wonder is: we must have already some kind of sorting in the open type dialog results, so instead of changing how search works by changing the search scope, could we simply change the sort order to prefer source types (and put it first) if both source / binary types with same name are found for same search pattern?
Comment 3 Gayan Perera CLA 2021-10-30 09:51:17 EDT
(In reply to Andrey Loskutov from comment #2)
> One thing I wonder is: we must have already some kind of sorting in the open
> type dialog results, so instead of changing how search works by changing the
> search scope, could we simply change the sort order to prefer source types
> (and put it first) if both source / binary types with same name are found
> for same search pattern?

If we do so how should we sort, i mean will the order will be like
1. order by source vs binary
2. sort Alphabetically 

Which might looks good and hard to understand what happening if someone doesn't know about it.

What about using the filter instead of playing with Scope at UI layer ? IType already provides a way to check if binary or not.
Comment 4 Sarika Sinha CLA 2021-11-02 02:48:33 EDT
(In reply to Gayan Perera from comment #3)
> (In reply to Andrey Loskutov from comment #2)
> > One thing I wonder is: we must have already some kind of sorting in the open
> > type dialog results, so instead of changing how search works by changing the
> > search scope, could we simply change the sort order to prefer source types
> > (and put it first) if both source / binary types with same name are found
> > for same search pattern?
> 
> If we do so how should we sort, i mean will the order will be like
> 1. order by source vs binary
> 2. sort Alphabetically 
> 
> Which might looks good and hard to understand what happening if someone
> doesn't know about it.
> 
> What about using the filter instead of playing with Scope at UI layer ?
> IType already provides a way to check if binary or not.

Yes, I agree it will be difficult to understand the sorting.Can we have a toggle, filter, or a button "Search in source only"