Why Eclipse Content Assist Doesn't Use Static Import

I am trying to use JUnit and Mockito with content support for static import.

org.mockito.Mockito.* Content Lists: org.mockito.Mockito.*

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

+6
source share
2 answers

Eclipse will not look for static imports unless you report it. On the Eclipse Help page, Preferences Help from the Java page :

To see static import offers, make sure Use static import is enabled on the settings page. Content>

Admittedly, on my machine it was turned on by default.

+5
source

I am just starting with Eclipse, but have run into this problem with a tutorial. I spend a couple of hours trying to figure out what was wrong when I called up content help using ctrl + O, instead of using hovering. Then the static elements were displayed correctly.

0
source

Source: https://habr.com/ru/post/906317/


All Articles