在完成限制IntelliJ IDEA的导入建议 [英] Limiting IntelliJ IDEA import suggestions on completion
问题描述
当我输入一个类将需要进口的名字,亲切的IntelliJ与建议列表弹出。不过,大多数时候这些建议都是东西我从来没有想要导入,尤其是意外 - 。像 java.awt中*
When I type the name of a class which will need to be imported, IntelliJ lovingly pops up with a list of suggestions. However, most of the time those suggestions are things I'd never want to import, especially by accident -- like java.awt.*
.
有没有办法来prevent包我永远不会出现在完成列表中导入?
Is there a way to prevent the packages I'll never import from appearing in the completion list?
我已经冲刷的选择,但我没有发现任何东西。
I've scoured the options but I haven't found anything.
推荐答案
根据IDEA版本:是的,
Depending on the IDEA version: Yes.
在7.0.5使用的菜单文件 - >设置
选 code完成
然后从导入并完成排除
并添加包或类你不想在你的建议。
In 7.0.5 use menu File -> Settings
choose Code Completion
and then Exclude from Import and Completion
and add the package or class that you don't want to have in your suggestions.
在版本8和9版本菜单使用文件 - >设置
键入自动进口到搜索框,并使用从导入和完成
盒子里排除。
In version 8 and version 9 use menu File -> Settings
type "Auto import" into the search box and use the Exclude from Import and Completion
box there.
在第9版您也可直接从导入建议上下文菜单中添加类和包的排除列表的选择:
In version 9 you also have the option of adding Classes and Packages to the exclude-list directly from the import suggestions context-menu:
这篇关于在完成限制IntelliJ IDEA的导入建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!