Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: Blacklist types from code completion

Tags:

Is there a way to blacklist certain types from consideration in 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?

like image 213
bajafresh4life Avatar asked Jul 28 '11 17:07

bajafresh4life


1 Answers

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:

Type Filter Preferences

Click the "Add..." button:

Add Type Filter Dialog

Now it should appear in the Filter list:

New Type Filter Added

like image 89
laz Avatar answered Sep 21 '22 00:09

laz