use of org.eclipse.cdt.core.index.IIndexInclude in project arduino-eclipse-plugin by Sloeber.
the class Libraries method getUnresolvedProjectIncludes.
private static Set<String> getUnresolvedProjectIncludes(IProject iProject) {
Set<String> ret = new TreeSet<>();
ICProject tt = CoreModel.getDefault().create(iProject);
IIndex index = null;
try {
index = CCorePlugin.getIndexManager().getIndex(tt);
index.acquireReadLock();
try {
IIndexFile[] allFiles = index.getFilesWithUnresolvedIncludes();
for (IIndexFile curUnesolvedIncludeFile : allFiles) {
IIndexInclude[] includes = curUnesolvedIncludeFile.getIncludes();
for (IIndexInclude curinclude : includes) {
if (curinclude.isActive() && !curinclude.isResolved()) {
ret.add(new Path(curinclude.getName()).removeFileExtension().toString());
}
}
}
} finally {
index.releaseReadLock();
}
} catch (CoreException e1) {
// ignore
e1.printStackTrace();
} catch (InterruptedException e) {
// ignore
e.printStackTrace();
}
return ret;
}
Aggregations