Skip to content

Commit 207a56e

Browse files
committed
Add debounce for schema changes to fix slowness when launching with the settings editor persisted open
1 parent 3006b97 commit 207a56e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class SettingsEditor2 extends BaseEditor {
6868
private static NUM_INSTANCES: number = 0;
6969
private static SETTING_UPDATE_FAST_DEBOUNCE: number = 200;
7070
private static SETTING_UPDATE_SLOW_DEBOUNCE: number = 1000;
71+
private static CONFIG_SCHEMA_UPDATE_DELAYER = 500;
7172

7273
private static readonly SUGGESTIONS: string[] = [
7374
`@${MODIFIED_SETTING_TAG}`, '@tag:usesOnlineServices', `@${EXTENSION_SETTING_TAG}`
@@ -112,6 +113,8 @@ export class SettingsEditor2 extends BaseEditor {
112113
private remoteSearchThrottle: ThrottledDelayer<void>;
113114
private searchInProgress: CancellationTokenSource | null = null;
114115

116+
private updatedConfigSchemaDelayer: Delayer<void>;
117+
115118
private settingFastUpdateDelayer: Delayer<void>;
116119
private settingSlowUpdateDelayer: Delayer<void>;
117120
private pendingSettingUpdate: { key: string, value: any } | null = null;
@@ -158,6 +161,8 @@ export class SettingsEditor2 extends BaseEditor {
158161
this.settingFastUpdateDelayer = new Delayer<void>(SettingsEditor2.SETTING_UPDATE_FAST_DEBOUNCE);
159162
this.settingSlowUpdateDelayer = new Delayer<void>(SettingsEditor2.SETTING_UPDATE_SLOW_DEBOUNCE);
160163

164+
this.updatedConfigSchemaDelayer = new Delayer<void>(SettingsEditor2.CONFIG_SCHEMA_UPDATE_DELAYER);
165+
161166
this.inSettingsEditorContextKey = CONTEXT_SETTINGS_EDITOR.bindTo(contextKeyService);
162167
this.searchFocusContextKey = CONTEXT_SETTINGS_SEARCH_FOCUS.bindTo(contextKeyService);
163168
this.tocRowFocused = CONTEXT_TOC_ROW_FOCUS.bindTo(contextKeyService);
@@ -848,7 +853,9 @@ export class SettingsEditor2 extends BaseEditor {
848853
}
849854

850855
this._register(model.onDidChangeGroups(() => {
851-
this.onConfigUpdate(undefined, undefined, true);
856+
this.updatedConfigSchemaDelayer.trigger(() => {
857+
this.onConfigUpdate(undefined, undefined, true);
858+
});
852859
}));
853860
this.defaultSettingsEditorModel = model;
854861
return this.onConfigUpdate(undefined, true);

0 commit comments

Comments
 (0)