Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandeep Somavarapu <sasomava@microsoft.com>2020-05-28 20:43:48 +0300
committerSandeep Somavarapu <sasomava@microsoft.com>2020-05-28 20:43:57 +0300
commit9e439b13d5784538333bee044ca1d1a992bc1c90 (patch)
tree0521ca64e2ffc0e50c88563bb07d1c5b1f712adc
parent37a3496bb050538c67940d9c846334ecba1e032b (diff)
do not set default property
-rw-r--r--src/vs/platform/extensionManagement/common/extensionManagement.ts2
-rw-r--r--src/vs/platform/extensionManagement/node/extensionManagementService.ts8
-rw-r--r--src/vs/platform/extensionManagement/node/extensionsScanner.ts4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts
index b52906d91a7..36735a9b105 100644
--- a/src/vs/platform/extensionManagement/common/extensionManagement.ts
+++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts
@@ -92,7 +92,7 @@ export interface IGalleryMetadata {
export interface ILocalExtension extends IExtension {
readonly manifest: IExtensionManifest;
- isDefault: boolean;
+ isDefault: boolean | undefined;
publisherId: string | null;
publisherDisplayName: string | null;
readmeUrl: URI | null;
diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
index 0b0ea415999..5fffb8f48e5 100644
--- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts
+++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts
@@ -152,7 +152,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
}
- install(vsix: URI, isDefault: boolean = false): Promise<ILocalExtension> {
+ install(vsix: URI, isDefault?: boolean): Promise<ILocalExtension> {
this.logService.trace('ExtensionManagementService#install', vsix.toString());
return createCancelablePromise(token => {
return this.downloadVsix(vsix).then(downloadLocation => {
@@ -195,7 +195,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
return this.getGalleryMetadata(getGalleryExtensionId(manifest.publisher, manifest.name))
.then(
metadata => this.installFromZipPath(identifierWithVersion, zipPath, { ...metadata, isDefault }, operation, token),
- () => this.installFromZipPath(identifierWithVersion, zipPath, { isDefault }, operation, token))
+ () => this.installFromZipPath(identifierWithVersion, zipPath, isDefault ? { isDefault } : undefined, operation, token))
.then(
local => { this.logService.info('Successfully installed the extension:', identifier.id); return local; },
e => {
@@ -219,7 +219,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
return this.downloadService.download(vsix, URI.file(downloadedLocation)).then(() => URI.file(downloadedLocation));
}
- private installFromZipPath(identifierWithVersion: ExtensionIdentifierWithVersion, zipPath: string, metadata: IMetadata, operation: InstallOperation, token: CancellationToken): Promise<ILocalExtension> {
+ private installFromZipPath(identifierWithVersion: ExtensionIdentifierWithVersion, zipPath: string, metadata: IMetadata | undefined, operation: InstallOperation, token: CancellationToken): Promise<ILocalExtension> {
return this.toNonCancellablePromise(this.installExtension({ zipPath, identifierWithVersion, metadata }, token)
.then(local => this.installDependenciesAndPackExtensions(local, undefined)
.then(
@@ -288,7 +288,7 @@ export class ExtensionManagementService extends Disposable implements IExtension
this.downloadInstallableExtension(extension, operation)
.then(installableExtension => {
- installableExtension.metadata.isDefault = isDefault !== undefined ? isDefault : !!existingExtension?.isDefault;
+ installableExtension.metadata.isDefault = isDefault !== undefined ? isDefault : existingExtension?.isDefault;
return this.installExtension(installableExtension, cancellationToken)
.then(local => this.extensionsDownloader.delete(URI.file(installableExtension.zipPath)).finally(() => { }).then(() => local));
})
diff --git a/src/vs/platform/extensionManagement/node/extensionsScanner.ts b/src/vs/platform/extensionManagement/node/extensionsScanner.ts
index 19396b9a19f..63c85181cc1 100644
--- a/src/vs/platform/extensionManagement/node/extensionsScanner.ts
+++ b/src/vs/platform/extensionManagement/node/extensionsScanner.ts
@@ -32,7 +32,7 @@ const INSTALL_ERROR_EXTRACTING = 'extracting';
const INSTALL_ERROR_DELETING = 'deleting';
const INSTALL_ERROR_RENAMING = 'renaming';
-export type IMetadata = Partial<IGalleryMetadata> & { isDefault: boolean; };
+export type IMetadata = Partial<IGalleryMetadata & { isDefault: boolean; }>;
export class ExtensionsScanner extends Disposable {
@@ -229,7 +229,7 @@ export class ExtensionsScanner extends Disposable {
const changelog = children.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0];
const changelogUrl = changelog ? URI.file(path.join(extensionPath, changelog)) : null;
const identifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) };
- const local = <ILocalExtension>{ type, identifier, manifest, location: URI.file(extensionPath), readmeUrl, changelogUrl, publisherDisplayName: null, publisherId: null, isDefault: false };
+ const local = <ILocalExtension>{ type, identifier, manifest, location: URI.file(extensionPath), readmeUrl, changelogUrl, publisherDisplayName: null, publisherId: null, isDefault: undefined };
if (metadata) {
this.setMetadata(local, metadata);
}