mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
Fix #142831
This commit is contained in:
parent
7ea160a069
commit
c1ae22ad56
|
@ -695,6 +695,10 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
this.queryLocal().then(() => {
|
||||
this.resetIgnoreAutoUpdateExtensions();
|
||||
this.eventuallyCheckForUpdates(true);
|
||||
// Always auto update builtin extensions
|
||||
if (!this.isAutoUpdateEnabled()) {
|
||||
this.autoUpdateBuiltinExtensions();
|
||||
}
|
||||
});
|
||||
|
||||
this._register(this.onChange(() => {
|
||||
|
@ -994,7 +998,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
return ExtensionState.Uninstalled;
|
||||
}
|
||||
|
||||
async checkForUpdates(): Promise<void> {
|
||||
async checkForUpdates(onlyBuiltin?: boolean): Promise<void> {
|
||||
const extensions: Extensions[] = [];
|
||||
if (this.localExtensions) {
|
||||
extensions.push(this.localExtensions);
|
||||
|
@ -1010,7 +1014,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
}
|
||||
const infos: IExtensionInfo[] = [];
|
||||
for (const installed of this.local) {
|
||||
if (installed.type === ExtensionType.User) {
|
||||
if (installed.type === ExtensionType.User && (!onlyBuiltin || installed.isBuiltin)) {
|
||||
infos.push({ ...installed.identifier, preRelease: !!installed.local?.preRelease });
|
||||
}
|
||||
}
|
||||
|
@ -1070,6 +1074,12 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
|||
.then(undefined, err => null);
|
||||
}
|
||||
|
||||
private async autoUpdateBuiltinExtensions(): Promise<void> {
|
||||
await this.checkForUpdates(true);
|
||||
const toUpdate = this.outdated.filter(e => e.isBuiltin);
|
||||
await Promises.settled(toUpdate.map(e => this.install(e, e.local?.preRelease ? { installPreReleaseVersion: true } : undefined)));
|
||||
}
|
||||
|
||||
private autoUpdateExtensions(): Promise<any> {
|
||||
if (!this.isAutoUpdateEnabled()) {
|
||||
return Promise.resolve();
|
||||
|
|
|
@ -207,6 +207,10 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
|
|||
const index = extensions.findIndex(e => e.id === webExtension.identifier.id.toLowerCase() && e.preRelease === webExtension.metadata?.isPreReleaseVersion);
|
||||
if (index !== -1) {
|
||||
webExtensions.push(webExtension);
|
||||
/* Update preRelease flag in the cache - https://github.com/microsoft/vscode/issues/142831 */
|
||||
if (webExtension.metadata?.isPreReleaseVersion && !webExtension.metadata?.preRelease) {
|
||||
webExtension.metadata.preRelease = true;
|
||||
}
|
||||
extensions.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
@ -221,7 +225,7 @@ export class WebExtensionsScannerService extends Disposable implements IWebExten
|
|||
|
||||
await Promise.all(galleryExtensions.map(async gallery => {
|
||||
try {
|
||||
webExtensions.push(await this.toWebExtensionFromGallery(gallery, { isPreReleaseVersion: gallery.properties.isPreReleaseVersion, isBuiltin: true }));
|
||||
webExtensions.push(await this.toWebExtensionFromGallery(gallery, { isPreReleaseVersion: gallery.properties.isPreReleaseVersion, preRelease: gallery.properties.isPreReleaseVersion, isBuiltin: true }));
|
||||
} catch (error) {
|
||||
this.logService.info(`Ignoring additional builtin extension ${gallery.identifier.id} because there is an error while converting it into web extension`, getErrorMessage(error));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue