diff --git a/src/vs/editor/browser/standalone/standaloneServices.ts b/src/vs/editor/browser/standalone/standaloneServices.ts index 68e9623baf1..550b5294605 100644 --- a/src/vs/editor/browser/standalone/standaloneServices.ts +++ b/src/vs/editor/browser/standalone/standaloneServices.ts @@ -22,7 +22,7 @@ import { IMessageService } from 'vs/platform/message/common/message'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { IStorageService, NullStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkspaceContextService, WorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { EditorWorkerServiceImpl } from 'vs/editor/common/services/editorWorkerServiceImpl'; @@ -115,9 +115,9 @@ export module StaticServices { export const instantiationService = define(IInstantiationService, () => new InstantiationService(_serviceCollection, true)); - export const contextService = define(IWorkspaceContextService, () => new WorkspaceContextService(new Workspace( - URI.from({ scheme: 'inmemory', authority: 'model', path: '/' }) - ))); + export const contextService = define(IWorkspaceContextService, () => new WorkspaceContextService({ + resource: URI.from({ scheme: 'inmemory', authority: 'model', path: '/' }) + })); export const telemetryService = define(ITelemetryService, () => new StandaloneTelemetryService()); diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index eae7c42e20c..1218ddd4da8 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -65,55 +65,13 @@ export interface IWorkspace { name?: string; } -export class Workspace implements IWorkspace { - - constructor(private _resource: URI, private _uid?: number, private _name?: string) { - } - - public get resource(): URI { - return this._resource; - } - - public get uid(): number { - return this._uid; - } - - public get name(): string { - return this._name; - } - - public isInsideWorkspace(resource: URI): boolean { - if (resource) { - return isEqualOrParent(resource.fsPath, this._resource.fsPath, !isLinux /* ignorecase */); - } - - return false; - } - - public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { - if (this.isInsideWorkspace(resource)) { - return paths.normalize(paths.relative(this._resource.fsPath, resource.fsPath), toOSPath); - } - - return null; - } - - public toResource(workspaceRelativePath: string): URI { - if (typeof workspaceRelativePath === 'string') { - return URI.file(paths.join(this._resource.fsPath, workspaceRelativePath)); - } - - return null; - } -} - export class WorkspaceContextService implements IWorkspaceContextService { public _serviceBrand: any; - private workspace: Workspace; + private workspace: IWorkspace; - constructor(workspace?: Workspace) { + constructor(workspace: IWorkspace) { this.workspace = workspace; } @@ -126,14 +84,26 @@ export class WorkspaceContextService implements IWorkspaceContextService { } public isInsideWorkspace(resource: URI): boolean { - return this.workspace ? this.workspace.isInsideWorkspace(resource) : false; + if (resource && this.workspace) { + return isEqualOrParent(resource.fsPath, this.workspace.resource.fsPath, !isLinux /* ignorecase */); + } + + return false; } public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { - return this.workspace ? this.workspace.toWorkspaceRelativePath(resource, toOSPath) : null; + if (this.isInsideWorkspace(resource)) { + return paths.normalize(paths.relative(this.workspace.resource.fsPath, resource.fsPath), toOSPath); + } + + return null; } public toResource(workspaceRelativePath: string): URI { - return this.workspace ? this.workspace.toResource(workspaceRelativePath) : null; + if (typeof workspaceRelativePath === 'string' && this.workspace) { + return URI.file(paths.join(this.workspace.resource.fsPath, workspaceRelativePath)); + } + + return null; } } \ No newline at end of file diff --git a/src/vs/platform/workspace/test/common/testWorkspace.ts b/src/vs/platform/workspace/test/common/testWorkspace.ts index 18926c9330d..237d8529523 100644 --- a/src/vs/platform/workspace/test/common/testWorkspace.ts +++ b/src/vs/platform/workspace/test/common/testWorkspace.ts @@ -3,11 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Workspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspace } from 'vs/platform/workspace/common/workspace'; import URI from 'vs/base/common/uri'; -export const TestWorkspace = new Workspace( - URI.file('C:\\testWorkspace'), - Date.now(), - 'Test Workspace' -); +export const TestWorkspace: IWorkspace = { + resource: URI.file('C:\\testWorkspace'), + name: 'Test Workspace', + uid: Date.now() +}; diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index b8bfbe51ce6..b20a6fd422a 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -18,7 +18,7 @@ import paths = require('vs/base/common/paths'); import uri from 'vs/base/common/uri'; import strings = require('vs/base/common/strings'); import { IResourceInput } from 'vs/platform/editor/common/editor'; -import { WorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; import { realpath, stat } from 'vs/base/node/pfs'; @@ -116,7 +116,7 @@ function toInputs(paths: IPath[], isUntitledFile?: boolean): IResourceInput[] { }); } -function getWorkspace(workspacePath: string): TPromise { +function getWorkspace(workspacePath: string): TPromise { if (!workspacePath) { return TPromise.as(null); } @@ -135,23 +135,23 @@ function getWorkspace(workspacePath: string): TPromise { const folderName = path.basename(realWorkspacePath) || realWorkspacePath; return stat(realWorkspacePath).then(folderStat => { - return new Workspace( - workspaceResource, - platform.isLinux ? folderStat.ino : folderStat.birthtime.getTime(), - folderName // On Linux, birthtime is ctime, so we cannot use it! We use the ino instead! - ); + return { + 'resource': workspaceResource, + 'name': folderName, + 'uid': platform.isLinux ? folderStat.ino : folderStat.birthtime.getTime() // On Linux, birthtime is ctime, so we cannot use it! We use the ino instead! + }; }); - }, error => { + }, (error) => { errors.onUnexpectedError(error); return null; // treat invalid paths as empty workspace }); } -function openWorkbench(environment: IWindowConfiguration, workspace: Workspace, options: IOptions): TPromise { +function openWorkbench(environment: IWindowConfiguration, workspace: IWorkspace, options: IOptions): TPromise { const environmentService = new EnvironmentService(environment, environment.execPath); const contextService = new WorkspaceContextService(workspace); - const configurationService = new WorkspaceConfigurationService(environmentService, workspace); + const configurationService = new WorkspaceConfigurationService(contextService, environmentService); const timerService = new TimerService((window).MonacoEnvironment.timers as IInitData, !contextService.hasWorkspace()); // Since the configuration service is one of the core services that is used in so many places, we initialize it diff --git a/src/vs/workbench/node/extensionHostMain.ts b/src/vs/workbench/node/extensionHostMain.ts index abb6f76e6c8..fd41b0c29fe 100644 --- a/src/vs/workbench/node/extensionHostMain.ts +++ b/src/vs/workbench/node/extensionHostMain.ts @@ -15,7 +15,7 @@ import { ExtHostThreadService } from 'vs/workbench/services/thread/common/extHos import { QueryType, ISearchQuery } from 'vs/platform/search/common/search'; import { DiskSearch } from 'vs/workbench/services/search/node/searchService'; import { RemoteTelemetryService } from 'vs/workbench/api/node/extHostTelemetry'; -import { IWorkspaceContextService, WorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IInitData, IEnvironment, MainContext } from 'vs/workbench/api/node/extHost.protocol'; import * as errors from 'vs/base/common/errors'; @@ -43,14 +43,7 @@ export class ExtensionHostMain { constructor(remoteCom: IRemoteCom, initData: IInitData) { // services this._environment = initData.environment; - - const workspaceRaw = initData.contextService.workspace; - let workspace: Workspace; - if (workspaceRaw) { - workspace = new Workspace(workspaceRaw.resource, workspaceRaw.uid, workspaceRaw.name); - } - this._contextService = new WorkspaceContextService(workspace); - + this._contextService = new WorkspaceContextService(initData.contextService.workspace); const threadService = new ExtHostThreadService(remoteCom); const telemetryService = new RemoteTelemetryService('pluginHostTelemetry', threadService); this._extensionService = new ExtHostExtensionService(initData, threadService, telemetryService, this._contextService); diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts index d61de282fd4..a491d6153d1 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import { Platform } from 'vs/base/common/platform'; import { TerminalLinkHandler, LineColumnInfo } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; -import { WorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import URI from 'vs/base/common/uri'; import * as strings from 'vs/base/common/strings'; import * as path from 'path'; @@ -44,9 +44,10 @@ interface LinkFormatInfo { column?: string; } -class TestWorkspace extends Workspace { - constructor(private basePath: string) { - super(new TestURI(basePath)); +class TestWorkspace implements IWorkspace { + resource: URI; + constructor(basePath: string) { + this.resource = new TestURI(basePath); } } diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index 9ea368f587b..b0537b9a12c 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -12,6 +12,7 @@ import extfs = require('vs/base/node/extfs'); import objects = require('vs/base/common/objects'); import { RunOnceScheduler } from 'vs/base/common/async'; import collections = require('vs/base/common/collections'); +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { readFile } from 'vs/base/node/pfs'; @@ -23,7 +24,7 @@ import { ConfigurationService as BaseConfigurationService } from 'vs/platform/co import { IWorkspaceConfigurationValues, IWorkspaceConfigurationService, IWorkspaceConfigurationValue, WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME, WORKSPACE_STANDALONE_CONFIGURATIONS, WORKSPACE_CONFIG_DEFAULT_PATH } from 'vs/workbench/services/configuration/common/configuration'; import { FileChangeType, FileChangesEvent, isEqual } from 'vs/platform/files/common/files'; import Event, { Emitter } from 'vs/base/common/event'; -import { Workspace } from "vs/platform/workspace/common/workspace"; + interface IStat { resource: uri; @@ -61,8 +62,8 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp private reloadConfigurationScheduler: RunOnceScheduler; constructor( - private environmentService: IEnvironmentService, - private workspace?: Workspace, + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IEnvironmentService environmentService: IEnvironmentService, private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME ) { super(); @@ -215,13 +216,13 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp private loadWorkspaceConfigFiles(): TPromise<{ [relativeWorkspacePath: string]: IConfigModel }> { // Return early if we don't have a workspace - if (!this.workspace) { + if (!this.contextService.hasWorkspace()) { return TPromise.as(Object.create(null)); } // once: when invoked for the first time we fetch json files that contribute settings if (!this.bulkFetchFromWorkspacePromise) { - this.bulkFetchFromWorkspacePromise = resolveStat(this.workspace.toResource(this.workspaceSettingsRootFolder)).then(stat => { + this.bulkFetchFromWorkspacePromise = resolveStat(this.contextService.toResource(this.workspaceSettingsRootFolder)).then(stat => { if (!stat.isDirectory) { return TPromise.as([]); } @@ -232,11 +233,11 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp return false; // only JSON files } - return this.isWorkspaceConfigurationFile(this.workspace.toWorkspaceRelativePath(stat.resource)); // only workspace config files + return this.isWorkspaceConfigurationFile(this.contextService.toWorkspaceRelativePath(stat.resource)); // only workspace config files }).map(stat => stat.resource)); }, err => [] /* never fail this call */) .then((contents: IContent[]) => { - contents.forEach(content => this.workspaceFilePathToConfiguration[this.workspace.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content))); + contents.forEach(content => this.workspaceFilePathToConfiguration[this.contextService.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content))); }, errors.onUnexpectedError); } @@ -258,7 +259,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp continue; // only JSON files or the actual settings folder } - const workspacePath = this.workspace.toWorkspaceRelativePath(resource); + const workspacePath = this.contextService.toWorkspaceRelativePath(resource); if (!workspacePath) { continue; // event is not inside workspace } @@ -294,7 +295,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp } private createConfigModel(content: IContent): IConfigModel { - const path = this.workspace.toWorkspaceRelativePath(content.resource); + const path = this.contextService.toWorkspaceRelativePath(content.resource); if (path === WORKSPACE_CONFIG_DEFAULT_PATH) { return new WorkspaceSettingsConfigModel(content.value, content.resource.toString()); } else { diff --git a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts index df423a3c094..a444ccfb9cf 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -15,7 +15,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Registry } from 'vs/platform/platform'; import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment'; import { parseArgs } from 'vs/platform/environment/node/argv'; -import { WorkspaceContextService, IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; import extfs = require('vs/base/node/extfs'); import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService } from 'vs/workbench/test/workbenchTestServices'; @@ -113,11 +113,9 @@ suite('ConfigurationEditingService', () => { clearServices(); instantiationService = new TestInstantiationService(); - const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - instantiationService.stub(IEnvironmentService, environmentService); - const workspace = noWorkspace ? null : new Workspace(URI.file(workspaceDir)); - instantiationService.stub(IWorkspaceContextService, new WorkspaceContextService(workspace)); - const configurationService = new WorkspaceConfigurationService(environmentService, workspace); + instantiationService.stub(IEnvironmentService, new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile)); + instantiationService.stub(IWorkspaceContextService, new WorkspaceContextService(noWorkspace ? null : { resource: URI.file(workspaceDir) })); + const configurationService = instantiationService.createInstance(WorkspaceConfigurationService); instantiationService.stub(IConfigurationService, configurationService); instantiationService.stub(ILifecycleService, new TestLifecycleService()); instantiationService.stub(IEditorGroupService, new TestEditorGroupService()); diff --git a/src/vs/workbench/services/configuration/test/node/configurationService.test.ts b/src/vs/workbench/services/configuration/test/node/configurationService.test.ts index c61238061d7..3d202425b4a 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationService.test.ts @@ -13,7 +13,7 @@ import * as sinon from 'sinon'; import { TPromise } from 'vs/base/common/winjs.base'; import { Registry } from 'vs/platform/platform'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; -import { Workspace } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; import { parseArgs } from 'vs/platform/environment/node/argv'; import extfs = require('vs/base/node/extfs'); @@ -47,9 +47,9 @@ suite('WorkspaceConfigurationService - Node', () => { } function createService(workspaceDir: string, globalSettingsFile: string): TPromise { - const workspace = new Workspace(URI.file(workspaceDir)); + const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(environmentService, workspace); + const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); return service.initialize().then(() => service); } @@ -204,9 +204,9 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace change triggers event', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspace = new Workspace(URI.file(workspaceDir)); + const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(environmentService, workspace); + const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); return service.initialize().then(() => { service.onDidUpdateConfiguration(event => { @@ -230,9 +230,9 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace reload should triggers event if content changed', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspace = new Workspace(URI.file(workspaceDir)); + const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(environmentService, workspace); + const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); return service.initialize().then(() => { const settingsFile = path.join(workspaceDir, '.vscode', 'settings.json'); @@ -255,9 +255,9 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace reload should not trigger event if nothing changed', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspace = new Workspace(URI.file(workspaceDir)); + const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(environmentService, workspace); + const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); return service.initialize().then(() => { const settingsFile = path.join(workspaceDir, '.vscode', 'settings.json'); @@ -280,9 +280,9 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace reload should not trigger event if there is no model', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspace = new Workspace(URI.file(workspaceDir)); + const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(environmentService, workspace); + const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); return service.initialize().then(() => { const target = sinon.stub(); diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts index dfd2576d1d4..ad4fdee36f5 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts @@ -7,7 +7,7 @@ import 'vs/workbench/parts/search/browser/search.contribution'; // load contributions import * as assert from 'assert'; -import { WorkspaceContextService, IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ISearchService } from 'vs/platform/search/common/search'; @@ -73,7 +73,7 @@ suite('QuickOpen performance (integration)', () => { [ITelemetryService, telemetryService], [IConfigurationService, new SimpleConfigurationService()], [IModelService, new ModelServiceImpl(null, configurationService)], - [IWorkspaceContextService, new WorkspaceContextService(new Workspace(URI.file(testWorkspacePath)))], + [IWorkspaceContextService, new WorkspaceContextService({ resource: URI.file(testWorkspacePath) })], [IWorkbenchEditorService, new TestEditorService()], [IEditorGroupService, new TestEditorGroupService()], [IEnvironmentService, TestEnvironmentService], diff --git a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts index 7d1bb6b1139..861ff475677 100644 --- a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts @@ -8,7 +8,7 @@ import 'vs/workbench/parts/search/browser/search.contribution'; // load contributions import * as assert from 'assert'; import * as fs from 'fs'; -import { WorkspaceContextService, IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ISearchService, IQueryOptions } from 'vs/platform/search/common/search'; @@ -62,7 +62,7 @@ suite('TextSearch performance (integration)', () => { [ITelemetryService, telemetryService], [IConfigurationService, new SimpleConfigurationService()], [IModelService, new ModelServiceImpl(null, configurationService)], - [IWorkspaceContextService, new WorkspaceContextService(new Workspace(URI.file(testWorkspacePath)))], + [IWorkspaceContextService, new WorkspaceContextService({ resource: URI.file(testWorkspacePath) })], [IWorkbenchEditorService, new TestEditorService()], [IEditorGroupService, new TestEditorGroupService()], [IEnvironmentService, TestEnvironmentService],