mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
parent
1b01ed010e
commit
207c1b956e
|
@ -857,9 +857,12 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
// Check for updates
|
||||
this.eventuallyCheckForUpdates(true);
|
||||
|
||||
// Always auto update builtin extensions in web
|
||||
if (isWeb && !this.isAutoUpdateEnabled()) {
|
||||
this.autoUpdateBuiltinExtensions();
|
||||
if (isWeb) {
|
||||
this.syncPinnedBuiltinExtensions();
|
||||
// Always auto update builtin extensions in web
|
||||
if (!this.isAutoUpdateEnabled()) {
|
||||
this.autoUpdateBuiltinExtensions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1333,7 +1336,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
// Skip if check updates only for builtin extensions and current extension is not builtin.
|
||||
continue;
|
||||
}
|
||||
if (installed.isBuiltin && (installed.type === ExtensionType.System || !installed.local?.identifier.uuid)) {
|
||||
if (installed.isBuiltin && !installed.pinned && (installed.type === ExtensionType.System || !installed.local?.identifier.uuid)) {
|
||||
// Skip checking updates for a builtin extension if it is a system extension or if it does not has Marketplace identifier
|
||||
continue;
|
||||
}
|
||||
|
@ -1412,6 +1415,21 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
await Promises.settled(toUpdate.map(e => this.install(e, e.local?.preRelease ? { installPreReleaseVersion: true } : undefined)));
|
||||
}
|
||||
|
||||
private async syncPinnedBuiltinExtensions(): Promise<void> {
|
||||
const infos: IExtensionInfo[] = [];
|
||||
for (const installed of this.local) {
|
||||
if (installed.isBuiltin && installed.pinned && installed.local?.identifier.uuid) {
|
||||
infos.push({ ...installed.identifier, version: installed.version });
|
||||
}
|
||||
}
|
||||
if (infos.length) {
|
||||
const galleryExtensions = await this.galleryService.getExtensions(infos, CancellationToken.None);
|
||||
if (galleryExtensions.length) {
|
||||
await this.syncInstalledExtensionsWithGallery(galleryExtensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private autoUpdateExtensions(): Promise<any> {
|
||||
if (!this.isAutoUpdateEnabled()) {
|
||||
return Promise.resolve();
|
||||
|
|
|
@ -385,9 +385,10 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
|
|||
if (webExtension) {
|
||||
result.set(galleryExtension.identifier.id.toLowerCase(), {
|
||||
...webExtension,
|
||||
identifier: { id: webExtension.identifier.id, uuid: galleryExtension.identifier.uuid },
|
||||
readmeUri: galleryExtension.assets.readme ? URI.parse(galleryExtension.assets.readme.uri) : undefined,
|
||||
changelogUri: galleryExtension.assets.changelog ? URI.parse(galleryExtension.assets.changelog.uri) : undefined,
|
||||
metadata: { isPreReleaseVersion: galleryExtension.properties.isPreReleaseVersion, preRelease: galleryExtension.properties.isPreReleaseVersion, isBuiltin: true }
|
||||
metadata: { isPreReleaseVersion: galleryExtension.properties.isPreReleaseVersion, preRelease: galleryExtension.properties.isPreReleaseVersion, isBuiltin: true, pinned: true }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue