"Static import method..." popup

When writing JUnit 4.x tests, you'll likely use assertion methods like assertEquals().
It's common to use static imports for such methods, to keep the test code concise and readable.

For an unresolved assertEquals() reference, IDEA provides the "Static Import Method..." QuickFix, which looks like this:
assertEquals.png
These static import popups have a lot of noise.
While there are many overloaded variants of assertEquals(), it does not matter which one I choose (ignoring for the sake of argument the groovy variants in the popup I got).
In the end, the same "import static junit.framework.Assert.assertEquals;" line will be inserted.
Are there any plans to make this popup a bit friendlier in IDEA 10?

5 comments

Fixed in 96.150

regards,
Alexey Kudravtsev

0

Alexey, I don't see the change in #96.156.
Do I need to enable some specific option/setting?

Regards,
Taras

0

Indeed, it will be since #96.162
Sorry for confusion,
--
regards,
Alexey Kudravtsev

0

Hi Alexey,

It works well. I've entered http://youtrack.jetbrains.net/issue/IDEA-54800 for a small improvement.

When working with JUnit/Mockito/EasyMock/Hamcrest/etc, getting convenience methods statically imported can still be painful.
This has been discussed before, of course, and there are some common ideas:
1) 'static import favorites' a la Eclipse
2) Ctrl-Alt-Space completion for static methods

Are there any plans to experiment with such approaches for IDEA 10?
This is a tricky problem, as most solutions have downsides as well.

Regards,
Taras

0

Hi Alexey,

Thanks for the fix - much better.

I've filed two additional feature requests for IDEA 10. I'm interested to know what you (and "Completion Peter") think of it:

"static import method" popup: provide ability to exclude and honor existing excludes:
http://youtrack.jetbrains.net/issue/IDEA-54852

Provide ability to statically import methods through code completion:
http://youtrack.jetbrains.net/issue/IDEA-54855

Of course, positive/negative feedback from other IDEA users would be much appreciated as well.

Kind regards,
Taras

0

Please sign in to leave a comment.