Community
Participate
Working Groups
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.
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.
Created attachment 100194 [details] patch
Benno, can you review?
Patch is good. Not sure if I would release it for 3.4RC1 though.
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.
Beware of duplicate quick fixes for JUnit, see bug 287688.
*** Bug 313824 has been marked as a duplicate of this bug. ***
Released with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f0a9341a485c0c105acb2197f7f62f49b9e3fb8a
Verified in 4.2-I20120430-1800.