From 482dc607abfd00f786e4464e5b86d26059f29122 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 17 Jul 2018 22:52:40 +0200 Subject: [PATCH] Fix tests --- src/vs/workbench/electron-browser/main.ts | 2 +- .../services/configuration/node/configurationService.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index f69b6e15def..e8b8ff1a771 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -116,7 +116,7 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise { } function createAndInitializeWorkspaceService(configuration: IWindowConfiguration, environmentService: EnvironmentService): TPromise { - const folderUri = configuration.folderPath ? uri.file(configuration.folderPath) /* TODO: Change to URI.path parsing once main sends URIs*/ : null; + const folderUri = configuration.folderPath ? uri.file(configuration.folderPath) /* TODO:Sandy Change to URI.parse once main sends URIs*/ : null; return validateFolderUri(folderUri, configuration.verbose).then(validatedFolderUri => { const workspaceService = new WorkspaceService(environmentService); diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index dfb8e25c3b0..e11a86a0d89 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -132,16 +132,16 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat public isCurrentWorkspace(workspaceIdentifier: ISingleFolderWorkspaceIdentifier | IWorkspaceIdentifier): boolean { switch (this.getWorkbenchState()) { case WorkbenchState.FOLDER: - return isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && isEqual(this.workspace.folders[0].uri, this.toSingleFolderWorkspaceIdentifier2(workspaceIdentifier), this.workspace.folders[0].uri.scheme !== Schemas.file || !isLinux); + return isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && isEqual(this.workspace.folders[0].uri, this.toUri(workspaceIdentifier), this.workspace.folders[0].uri.scheme !== Schemas.file || !isLinux); case WorkbenchState.WORKSPACE: return isWorkspaceIdentifier(workspaceIdentifier) && this.workspace.id === workspaceIdentifier.id; } return false; } - private toSingleFolderWorkspaceIdentifier2(folderIdentifier: ISingleFolderWorkspaceIdentifier): URI { - const uri = URI.parse(folderIdentifier); - return uri.scheme ? uri : URI.file(folderIdentifier); + private toUri(folderIdentifier: ISingleFolderWorkspaceIdentifier): URI { + // TODO:Sandy Change to URI.parse parsing once main sends URIs + return URI.file(folderIdentifier); } private doUpdateFolders(foldersToAdd: IWorkspaceFolderCreationData[], foldersToRemove: URI[], index?: number): TPromise { -- GitLab