Skip to content

Commit

Permalink
#68410 clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Mar 16, 2022
1 parent 20a6514 commit 64ab9c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/vs/platform/extensionManagement/node/extensionsWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
import { DidUninstallExtensionEvent, IExtensionManagementService, ILocalExtension, InstallExtensionEvent, InstallExtensionResult } from 'vs/platform/extensionManagement/common/extensionManagement';
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { ExtensionType, IExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { IExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { FileChangeType, IFileChange, IFileService } from 'vs/platform/files/common/files';
import { ILogService } from 'vs/platform/log/common/log';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
Expand All @@ -31,7 +31,7 @@ export class ExtensionsWatcher extends Disposable {
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
) {
super();
this.extensionsManagementService.getInstalled(ExtensionType.User).then(extensions => {
this.extensionsManagementService.getInstalled().then(extensions => {
this.installedExtensions = extensions.map(e => e.identifier);
this.startTimestamp = Date.now();
});
Expand Down Expand Up @@ -111,7 +111,7 @@ export class ExtensionsWatcher extends Disposable {

private async onDidChange(): Promise<void> {
if (this.installedExtensions) {
const extensions = await this.extensionsManagementService.getInstalled(ExtensionType.User);
const extensions = await this.extensionsManagementService.getInstalled();
const added = extensions.filter(e => {
if ([...this.installingExtensions, ...this.installedExtensions!].some(identifier => areSameExtensions(identifier, e.identifier))) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri';
import { getGalleryExtensionId, groupByExtension, getExtensionId, ExtensionKey } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { isValidExtensionVersion } from 'vs/platform/extensions/common/extensionValidator';
import { ExtensionIdentifier, IExtensionDescription, IRelaxedExtensionDescription, TargetPlatform, UNDEFINED_PUBLISHER } from 'vs/platform/extensions/common/extensions';
import { Metadata } from 'vs/platform/extensionManagement/common/extensionManagement';

const MANIFEST_FILE = 'package.json';

Expand Down Expand Up @@ -115,12 +116,6 @@ abstract class ExtensionManifestHandler {
}
}

interface ILocalExtensionMetadata {
id?: string;
targetPlatform?: TargetPlatform;
isBuiltin?: boolean;
}

class ExtensionManifestParser extends ExtensionManifestHandler {

private static _fastParseJSON<T>(text: string, errors: json.ParseError[]): T {
Expand All @@ -135,7 +130,7 @@ class ExtensionManifestParser extends ExtensionManifestHandler {
public parse(): Promise<IExtensionDescription | null> {
return this._host.readFile(this._absoluteManifestPath).then((manifestContents) => {
const errors: json.ParseError[] = [];
const manifest = ExtensionManifestParser._fastParseJSON<IRelaxedExtensionDescription & { __metadata?: ILocalExtensionMetadata }>(manifestContents, errors);
const manifest = ExtensionManifestParser._fastParseJSON<IRelaxedExtensionDescription & { __metadata?: Metadata }>(manifestContents, errors);
if (json.getNodeType(manifest) !== 'object') {
this._error(this._absoluteFolderPath, nls.localize('jsonParseInvalidType', "Invalid manifest file {0}: Not an JSON object.", this._absoluteManifestPath));
} else if (errors.length === 0) {
Expand Down

0 comments on commit 64ab9c6

Please sign in to comment.