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

Fixed decorators in PE showing incorrectly for legacy (MBS provider)

This commit is contained in:
Andrew Gvozdev 2011-12-12 14:31:07 -05:00
parent 3713fcd080
commit 8c7108d523
3 changed files with 10 additions and 13 deletions

View file

@ -69,7 +69,7 @@ public class MBSLanguageSettingsProvider extends AbstractExecutableExtensionBase
}
}
}
return list;
return LanguageSettingsStorage.getPooledList(list);
}
private ICLanguageSetting[] getLanguageSettings(ICResourceDescription rcDescription) {

View file

@ -77,6 +77,8 @@ public interface ILanguageSettingsProvider {
* (see {@link LanguageManager#getLanguageForFile(org.eclipse.core.resources.IFile, ICConfigurationDescription)}).
*
* @return the list of setting entries or {@code null} if no settings defined.
* The list needs to be a pooled list created by {@link LanguageSettingsStorage#getPooledList(List)}
* to save memory and avoid deep equality comparisons.
*/
public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId);
}

View file

@ -30,7 +30,6 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.ui.texteditor.MarkerUtilities;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsBroadcastingProvider;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider;
import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
@ -397,12 +396,10 @@ public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabe
if (cfgDescription instanceof ILanguageSettingsProvidersKeeper) {
for (ILanguageSettingsProvider provider: ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders()) {
if (provider instanceof ILanguageSettingsBroadcastingProvider) {
for (String languageId : LanguageSettingsManager.getLanguages(rc, cfgDescription)) {
List<ICLanguageSettingEntry> list = provider.getSettingEntries(cfgDescription, rc, languageId);
if (list!=null) {
// TODO - check default or check parent?
List<ICLanguageSettingEntry> listDefault = provider.getSettingEntries(null, null, languageId);
List<ICLanguageSettingEntry> listDefault = provider.getSettingEntries(cfgDescription, rc.getParent(), languageId);
// != is OK here due as the equal lists will have the same reference in WeakHashSet
if (list != listDefault)
return true;
@ -410,8 +407,6 @@ public class ProblemsLabelDecorator implements ILabelDecorator, ILightweightLabe
}
}
}
}
return false;
}