开发者

Eclipse: Blacklist types from code completion

开发者 https://www.devze.com 2023-03-24 02:52 出处:网络
Is there a way to blacklist certain types from consideration i开发者_运维技巧n Eclipse\'s 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:

Eclipse: Blacklist types from code completion

Click the "Add..." button:

Eclipse: Blacklist types from code completion

Now it should appear in the Filter list:

Eclipse: Blacklist types from code completion

0

精彩评论

暂无评论...
验证码 换一张
取 消