Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Eclipse Content Assist not using static imports

I'm trying to use JUnit and Mockito with content assist for static imports.

My Content Assist favorites lists: org.mockito.Mockito.*

When I use content assist for the mock() method, the method is availble, but the import is just get a regular non-static import. Why is this not working?

like image 941
FatLlama Avatar asked Jan 18 '12 15:01

FatLlama


1 Answers

Eclipse won't look for static imports unless you tell it to. From the Eclipse Java Content Assist Favorites Preferences help page:

To see the static import proposals, make sure Use static imports is enabled on the Content Assist preference page

Admittedly, on my machine it was enabled by default.

like image 81
ThomasH Avatar answered Oct 01 '22 06:10

ThomasH