twitter-bootstrap 从 Intellij 检查中排除目录,但不从自动完成中排除
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14437647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exclude directory from intellij inspection, but not exclude from autocomplete
提问by NimChimpsky
As far as I know, the only way to exclude a directory is to mark it as excluded in project structure. However, this would make IntelliJ totally ignore the directory. Thus it will not appear in autocomplete options.
据我所知,排除目录的唯一方法是在项目结构中将其标记为排除。但是,这会使 IntelliJ 完全忽略该目录。因此它不会出现在自动完成选项中。
I do not want this. I want exclusion from inspections but inclusion in everything else. Is this possible?
我不想要这个。我希望排除在检查之外,但要包含在其他所有内容中。这可能吗?
I'm using Intellij 12.0.2. And, it's actually the bootstrap css and js failing the inspection.
我正在使用 Intellij 12.0.2。而且,它实际上是引导 css 和 js 未通过检查。
采纳答案by CrazyCoder
As suggested by Peter Lawrey, the proper solution would be to use the custom inspection scopethat excludes the directories where you don't want the inspections to be run.
正如Peter Lawrey所建议的,正确的解决方案是使用自定义检查范围,排除您不希望运行检查的目录。
回答by mmmichl
With IntelliJ 15, you can mark the directory as Generated Sources Root. This skips the inspections but auto-complete will still work.
使用 IntelliJ 15,您可以将目录标记为Generated Sources Root. 这会跳过检查,但自动完成仍然有效。
- Right click on the desired directory
- Select
Mark Directory As/Generated Sources Root
- 右键单击所需目录
- 选择
Mark Directory As/Generated Sources Root
NB: It seems, that you cannot select this type in the Project Structuredialogue, only via the right click.
注意:看来,您无法在Project Structure对话框中选择此类型,只能通过右键单击。
回答by madhead
There is man in a hat in status bar. Click on it and select inspection level.
状态栏中有一个戴帽子的人。单击它并选择检查级别。


Also, if you have many files you want to supress inspection, then go to .ideaand edit workspace.xml, find <component name="HighlightingSettingsPerFile">and add line like this:
此外,如果您有许多文件要禁止检查,请转到.idea并编辑workspace.xml、查找<component name="HighlightingSettingsPerFile">并添加如下行:
<setting file="file://$PROJECT_DIR$/src/main/config/config.xml" root0="SKIP_HIGHLIGHTING" />
I find it simplier than editing inspection levels.
我发现它比编辑检查级别更简单。

