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:
parent
5d94f504c5
commit
6ec9ab35c3
1 changed files with 14 additions and 2 deletions
|
@ -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,12 +97,22 @@ 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) {
|
||||
// Fall back and search the project
|
||||
findFile(proj, new Path(includeName), filesFound);
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue