mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 313783 Log a warning if an external settings provider can't be found for the requested id
This commit is contained in:
parent
41cd409a38
commit
d46eb7e4b7
2 changed files with 13 additions and 3 deletions
|
@ -132,6 +132,9 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
|
||||||
|
|
||||||
private CExternalSettingsContainer fContainer;
|
private CExternalSettingsContainer fContainer;
|
||||||
|
|
||||||
|
/** Stash error messages so we're not too noisy if things go wrong */
|
||||||
|
private static Set<String> failingProvidersMessages;
|
||||||
|
|
||||||
private ContainerDescriptor(FactoryDescriptor factoryDr,
|
private ContainerDescriptor(FactoryDescriptor factoryDr,
|
||||||
String containerId,
|
String containerId,
|
||||||
IProject project,
|
IProject project,
|
||||||
|
@ -141,12 +144,17 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
|
||||||
try {
|
try {
|
||||||
fContainer = fFactoryDr.getFactory().createContainer(containerId, project, cfgDes, previousSettings);
|
fContainer = fFactoryDr.getFactory().createContainer(containerId, project, cfgDes, previousSettings);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(e);
|
if (failingProvidersMessages == null)
|
||||||
|
failingProvidersMessages = new HashSet<String>();
|
||||||
|
// only report the error once per session
|
||||||
|
if (!failingProvidersMessages.contains(e.getMessage()))
|
||||||
|
CCorePlugin.log(e.getMessage());
|
||||||
|
failingProvidersMessages.add(e.getMessage());
|
||||||
}
|
}
|
||||||
if(fContainer == null)
|
if(fContainer == null)
|
||||||
fContainer = NullContainer.INSTANCE;
|
fContainer = NullContainer.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CExternalSetting[] getExternalSettings(){
|
public CExternalSetting[] getExternalSettings(){
|
||||||
if(fHolder == null){
|
if(fHolder == null){
|
||||||
fHolder = new CExternalSettingsHolder();
|
fHolder = new CExternalSettingsHolder();
|
||||||
|
|
|
@ -179,7 +179,9 @@ public class ExtensionContainerFactory extends CExternalSettingContainerFactoryW
|
||||||
CExtensionSettingProviderDescriptor dr = getProviderDescriptorMap().get(id);
|
CExtensionSettingProviderDescriptor dr = getProviderDescriptorMap().get(id);
|
||||||
if(dr != null)
|
if(dr != null)
|
||||||
return dr.getContainer(project, cfgDes, previousSettings);
|
return dr.getContainer(project, cfgDes, previousSettings);
|
||||||
return CExternalSettingsManager.NullContainer.INSTANCE;
|
// Notify the manager that there's no external settings manager matching id.
|
||||||
|
throw new CoreException(CCorePlugin.createStatus("External settings provider: \"" + id + "\" couldn't be found for " + //$NON-NLS-1$//$NON-NLS-2$
|
||||||
|
cfgDes.getProjectDescription().getProject() + ":"+cfgDes.getName())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getReferencedProviderIds(ICConfigurationDescription cfg){
|
public static String[] getReferencedProviderIds(ICConfigurationDescription cfg){
|
||||||
|
|
Loading…
Add table
Reference in a new issue