Bug 570469 - Differentiate normal imports from static imports when finding references of a class/interface
Summary: Differentiate normal imports from static imports when finding references of a...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.17   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.20 M3   Edit
Assignee: Julian Ruppel CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2021-01-19 03:53 EST by Julian Ruppel CLA
Modified: 2021-05-04 04:23 EDT (History)
3 users (show)

See Also:


Attachments
eclipse class reference exclude imports.png (159.50 KB, image/png)
2021-01-19 03:53 EST, Julian Ruppel CLA
no flags Details
eclipse class reference of static imports.png (160.03 KB, image/png)
2021-01-19 03:54 EST, Julian Ruppel CLA
no flags Details
example project (3.60 KB, application/x-zip-compressed)
2021-01-20 07:54 EST, Vikas Chandra CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Ruppel CLA 2021-01-19 03:53:27 EST
Created attachment 285308 [details]
eclipse class reference exclude imports.png

If you search for references of a class you typically filter out import references , in order to exclude duplicated hits in your search results. (A class that gets used in another class typically appears in its imports). However, there is a shortcoming regarding static imports. If you statically import a class, it will not appear again in the class since it is imported statically.

As a result, if you have the exclude imports filter activated (as a means of deduplication and cleaning the results), you will (unintentionally) miss static imports as well and it appears at first sight, that the class is not referenced anywhere.

You have to spot the label 'x matches filtered from view' and adjust the filter settings accordingly, but then, especially in huge codebases, you might get overwhelmed with matches of normal imports that are not interesting to you. So you would often switch back and forth with that exclude filter settings.

So my proposal is to have not one but two filter options regarding imports.
1. to exclude ONLY normal imports (which would be active most of the time I guess)
2. to exclude static imports
Comment 1 Julian Ruppel CLA 2021-01-19 03:54:18 EST
Created attachment 285309 [details]
eclipse class reference of static imports.png
Comment 2 Vikas Chandra CLA 2021-01-20 07:54:50 EST
Created attachment 285331 [details]
example project
Comment 3 Eclipse Genie CLA 2021-04-27 06:52:35 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/179870
Comment 4 Vikas Chandra CLA 2021-05-03 07:55:46 EDT
Please add a news and noteworthy item.
Comment 6 Eclipse Genie CLA 2021-05-03 12:54:29 EDT
New Gerrit change created: https://git.eclipse.org/r/c/www.eclipse.org/eclipse/news/+/180137