mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 102701: [Scanner Discovery] Per-file options also given to header files incorrectly.
Added check to remove include and macros files from returned scanner info that match the parsed resource.
This commit is contained in:
parent
85294104b3
commit
7436519c80
1 changed files with 12 additions and 3 deletions
|
@ -62,16 +62,25 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer
|
||||||
entries.add(CoreModel.newMacroEntry(path, (String)entry.getKey(), (String)entry.getValue())); //$NON-NLS-1$
|
entries.add(CoreModel.newMacroEntry(path, (String)entry.getKey(), (String)entry.getValue())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((mask & IPathEntry.CDT_INCLUDE_FILE) != 0) {
|
// compare the resource with include and macros files
|
||||||
|
IPath fullResPath = fProject.getWorkspace().getRoot().getFile(path).getLocation();
|
||||||
|
if (fullResPath == null) {
|
||||||
|
fullResPath = path;
|
||||||
|
}
|
||||||
|
if ((mask & IPathEntry.CDT_INCLUDE_FILE) != 0) {
|
||||||
IPath[] includeFiles = filePathInfo.getIncludeFiles(path);
|
IPath[] includeFiles = filePathInfo.getIncludeFiles(path);
|
||||||
for (int i = 0; i < includeFiles.length; i++) {
|
for (int i = 0; i < includeFiles.length; i++) {
|
||||||
entries.add(CoreModel.newIncludeFileEntry(path, includeFiles[i]));
|
if (!includeFiles[i].equals(fullResPath)) {
|
||||||
|
entries.add(CoreModel.newIncludeFileEntry(path, includeFiles[i]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((mask & IPathEntry.CDT_MACRO_FILE) != 0) {
|
if ((mask & IPathEntry.CDT_MACRO_FILE) != 0) {
|
||||||
IPath[] imacrosFiles = filePathInfo.getMacroFiles(path);
|
IPath[] imacrosFiles = filePathInfo.getMacroFiles(path);
|
||||||
for (int i = 0; i < imacrosFiles.length; i++) {
|
for (int i = 0; i < imacrosFiles.length; i++) {
|
||||||
entries.add(CoreModel.newMacroFileEntry(path, imacrosFiles[i]));
|
if (!imacrosFiles[i].equals(fullResPath)) {
|
||||||
|
entries.add(CoreModel.newMacroFileEntry(path, imacrosFiles[i]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue