Bug 515081 - [open type] Open Type dialog doesn't include local classes
Summary: [open type] Open Type dialog doesn't include local classes
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on: 546075
Blocks:
  Show dependency tree
 
Reported: 2017-04-11 04:04 EDT by Lukas Eder CLA
Modified: 2019-04-03 04:14 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Eder CLA 2017-04-11 04:04:24 EDT
Consider the following classes:

public class AAA {
    public void m() {
        class BBB {

        }
    }
}

BBB is a local class, which cannot be found using the Open Type search dialog (Ctrl-Shift-T). This behaviour is inconsistent with the display on the Outline or the package explorer views, which clearly display BBB as a class which I can navigate to
Comment 1 Dani Megert CLA 2017-04-11 10:38:00 EDT
Confirmed using 4.7 M6.
Comment 2 Noopur Gupta CLA 2017-04-11 12:20:06 EDT
For Open Type dialog, we use the API SearchEngine.searchAllTypeNames(...) which searches for all top-level types and member types. It does not search for local types and there is no other API in the SearchEngine which includes local types in the result.
Comment 3 Noopur Gupta CLA 2017-04-13 07:15:38 EDT
Local types are not used very frequently. Also, to fix this issue, we'll first need a new API from jdt.core that searches for local types.
Comment 4 Lukas Eder CLA 2019-03-29 09:25:28 EDT
Ran into this again. Would be really helpful for me...
Comment 5 Dani Megert CLA 2019-03-29 09:50:10 EDT
If this is done, it must come with a filter that is enabled by default.
Comment 6 Lukas Eder CLA 2019-03-29 10:45:01 EDT
I agree. Note, I would expect local classes to become more popular, once records are available: https://cr.openjdk.java.net/~briangoetz/amber/datum.html
Comment 7 Noopur Gupta CLA 2019-04-03 04:14:35 EDT
It can be done with the filter in UI. Requested for the API from JDT Core in bug 546075.