How to exclude files from Eclipse indexing (Static Code Analysis)?

家住魔仙堡 提交于 2019-11-30 12:29:43

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

Have a look at the 'Source Location' tab:

(a) completely remove a source folder or

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

(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) 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) And as you may have seen there is also an Indexer (Right click on the project -> Properties -> Indexer which can be configured

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

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

Note - this is a partial answer

Like many features in Eclipse, this is yet another option buried inside the endless configuration dialogs, and has a default setting which is contrasting the common sense...

In order to exclude indexing of files that are excluded from the build, uncheck:

Window -> Preferences -> C/C++ -> Indexer -> Index source files not included in the build

I did not find yet a way of excluding files the are included in the build. Similarly, I could not find how to exclude whole directories, but if all sources in a directory are excluded from build, then with this setting unchecked, it will be excluded from indexing as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!