Bug 179869

Summary: [quick fix] Make Auto-import more aggressive
Product: [Eclipse Project] JDT Reporter: Tim Hanson <thanson>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P5 CC: daniel_megert
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screen shot none

Description Tim Hanson CLA 2007-03-28 18:51:48 EDT
Build ID:  I20070323-1616

Steps To Reproduce:
In a blank Java method type a line like the following:

        List l = new ArrayList();

In general, you don't know whether some type has been imported or not. By the time the missing type errors are squiggled, the cursor is often on the next line.

What I would like is a more aggressive pop-up to appear below the first missing type with note that says something like "import type List - Ctrl+1". The key binding would then work no matter where the cursor is. In other words, fixing missing types would have priority over all other "Ctrl+1" quick fixes.

This is what IntelliJ has always done, and I really miss it.

This is distinct from https://bugs.eclipse.org/bugs/show_bug.cgi?id=107496, which seems to try to minimize the pain associated with the missing import.

More information:
Comment 1 Martin Aeschlimann CLA 2007-04-02 13:06:07 EDT
If I remember right, Intellij uses a different key for missing types. Our key would be 'Organize Import' or, if you enabled Organize Imports on Save, 'Save'.

No plans to play around with the CTRL+1 positioning behaviour for now
Comment 2 Tim Hanson CLA 2007-04-02 13:40:40 EDT
IntelliJ uses "Alt+Enter" for fixing imports, which is the same key binding as is used for Quick Fix (IntelliJ uses a different term called "Intention Action"). This is such a widely used operation, the preference to disable it is in the status bar.

I have attached a screen shot to show how it looks with a missing type.

I am fine with having a different key binding than Ctrl+1, as long as the key binding is shown in the popup. I would not like this bound to either Save or Organize Imports because Organize Imports does too much. I don't use it since it creates too many diffs.

Comment 3 Tim Hanson CLA 2007-04-02 13:42:14 EDT
Created attachment 62687 [details]
Screen shot