1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Fix for Bug 175762 - OpenIncludeAction only looks in system include directories, not local includes (patch by Warren Paul)

This commit is contained in:
Anton Leherbauer 2007-03-02 14:35:43 +00:00
parent 5d94f504c5
commit 6ec9ab35c3

View file

@ -43,6 +43,8 @@ import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
import org.eclipse.cdt.ui.CUIPlugin;
@ -95,15 +97,25 @@ public class OpenIncludeAction extends Action {
info = provider.getScannerInformation(proj);
}
if (info != null) {
// search in system includes
String[] includePaths = info.getIncludePaths();
findFile(includePaths, includeName, filesFound);
}
if (filesFound.size() == 0) {
// search in local includes
if (info != null) {
IExtendedScannerInfo scanInfo = new ExtendedScannerInfo(info);
String[] localIncludePaths = scanInfo.getLocalIncludePath();
findFile(localIncludePaths, includeName, filesFound);
}
if (filesFound.size() == 0) {
// Fall back and search the project
findFile(proj, new Path(includeName), filesFound);
}
}
}
}
IPath fileToOpen;
int nElementsFound= filesFound.size();
if (nElementsFound == 0) {