如何从Eclipse索引中排除文件(静态代码分析)? [英] How to exclude files from Eclipse indexing (Static Code Analysis)?

查看:264
本文介绍了如何从Eclipse索引中排除文件(静态代码分析)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个makefile项目,其中包含许多源文件,标头文件和其他文件,我正尝试将它们转换为Eclipse本机"项目.索引器报告目录中存在但被构建排除的文件上的错误和警告的问题.因此,目录树的大部分都用红色的x符号标记.

I have a makefile project comprised of many source, header and other files, which I am trying to convert to an Eclipse "native" project. The problem that the Indexer reports errors and warning on files that exist in the directories but are excluded form the build. As a consequence, large parts of my directory tree are marked with the red x sign.

如何使索引器忽略特定的文件和/或目录?

注意:当将目录定义为派生"时,进一步搜索将排除该目录,但不幸的是,这不在代码分析中.使用项目资源过滤器也不能解决问题.

Note: when defining a directory as "Derived" it is excluded form further searches, but unfortunately not from code analysis. Using project Resource Filters does not solve the problem either.

推荐答案

单个文件比较棘手,但是应该可以使用文件夹. Right click on the project -> Properties -> C/C++ General -> Paths and Symbols

Individual files are tricky however folders should be possible. Right click on the project -> Properties -> C/C++ General -> Paths and Symbols

查看源位置"标签:

(a)完全删除源文件夹或

(b)定义排除过滤器(您还可以在其中添加文件夹,过滤器,并且在一定程度上还可以添加文件等)

(b) define an exlusion filter (where you can also add folders, filters and to a certain extent also files etc.)

(c)通过左键单击突出显示一个或多个文件或文件夹.然后,右键单击所选文件之一,然后选择Resource Configurations -> Exclude from build....它将排除所有选定的文件或文件夹.

(c) Highlight one or several files or folders by left clicking it. Then, right click one of the selected files, then chose Resource Configurations -> Exclude from build.... It will exclude all selected files or folders.

(d)还要查看File Types(在C/C ++ General中),然后单击路径和符号"的其他选项卡,看是否可以删除某些内容...

(d) Also take a look at File Types (in C/C++ General) and click through the other tabs of 'Paths and Symbols' and see if something can be removed...

(e),正如您可能已经看到的,还有一个索引器(Right click on the project -> Properties -> Indexer,可以对其进行配置

(e) And as you may have seen there is also an Indexer (Right click on the project -> Properties -> Indexer which can be configured

现在我希望DS-5家伙不要停用所有这些选项...

Now I hope the DS-5 guys didn't deactivate all of those options...

更新:当然,这些选项在CDT中也可用(至少其中一些).我相应地更改了说明...

Update: Of course those options are also available (at least some of those) in CDT. I changed my description accordingly...

这篇关于如何从Eclipse索引中排除文件(静态代码分析)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆