mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Add debounce for schema changes to fix slowness when launching with the settings editor persisted open
This commit is contained in:
parent
3006b97f30
commit
207a56ee2c
|
@ -68,6 +68,7 @@ export class SettingsEditor2 extends BaseEditor {
|
|||
private static NUM_INSTANCES: number = 0;
|
||||
private static SETTING_UPDATE_FAST_DEBOUNCE: number = 200;
|
||||
private static SETTING_UPDATE_SLOW_DEBOUNCE: number = 1000;
|
||||
private static CONFIG_SCHEMA_UPDATE_DELAYER = 500;
|
||||
|
||||
private static readonly SUGGESTIONS: string[] = [
|
||||
`@${MODIFIED_SETTING_TAG}`, '@tag:usesOnlineServices', `@${EXTENSION_SETTING_TAG}`
|
||||
|
@ -112,6 +113,8 @@ export class SettingsEditor2 extends BaseEditor {
|
|||
private remoteSearchThrottle: ThrottledDelayer<void>;
|
||||
private searchInProgress: CancellationTokenSource | null = null;
|
||||
|
||||
private updatedConfigSchemaDelayer: Delayer<void>;
|
||||
|
||||
private settingFastUpdateDelayer: Delayer<void>;
|
||||
private settingSlowUpdateDelayer: Delayer<void>;
|
||||
private pendingSettingUpdate: { key: string, value: any } | null = null;
|
||||
|
@ -158,6 +161,8 @@ export class SettingsEditor2 extends BaseEditor {
|
|||
this.settingFastUpdateDelayer = new Delayer<void>(SettingsEditor2.SETTING_UPDATE_FAST_DEBOUNCE);
|
||||
this.settingSlowUpdateDelayer = new Delayer<void>(SettingsEditor2.SETTING_UPDATE_SLOW_DEBOUNCE);
|
||||
|
||||
this.updatedConfigSchemaDelayer = new Delayer<void>(SettingsEditor2.CONFIG_SCHEMA_UPDATE_DELAYER);
|
||||
|
||||
this.inSettingsEditorContextKey = CONTEXT_SETTINGS_EDITOR.bindTo(contextKeyService);
|
||||
this.searchFocusContextKey = CONTEXT_SETTINGS_SEARCH_FOCUS.bindTo(contextKeyService);
|
||||
this.tocRowFocused = CONTEXT_TOC_ROW_FOCUS.bindTo(contextKeyService);
|
||||
|
@ -848,7 +853,9 @@ export class SettingsEditor2 extends BaseEditor {
|
|||
}
|
||||
|
||||
this._register(model.onDidChangeGroups(() => {
|
||||
this.updatedConfigSchemaDelayer.trigger(() => {
|
||||
this.onConfigUpdate(undefined, undefined, true);
|
||||
});
|
||||
}));
|
||||
this.defaultSettingsEditorModel = model;
|
||||
return this.onConfigUpdate(undefined, true);
|
||||
|
|
Loading…
Reference in a new issue