Bug 181788 - [quick fix] Quick fix to import static from favorite class
Summary: [quick fix] Quick fix to import static from favorite class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement with 4 votes (vote)
Target Milestone: 3.8 M7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 313824 (view as bug list)
Depends on:
Blocks: 287688
  Show dependency tree
 
Reported: 2007-04-10 12:03 EDT by David Saff CLA
Modified: 2012-05-01 07:50 EDT (History)
4 users (show)

See Also:
benno.baumgartner: review+


Attachments
patch (18.01 KB, patch)
2008-05-14 11:01 EDT, Martin Aeschlimann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Saff CLA 2007-04-10 12:03:03 EDT
In 3.3M6

The content assist to import a static member from one of several favorite classes is a godsend.  I'd like to extend it to work the same as instance methods in the class--not only would static members from favorite classes be available for content assist, but also as quick fixes.  So if I type

sin(3)

And Math.* is in my favorites, a quick fix on the error would include the option to import static Math.sin.
Comment 1 Daniel Aborg CLA 2007-07-18 18:47:06 EDT
This is especially important considering that Ctrl-Space doesn't always bring up content assist applicable to the error in question. If your static method call is the parameter to a method, Ctrl-Space brings up the method parameter list instead of the content assist which allows you to do a static import.
Comment 2 Martin Aeschlimann CLA 2008-05-14 11:01:28 EDT
Created attachment 100194 [details]
patch
Comment 3 Martin Aeschlimann CLA 2008-05-14 11:02:03 EDT
Benno, can you review?
Comment 4 Benno Baumgartner CLA 2008-05-14 12:02:03 EDT
Patch is good. Not sure if I would release it for 3.4RC1 though.
Comment 5 Martin Aeschlimann CLA 2008-05-14 12:19:57 EDT
We decided to release this for 3.5 as the change has a risk of impacting the performance.
The workaround for 3.4 is to use code assist after the unresolved element. This will add the static import the same way as the new quick fix would do it.
Comment 6 Markus Keller CLA 2009-08-26 13:27:50 EDT
Beware of duplicate quick fixes for JUnit, see bug 287688.
Comment 7 Dani Megert CLA 2010-05-21 02:30:50 EDT
*** Bug 313824 has been marked as a duplicate of this bug. ***
Comment 9 Dani Megert CLA 2012-05-01 07:50:23 EDT
Verified in 4.2-I20120430-1800.