How to exclude files from Eclipse indexing (static code analysis)?

I have a makefile project that consists of many source files, headers, and other files that I am trying to convert to a "native" Eclipse project. The problem is that Indexer reports errors and warnings about files that exist in directories but are excluded from the assembly. As a result, large parts of my directory tree are marked with a red x .

How can I make Indexer ignore certain files and / or directories?

Note: when a directory is defined as Derived, it is excluded from further search, but, unfortunately, not from code analysis. Using project resource filters also does not solve the problem.

+7
eclipse eclipse-cdt static-analysis ds-5
source share
2 answers

Individual files are complex, however folders must be accessible. Right click on the project -> Properties -> C/C++ General -> Paths and Symbols

Take a look at the Source Location tab:

(a) completely delete the source folder or

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

(c) Select one or more files or folders by left-clicking. Then right-click one of the selected files, then select Resource Configurations -> Exclude from build... It excludes all selected files or folders.

(d) Also check out File Types (in C / C ++ General) and go to the other tabs “Paths and Symbols” and see if you can delete anything ...

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

Now I hope that the DS-5 guys have not deactivated all of these options ...

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

+6
source share

Note is a partial answer.

Like many features in Eclipse, this is another option buried inside endless configuration dialogs and has a default setting that contrasts with common sense ...

To exclude indexing of files excluded from the assembly, clear the check box:

WindowPreferencesC/C++IndexerIndex source files not included in the build

I have not yet found a way to exclude files that are included in the assembly. In the same way, I could not find how to exclude whole directories, but if all sources in the directory are excluded from the assembly, this parameter will not be checked, it will also be excluded from indexing.

+4
source share

All Articles