diff --git a/src/vs/editor/browser/standalone/standaloneServices.ts b/src/vs/editor/browser/standalone/standaloneServices.ts index 550b5294605..68e9623baf1 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 } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, WorkspaceContextService, Workspace } 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({ - resource: URI.from({ scheme: 'inmemory', authority: 'model', path: '/' }) - })); + export const contextService = define(IWorkspaceContextService, () => new WorkspaceContextService(new Workspace( + 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 1218ddd4da8..a1a0480997d 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -65,13 +65,59 @@ 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; + } + + public toJSON() { + return { resource: this._resource, uid: this._uid, name: this._name }; + } +} + export class WorkspaceContextService implements IWorkspaceContextService { public _serviceBrand: any; - private workspace: IWorkspace; + private workspace: Workspace; - constructor(workspace: IWorkspace) { + constructor(workspace?: Workspace) { this.workspace = workspace; } @@ -84,26 +130,14 @@ export class WorkspaceContextService implements IWorkspaceContextService { } public isInsideWorkspace(resource: URI): boolean { - if (resource && this.workspace) { - return isEqualOrParent(resource.fsPath, this.workspace.resource.fsPath, !isLinux /* ignorecase */); - } - - return false; + return this.workspace ? this.workspace.isInsideWorkspace(resource) : false; } public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { - if (this.isInsideWorkspace(resource)) { - return paths.normalize(paths.relative(this.workspace.resource.fsPath, resource.fsPath), toOSPath); - } - - return null; + return this.workspace ? this.workspace.toWorkspaceRelativePath(resource, toOSPath) : null; } public toResource(workspaceRelativePath: string): URI { - if (typeof workspaceRelativePath === 'string' && this.workspace) { - return URI.file(paths.join(this.workspace.resource.fsPath, workspaceRelativePath)); - } - - return null; + return this.workspace ? this.workspace.toResource(workspaceRelativePath) : 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 237d8529523..18926c9330d 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 { IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { Workspace } from 'vs/platform/workspace/common/workspace'; import URI from 'vs/base/common/uri'; -export const TestWorkspace: IWorkspace = { - resource: URI.file('C:\\testWorkspace'), - name: 'Test Workspace', - uid: Date.now() -}; +export const TestWorkspace = new Workspace( + URI.file('C:\\testWorkspace'), + Date.now(), + 'Test Workspace' +); diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index b20a6fd422a..b8bfbe51ce6 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 { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, Workspace } 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 { - '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! - }; + 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! + ); }); - }, (error) => { + }, error => { errors.onUnexpectedError(error); return null; // treat invalid paths as empty workspace }); } -function openWorkbench(environment: IWindowConfiguration, workspace: IWorkspace, options: IOptions): TPromise { +function openWorkbench(environment: IWindowConfiguration, workspace: Workspace, options: IOptions): TPromise { const environmentService = new EnvironmentService(environment, environment.execPath); const contextService = new WorkspaceContextService(workspace); - const configurationService = new WorkspaceConfigurationService(contextService, environmentService); + const configurationService = new WorkspaceConfigurationService(environmentService, workspace); 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 fd41b0c29fe..abb6f76e6c8 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 } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, WorkspaceContextService, Workspace } 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,7 +43,14 @@ export class ExtensionHostMain { constructor(remoteCom: IRemoteCom, initData: IInitData) { // services this._environment = initData.environment; - this._contextService = new WorkspaceContextService(initData.contextService.workspace); + + const workspaceRaw = initData.contextService.workspace; + let workspace: Workspace; + if (workspaceRaw) { + workspace = new Workspace(workspaceRaw.resource, workspaceRaw.uid, workspaceRaw.name); + } + this._contextService = new WorkspaceContextService(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 a491d6153d1..d61de282fd4 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 { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, Workspace } 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,10 +44,9 @@ interface LinkFormatInfo { column?: string; } -class TestWorkspace implements IWorkspace { - resource: URI; - constructor(basePath: string) { - this.resource = new TestURI(basePath); +class TestWorkspace extends Workspace { + constructor(private basePath: string) { + super(new TestURI(basePath)); } } diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index b0537b9a12c..9ea368f587b 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -12,7 +12,6 @@ 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'; @@ -24,7 +23,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; @@ -62,8 +61,8 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp private reloadConfigurationScheduler: RunOnceScheduler; constructor( - @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IEnvironmentService environmentService: IEnvironmentService, + private environmentService: IEnvironmentService, + private workspace?: Workspace, private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME ) { super(); @@ -216,13 +215,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.contextService.hasWorkspace()) { + if (!this.workspace) { 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.contextService.toResource(this.workspaceSettingsRootFolder)).then(stat => { + this.bulkFetchFromWorkspacePromise = resolveStat(this.workspace.toResource(this.workspaceSettingsRootFolder)).then(stat => { if (!stat.isDirectory) { return TPromise.as([]); } @@ -233,11 +232,11 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp return false; // only JSON files } - return this.isWorkspaceConfigurationFile(this.contextService.toWorkspaceRelativePath(stat.resource)); // only workspace config files + return this.isWorkspaceConfigurationFile(this.workspace.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.contextService.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content))); + contents.forEach(content => this.workspaceFilePathToConfiguration[this.workspace.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content))); }, errors.onUnexpectedError); } @@ -259,7 +258,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp continue; // only JSON files or the actual settings folder } - const workspacePath = this.contextService.toWorkspaceRelativePath(resource); + const workspacePath = this.workspace.toWorkspaceRelativePath(resource); if (!workspacePath) { continue; // event is not inside workspace } @@ -295,7 +294,7 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp } private createConfigModel(content: IContent): IConfigModel { - const path = this.contextService.toWorkspaceRelativePath(content.resource); + const path = this.workspace.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 a444ccfb9cf..df423a3c094 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 } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, IWorkspaceContextService, Workspace } 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,9 +113,11 @@ suite('ConfigurationEditingService', () => { clearServices(); instantiationService = new TestInstantiationService(); - 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); + 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(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 3d202425b4a..c61238061d7 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 { WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { Workspace } 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 workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); + const workspace = new Workspace(URI.file(workspaceDir)); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, workspace); return service.initialize().then(() => service); } @@ -204,9 +204,9 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace change triggers event', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); + const workspace = new Workspace(URI.file(workspaceDir)); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, workspace); 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 workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); + const workspace = new Workspace(URI.file(workspaceDir)); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, workspace); 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 workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); + const workspace = new Workspace(URI.file(workspaceDir)); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, workspace); 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 workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); + const workspace = new Workspace(URI.file(workspaceDir)); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, workspace); 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 ad4fdee36f5..dfd2576d1d4 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 } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, IWorkspaceContextService, Workspace } 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({ resource: URI.file(testWorkspacePath) })], + [IWorkspaceContextService, new WorkspaceContextService(new Workspace(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 861ff475677..7d1bb6b1139 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 } from 'vs/platform/workspace/common/workspace'; +import { WorkspaceContextService, IWorkspaceContextService, Workspace } 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({ resource: URI.file(testWorkspacePath) })], + [IWorkspaceContextService, new WorkspaceContextService(new Workspace(URI.file(testWorkspacePath)))], [IWorkbenchEditorService, new TestEditorService()], [IEditorGroupService, new TestEditorGroupService()], [IEnvironmentService, TestEnvironmentService],