Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 authored Feb 17, 2023
1 parent 550fdeb commit 0b89e36
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import { areSameExtensions } from 'vs/platform/extensionManagement/common/extens
import { IExtension, IExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { FileOperationResult, IFileService, toFileOperationResult } from 'vs/platform/files/common/files';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
import { ILogService } from 'vs/platform/log/common/log';
import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile';
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
import { Mutable, isObject, isString, isUndefined } from 'vs/base/common/types';
import { getErrorMessage } from 'vs/base/common/errors';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Schemas } from 'vs/base/common/network';

interface IStoredProfileExtension {
identifier: IExtensionIdentifier;
Expand Down Expand Up @@ -310,14 +309,9 @@ export abstract class AbstractExtensionsProfileScannerService extends Disposable
}

private toRelativePath(extensionLocation: URI): string | undefined {
if (this.uriIdentityService.extUri.isEqualOrParent(extensionLocation, this.extensionsLocation)) {
const relativePath = this.uriIdentityService.extUri.relativePath(this.extensionsLocation, extensionLocation);
if (this.extensionsLocation.scheme === Schemas.file && this.logService.getLevel() === LogLevel.Trace) {
this.logService.trace('Relative path', extensionLocation.fsPath, this.extensionsLocation.fsPath, relativePath);
}
return relativePath;
}
return undefined;
return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(extensionLocation), this.extensionsLocation)
? this.uriIdentityService.extUri.basename(extensionLocation)
: undefined;
}

private resolveExtensionLocation(path: string): URI {
Expand Down

0 comments on commit 0b89e36

Please sign in to comment.