mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 15:24:40 +01:00
Settings editor - avoid repeated extension list refresh (#303957)
settings: move refreshInstalledExtensionsList() outside loop
This commit is contained in:
@@ -1393,7 +1393,10 @@ export class SettingsEditor2 extends EditorPane {
|
||||
const additionalGroups: ISettingsGroup[] = [];
|
||||
let setAdditionalGroups = false;
|
||||
const toggleData = await getExperimentalExtensionToggleData(this.chatEntitlementService, this.extensionGalleryService, this.productService);
|
||||
if (toggleData && groups.filter(g => g.extensionInfo).length) {
|
||||
if (toggleData && groups.filter(g => g.extensionInfo).length && Object.keys(toggleData.settingsEditorRecommendedExtensions).length) {
|
||||
// Refresh installed extensions once per onConfigUpdate invocation for performance,
|
||||
// instead of per extension. The installed list may still change while iterating.
|
||||
await this.refreshInstalledExtensionsList();
|
||||
for (const key in toggleData.settingsEditorRecommendedExtensions) {
|
||||
const extension: IGalleryExtension = toggleData.recommendedExtensionsGalleryInfo[key];
|
||||
if (!extension) {
|
||||
@@ -1401,8 +1404,6 @@ export class SettingsEditor2 extends EditorPane {
|
||||
}
|
||||
|
||||
const extensionId = extension.identifier.id;
|
||||
// prevent race between extension update handler and this (onConfigUpdate) handler
|
||||
await this.refreshInstalledExtensionsList();
|
||||
const extensionInstalled = this.installedExtensionIds.includes(extensionId);
|
||||
|
||||
// Drill down to see whether the group and setting already exist
|
||||
|
||||
Reference in New Issue
Block a user