mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Small fix for the discovery mechanism
This commit is contained in:
parent
f1bffec1a7
commit
03d6dd70f8
3 changed files with 30 additions and 16 deletions
|
@ -156,6 +156,7 @@ public class ScannerConfigBuilder extends ACBuilder {
|
|||
// update and persist scanner configuration
|
||||
CfgSCJobsUtil.updateScannerConfiguration(project, context, instance, buildInfo2, new SubProgressMonitor(monitor, 30));
|
||||
|
||||
CfgDiscoveredPathManager.getInstance().removeDiscoveredInfo(project, context, false);
|
||||
if((flags & PERFORM_CORE_UPDATE) != 0)
|
||||
CfgDiscoveredPathManager.getInstance().updateCoreSettings(project, new IConfiguration[]{cfg});
|
||||
|
||||
|
|
|
@ -320,22 +320,26 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
|
|||
return info;
|
||||
}
|
||||
|
||||
private PathInfo removeCachedPathInfo(ContextInfo cInfo){
|
||||
private void removeCachedPathInfo(ContextInfo cInfo){
|
||||
// ICfgScannerConfigBuilderInfo2Set cfgInfo = cInfo.fCfgInfo;
|
||||
PathInfo info = getCachedPathInfo(cInfo, true, true, true);
|
||||
// boolean queryCfg = !cfgInfo.isPerRcTypeDiscovery();
|
||||
// if(!queryCfg){
|
||||
// Tool tool = (Tool)context.getTool();
|
||||
// if(tool != null){
|
||||
// info = tool.getDiscoveredPathInfo(context.getInputType());
|
||||
// } else {
|
||||
// queryCfg = true;
|
||||
// }
|
||||
// }
|
||||
// if(queryCfg) {
|
||||
// info = ((Configuration)context.getConfiguration()).getDiscoveredPathInfo();
|
||||
// }
|
||||
return info;
|
||||
if(cInfo.fIsFerFileCache){
|
||||
Configuration cfg = (Configuration)cInfo.fInitialContext.getConfiguration();
|
||||
cfg.clearDiscoveredPathInfo();
|
||||
|
||||
IResourceInfo[] infos = cfg.getResourceInfos();
|
||||
for(int i = 0; i < infos.length; i++){
|
||||
IResourceInfo rcInfo = infos[i];
|
||||
ITool[] tools = rcInfo.getTools();
|
||||
for(int k = 0; k < tools.length; k++){
|
||||
Tool tool = (Tool)tools[k];
|
||||
tool.clearAllDiscoveredPathInfo();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setCachedPathInfo(cInfo, null);
|
||||
}
|
||||
|
||||
// PathInfo info = getCachedPathInfo(cInfo, true, true, true);
|
||||
}
|
||||
|
||||
private PathInfo getCachedPathInfo(ContextInfo cInfo, boolean queryParent, boolean clearIfInvalid, boolean clear){
|
||||
|
@ -527,6 +531,10 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
|
|||
}
|
||||
|
||||
public void removeDiscoveredInfo(IProject project, CfgInfoContext context) {
|
||||
removeDiscoveredInfo(project, context, true);
|
||||
}
|
||||
|
||||
public void removeDiscoveredInfo(IProject project, CfgInfoContext context, boolean removeBaseCache) {
|
||||
// if(context == null)
|
||||
// context = ScannerConfigUtil.createContextForProject(project);
|
||||
|
||||
|
@ -534,6 +542,7 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
|
|||
|
||||
removeCachedPathInfo(cInfo);
|
||||
|
||||
fBaseMngr.removeDiscoveredInfo(project, cInfo.fLoadContext.toInfoContext());
|
||||
if(removeBaseCache)
|
||||
fBaseMngr.removeDiscoveredInfo(project, cInfo.fLoadContext.toInfoContext());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3921,6 +3921,10 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
|
|||
return (PathInfoCache)discoveredInfoMap.remove(getTypeKey(type));
|
||||
}
|
||||
|
||||
public void clearAllDiscoveredPathInfo(){
|
||||
discoveredInfoMap.clear();
|
||||
}
|
||||
|
||||
public void clearAllDiscoveredInfo(){
|
||||
discoveredInfoMap.clear();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue