提交 dd6dbe86 编写于 作者: S Sandeep Somavarapu

Trigger default settings change only after updating the model

上级 d5d1e761
......@@ -123,6 +123,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
}
defaultSettings = this.getDefaultSettings(scope);
this.modelService.updateModel(model, defaultSettings.parse());
defaultSettings._onDidChange.fire();
}
});
......
......@@ -511,7 +511,7 @@ export class DefaultSettings extends Disposable {
private _content: string;
private _settingsByName: Map<string, ISetting>;
private _onDidChange: Emitter<void> = this._register(new Emitter<void>());
readonly _onDidChange: Emitter<void> = this._register(new Emitter<void>());
readonly onDidChange: Event<void> = this._onDidChange.event;
constructor(
......@@ -536,16 +536,12 @@ export class DefaultSettings extends Disposable {
}
parse(): string {
const currentContent = this._content;
const configurations = Registry.as<IConfigurationRegistry>(Extensions.Configuration).getConfigurations().slice();
const settingsGroups = this.removeEmptySettingsGroups(configurations.sort(this.compareConfigurationNodes).reduce((result, config, index, array) => this.parseConfig(config, result, array), []));
this.initAllSettingsMap(settingsGroups);
const mostCommonlyUsed = this.getMostCommonlyUsedSettings(settingsGroups);
this._allSettingsGroups = [mostCommonlyUsed, ...settingsGroups];
this._content = this.toContent(mostCommonlyUsed, settingsGroups);
if (this._content !== currentContent) {
this._onDidChange.fire();
}
return this._content;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册