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:
parent
77a7513b82
commit
7c5f2b01da
2 changed files with 15 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2004-05-25 Alain Magloire
|
||||
|
||||
Ask the IScannerInfo for the IResource.
|
||||
|
||||
2004-05-25 Alain Magloire
|
||||
|
||||
Provide better orderin of the ScannerProvider.
|
||||
|
|
|
@ -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.util.ASTUtil;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
||||
|
||||
public class CModelBuilder {
|
||||
|
@ -144,7 +145,16 @@ public class CModelBuilder {
|
|||
IScannerInfo scanInfo = new ScannerInfo();
|
||||
IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(currentProject);
|
||||
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){
|
||||
scanInfo = new ScannerInfo(buildScanInfo.getDefinedSymbols(), buildScanInfo.getIncludePaths());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue