1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Ask the IScannerInfo for the IResource.

This commit is contained in:
Alain Magloire 2004-05-25 20:29:00 +00:00
parent 77a7513b82
commit 7c5f2b01da
2 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2004-05-25 Alain Magloire
Ask the IScannerInfo for the IResource.
2004-05-25 Alain Magloire 2004-05-25 Alain Magloire
Provide better orderin of the ScannerProvider. Provide better orderin of the ScannerProvider.

View file

@ -65,6 +65,7 @@ import org.eclipse.cdt.internal.core.parser.QuickParseCallback;
import org.eclipse.cdt.internal.core.parser.StructuralParseCallback; import org.eclipse.cdt.internal.core.parser.StructuralParseCallback;
import org.eclipse.cdt.internal.core.parser.util.ASTUtil; import org.eclipse.cdt.internal.core.parser.util.ASTUtil;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
public class CModelBuilder { public class CModelBuilder {
@ -144,7 +145,16 @@ public class CModelBuilder {
IScannerInfo scanInfo = new ScannerInfo(); IScannerInfo scanInfo = new ScannerInfo();
IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(currentProject); IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(currentProject);
if (provider != null){ if (provider != null){
IScannerInfo buildScanInfo = provider.getScannerInformation(currentProject); IScannerInfo buildScanInfo = null;
IResource res = translationUnit.getResource();
if (res != null) {
buildScanInfo = provider.getScannerInformation(res);
}
// Technically we should not do this. But the managed scanner providers
// may rely on this behaviour i.e. only provide scannerInfo for projects
if (buildScanInfo == null) {
buildScanInfo = provider.getScannerInformation(currentProject);
}
if (buildScanInfo != null){ if (buildScanInfo != null){
scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths()); scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths());
} }