Eclipse: Blacklist types from code completion
Is there a way to blacklist certain types from consideration i开发者_运维技巧n Eclipse's code completion?
For example, I use Google Collection's com.google.common.collect.Lists
class quite often. What I will do is type "Lists" then Ctrl-space and select a method (like newArrayList()
) and Eclipse will add the import statements automatically. But one annoying thing is that TestNG has the same identical class with a different package name org.testng.v6.Lists
and often I will select the TestNG version by mistake.
Is there a way to "blacklist" org.testng.v6.Lists
from consideration in code completion so I don't import it by mistake?
You can set up Type Filters to do this. See the section "Suppress types in content assist" here for more information.
Here are some screen shots for posterity:
Open the preferences dialog and go to Java -> Appearance -> Type Filters:
Click the "Add..." button:
Now it should appear in the Filter list:
精彩评论