提交 1e74972f 编写于 作者: S Sandeep Somavarapu

#28538 Remove existing workspace context service

- Create a simple workspace context service for standalone editor
- Use the test context service for tests
上级 0a203b99
......@@ -17,6 +17,7 @@ import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingReso
import { IKeybindingEvent, KeybindingSource, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding';
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IConfirmation, IMessageService } from 'vs/platform/message/common/message';
import { IWorkspaceContextService, Workspace, IWorkspace } from 'vs/platform/workspace/common/workspace';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser';
import { Selection } from 'vs/editor/common/core/selection';
......@@ -489,3 +490,41 @@ export class StandaloneTelemetryService implements ITelemetryService {
return null;
}
}
export class SimpleWorkspaceContextService implements IWorkspaceContextService {
public _serviceBrand: any;
private readonly _onDidChangeFolders: Emitter<URI[]> = new Emitter<URI[]>();
public readonly onDidChangeFolders: Event<URI[]> = this._onDidChangeFolders.event;
private readonly folders: URI[];
constructor(private workspace?: Workspace) {
this.folders = workspace ? [workspace.resource] : [];
}
public getFolders(): URI[] {
return this.folders;
}
public getWorkspace(): IWorkspace {
return this.workspace;
}
public hasWorkspace(): boolean {
return !!this.workspace;
}
public isInsideWorkspace(resource: URI): boolean {
return this.workspace ? this.workspace.isInsideWorkspace(resource) : false;
}
public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string {
return this.workspace ? this.workspace.toWorkspaceRelativePath(resource, toOSPath) : null;
}
public toResource(workspaceRelativePath: string): URI {
return this.workspace ? this.workspace.toResource(workspaceRelativePath) : null;
}
}
\ No newline at end of file
......@@ -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, 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';
......@@ -34,7 +34,7 @@ import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServ
import {
SimpleConfigurationService, SimpleMenuService, SimpleMessageService,
SimpleProgressService, StandaloneCommandService, StandaloneKeybindingService,
StandaloneTelemetryService
StandaloneTelemetryService, SimpleWorkspaceContextService
} from 'vs/editor/browser/standalone/simpleServices';
import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService';
import { IMenuService } from 'vs/platform/actions/common/actions';
......@@ -118,7 +118,7 @@ export module StaticServices {
const configurationServiceImpl = new SimpleConfigurationService();
export const configurationService = define(IConfigurationService, () => configurationServiceImpl);
export const contextService = define(IWorkspaceContextService, () => new WorkspaceContextService(configurationServiceImpl, new Workspace(
export const contextService = define(IWorkspaceContextService, () => new SimpleWorkspaceContextService(new Workspace(
URI.from({ scheme: 'inmemory', authority: 'model', path: '/' })
)));
......
......@@ -12,17 +12,16 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
import { Emitter } from 'vs/base/common/event';
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
function storageService(instantiationService: TestInstantiationService): IStorageService {
let service = instantiationService.get(IStorageService);
if (!service) {
let workspaceContextService = instantiationService.get(IWorkspaceContextService);
if (!workspaceContextService) {
workspaceContextService = instantiationService.stub(IWorkspaceContextService, WorkspaceContextService);
instantiationService.stub(IWorkspaceContextService, 'getWorkspace', TestWorkspace);
workspaceContextService = instantiationService.stub(IWorkspaceContextService, new TestContextService());
}
service = instantiationService.stub(IStorageService, instantiationService.createInstance(StorageService, new InMemoryLocalStorage(), new InMemoryLocalStorage()));
}
......
......@@ -6,11 +6,11 @@
'use strict';
import * as assert from 'assert';
import { clone } from 'vs/base/common/objects';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { StorageScope } from 'vs/platform/storage/common/storage';
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace';
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
suite('Workbench StorageSevice', () => {
......@@ -19,8 +19,7 @@ suite('Workbench StorageSevice', () => {
setup(() => {
instantiationService = new TestInstantiationService();
contextService = instantiationService.stub(IWorkspaceContextService, WorkspaceContextService);
instantiationService.stub(IWorkspaceContextService, 'getWorkspace', TestWorkspace);
contextService = instantiationService.stub(IWorkspaceContextService, new TestContextService());
});
test('Swap Data with undefined default value', () => {
......@@ -94,10 +93,8 @@ suite('Workbench StorageSevice', () => {
assert.strictEqual(s.get('wkey1', StorageScope.WORKSPACE), 'foo');
assert.strictEqual(s.get('wkey2', StorageScope.WORKSPACE), 'foo2');
let ws: any = clone(TestWorkspace);
ws.uid = new Date().getTime() + 100;
instantiationService.stub(IWorkspaceContextService, 'getWorkspace', ws);
s = new StorageService(storageImpl, null, contextService.getWorkspace());
let ws: any = new Workspace(TestWorkspace.resource, new Date().getTime() + 100, TestWorkspace.name);
s = new StorageService(storageImpl, null, ws);
assert.strictEqual(s.get('key1', StorageScope.GLOBAL), 'foobar');
assert.strictEqual(s.get('key1', StorageScope.WORKSPACE, null), null);
......
......@@ -6,12 +6,11 @@
import * as assert from 'assert';
import { TPromise } from 'vs/base/common/winjs.base';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { resolveWorkbenchCommonProperties } from 'vs/platform/telemetry/node/workbenchCommonProperties';
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
suite('Telemetry - common properties', function () {
const commit = void 0;
......@@ -19,10 +18,7 @@ suite('Telemetry - common properties', function () {
let storageService;
setup(() => {
let instantiationService = new TestInstantiationService();
let contextService = instantiationService.stub(IWorkspaceContextService, WorkspaceContextService);
instantiationService.stub(IWorkspaceContextService, 'getWorkspace', TestWorkspace);
storageService = new StorageService(new InMemoryLocalStorage(), null, contextService.getWorkspace());
storageService = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace);
});
test('default', function () {
......
......@@ -9,11 +9,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
import paths = require('vs/base/common/paths');
import { isEqualOrParent } from 'vs/platform/files/common/files';
import { isLinux } from 'vs/base/common/platform';
import Event, { Emitter } from 'vs/base/common/event';
import { IConfigurationService } from "vs/platform/configuration/common/configuration";
import { IDisposable, dispose } from "vs/base/common/lifecycle";
import { distinct, equals } from "vs/base/common/arrays";
import { Schemas } from "vs/base/common/network";
import Event from 'vs/base/common/event';
export const IWorkspaceContextService = createDecorator<IWorkspaceContextService>('contextService');
......@@ -120,97 +116,4 @@ export class Workspace implements IWorkspace {
public toJSON() {
return { resource: this._resource, uid: this._uid, name: this._name };
}
}
type IWorkspaceConfiguration = { [rootFolder: string]: { folders: string[]; } };
export class WorkspaceContextService implements IWorkspaceContextService {
public _serviceBrand: any;
private readonly _onDidChangeFolders: Emitter<URI[]> = new Emitter<URI[]>();
public readonly onDidChangeFolders: Event<URI[]> = this._onDidChangeFolders.event;
private folders: URI[];
private toDispose: IDisposable[];
constructor(private configurationService: IConfigurationService, private workspace?: Workspace) {
this.toDispose = [];
this.toDispose.push(this._onDidChangeFolders);
this.folders = workspace ? [workspace.resource] : [];
this.resolveAdditionalFolders();
this.registerListeners();
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onDidUpdateConfiguration()));
}
private onDidUpdateConfiguration(): void {
this.resolveAdditionalFolders(true);
}
private resolveAdditionalFolders(notify?: boolean): void {
if (!this.workspace) {
return; // no additional folders for empty workspaces
}
// Resovled configured folders for workspace
let configuredFolders: URI[] = [this.workspace.resource];
const config = this.configurationService.getConfiguration<IWorkspaceConfiguration>('workspace');
if (config) {
const workspaceConfig = config[this.workspace.resource.toString()];
if (workspaceConfig) {
const additionalFolders = workspaceConfig.folders
.map(f => URI.parse(f))
.filter(r => r.scheme === Schemas.file); // only support files for now
configuredFolders.push(...additionalFolders);
}
}
// Remove duplicates
configuredFolders = distinct(configuredFolders, r => r.toString());
// Find changes
const changed = !equals(this.folders, configuredFolders, (r1, r2) => r1.toString() === r2.toString());
this.folders = configuredFolders;
if (notify && changed) {
this._onDidChangeFolders.fire(configuredFolders);
}
}
public getFolders(): URI[] {
return this.folders;
}
public getWorkspace(): IWorkspace {
return this.workspace;
}
public hasWorkspace(): boolean {
return !!this.workspace;
}
public isInsideWorkspace(resource: URI): boolean {
return this.workspace ? this.workspace.isInsideWorkspace(resource) : false;
}
public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string {
return this.workspace ? this.workspace.toWorkspaceRelativePath(resource, toOSPath) : null;
}
public toResource(workspaceRelativePath: string): URI {
return this.workspace ? this.workspace.toResource(workspaceRelativePath) : null;
}
public dispose(): void {
dispose(this.toDispose);
}
}
\ No newline at end of file
......@@ -28,10 +28,9 @@ import { IPager } from 'vs/base/common/paging';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService";
suite('ExtensionsActions Test', () => {
......@@ -53,7 +52,7 @@ suite('ExtensionsActions Test', () => {
instantiationService.stub(IURLService, { onOpenURL: new Emitter().event });
instantiationService.stub(ITelemetryService, NullTelemetryService);
instantiationService.set(IWorkspaceContextService, new WorkspaceContextService(new TestConfigurationService(), TestWorkspace));
instantiationService.stub(IWorkspaceContextService, new TestContextService());
instantiationService.stub(IConfigurationService, { onDidUpdateConfiguration: () => { }, getConfiguration: () => ({}) });
instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService);
......
......@@ -28,11 +28,10 @@ import Event, { Emitter } from 'vs/base/common/event';
import { IPager } from 'vs/base/common/paging';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils';
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { IChoiceService } from 'vs/platform/message/common/message';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService";
suite('ExtensionsWorkbenchService Test', () => {
......@@ -56,7 +55,7 @@ suite('ExtensionsWorkbenchService Test', () => {
instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService);
instantiationService.set(IWorkspaceContextService, new WorkspaceContextService(new TestConfigurationService(), TestWorkspace));
instantiationService.stub(IWorkspaceContextService, new TestContextService());
instantiationService.stub(IConfigurationService, { onDidUpdateConfiguration: () => { }, getConfiguration: () => ({}) });
instantiationService.stub(IExtensionManagementService, ExtensionManagementService);
......
......@@ -8,12 +8,12 @@
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 { Workspace } from 'vs/platform/workspace/common/workspace';
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
import URI from 'vs/base/common/uri';
import * as strings from 'vs/base/common/strings';
import * as path from 'path';
import * as sinon from 'sinon';
import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService";
class TestTerminalLinkHandler extends TerminalLinkHandler {
public get localLinkRegex(): RegExp {
......@@ -176,7 +176,7 @@ suite('Workbench - TerminalLinkHandler', () => {
suite('preprocessPath', () => {
test('Windows', () => {
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, null, null,
new WorkspaceContextService(new TestConfigurationService(), new TestWorkspace('C:\\base')));
new TestContextService(new TestWorkspace('C:\\base')));
let stub = sinon.stub(path, 'join', function (arg1, arg2) {
return arg1 + '\\' + arg2;
......@@ -190,7 +190,7 @@ suite('Workbench - TerminalLinkHandler', () => {
test('Linux', () => {
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null,
new WorkspaceContextService(new TestConfigurationService(), new TestWorkspace('/base')));
new TestContextService(new TestWorkspace('/base')));
let stub = sinon.stub(path, 'join', function (arg1, arg2) {
return arg1 + '/' + arg2;
......@@ -203,7 +203,7 @@ suite('Workbench - TerminalLinkHandler', () => {
});
test('No Workspace', () => {
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, new WorkspaceContextService(new TestConfigurationService()));
const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, new TestContextService(null));
assert.equal(linkHandler.preprocessPath('./src/file1'), null);
assert.equal(linkHandler.preprocessPath('src/file2'), null);
......
......@@ -15,13 +15,13 @@ 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 { 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';
import uuid = require('vs/base/common/uuid');
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService';
import { WorkspaceService } from 'vs/workbench/services/workspace/node/workspace';
import URI from 'vs/base/common/uri';
import { FileService } from 'vs/workbench/services/files/node/fileService';
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService';
......@@ -116,9 +116,9 @@ suite('ConfigurationEditingService', () => {
const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile);
instantiationService.stub(IEnvironmentService, environmentService);
const workspace = noWorkspace ? null : new Workspace(URI.file(workspaceDir));
const configurationService = new WorkspaceConfigurationService(environmentService, workspace);
instantiationService.stub(IWorkspaceContextService, new WorkspaceContextService(configurationService, workspace));
instantiationService.stub(IConfigurationService, configurationService);
const workspaceService = new WorkspaceService(environmentService, workspace);
instantiationService.stub(IWorkspaceContextService, workspaceService);
instantiationService.stub(IConfigurationService, workspaceService);
instantiationService.stub(ILifecycleService, new TestLifecycleService());
instantiationService.stub(IEditorGroupService, new TestEditorGroupService());
instantiationService.stub(ITelemetryService, NullTelemetryService);
......@@ -140,7 +140,7 @@ suite('ConfigurationEditingService', () => {
});
testObject = instantiationService.createInstance(ConfigurationEditingService);
return configurationService.initialize();
return workspaceService.initialize();
}
teardown(() => {
......@@ -150,7 +150,7 @@ suite('ConfigurationEditingService', () => {
function clearServices(): void {
if (instantiationService) {
const configuraitonService = <WorkspaceConfigurationService>instantiationService.get(IConfigurationService);
const configuraitonService = <WorkspaceService>instantiationService.get(IConfigurationService);
if (configuraitonService) {
configuraitonService.dispose();
}
......
......@@ -9,12 +9,10 @@ import * as assert from 'assert';
import { Build, Builder } from 'vs/base/browser/builder';
import { Part } from 'vs/workbench/browser/part';
import * as Types from 'vs/base/common/types';
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
import { TestThemeService } from 'vs/workbench/test/workbenchTestServices';
import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService";
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
class MyPart extends Part {
......@@ -85,15 +83,13 @@ class MyPart3 extends Part {
suite('Workbench Part', () => {
let fixture: HTMLElement;
let fixtureId = 'workbench-part-fixture';
let context: IWorkspaceContextService;
let storage: IStorageService;
setup(() => {
fixture = document.createElement('div');
fixture.id = fixtureId;
document.body.appendChild(fixture);
context = new WorkspaceContextService(new TestConfigurationService(), TestWorkspace);
storage = new StorageService(new InMemoryLocalStorage(), null, context.getWorkspace());
storage = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace);
});
teardown(() => {
......
......@@ -6,20 +6,18 @@
'use strict';
import * as assert from 'assert';
import { WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { StorageScope } from 'vs/platform/storage/common/storage';
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
import { Memento, Scope } from 'vs/workbench/common/memento';
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService";
import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace';
suite('Workbench Memento', () => {
let context;
let storage;
setup(() => {
context = new WorkspaceContextService(new TestConfigurationService(), TestWorkspace);
storage = new StorageService(new InMemoryLocalStorage(), null, context.getWorkspace());
storage = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace);
});
test('Loading and Saving Memento with Scopes', () => {
......
......@@ -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 { 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';
......@@ -21,7 +21,7 @@ import { QuickOpenHandler, IQuickOpenRegistry, Extensions } from 'vs/workbench/b
import { Registry } from 'vs/platform/platform';
import { SearchService } from 'vs/workbench/services/search/node/searchService';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { TestEnvironmentService, TestEditorService, TestEditorGroupService } from 'vs/workbench/test/workbenchTestServices';
import { TestEnvironmentService, TestEditorService, TestEditorGroupService, TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { TPromise } from 'vs/base/common/winjs.base';
import URI from 'vs/base/common/uri';
......@@ -31,7 +31,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import { IModelService } from 'vs/editor/common/services/modelService';
namespace Timer {
export interface ITimerEvent {
id: number;
......@@ -73,7 +72,7 @@ suite('QuickOpen performance (integration)', () => {
[ITelemetryService, telemetryService],
[IConfigurationService, configurationService],
[IModelService, new ModelServiceImpl(null, configurationService)],
[IWorkspaceContextService, new WorkspaceContextService(configurationService, new Workspace(URI.file(testWorkspacePath)))],
[IWorkspaceContextService, new TestContextService(new Workspace(URI.file(testWorkspacePath)))],
[IWorkbenchEditorService, new TestEditorService()],
[IEditorGroupService, new TestEditorGroupService()],
[IEnvironmentService, TestEnvironmentService],
......
......@@ -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 { 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';
......@@ -20,7 +20,7 @@ import * as minimist from 'minimist';
import * as path from 'path';
import { SearchService } from 'vs/workbench/services/search/node/searchService';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { TestEnvironmentService, TestEditorService, TestEditorGroupService } from 'vs/workbench/test/workbenchTestServices';
import { TestEnvironmentService, TestEditorService, TestEditorGroupService, TestContextService } from 'vs/workbench/test/workbenchTestServices';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { TPromise } from 'vs/base/common/winjs.base';
import URI from 'vs/base/common/uri';
......@@ -62,7 +62,7 @@ suite('TextSearch performance (integration)', () => {
[ITelemetryService, telemetryService],
[IConfigurationService, configurationService],
[IModelService, new ModelServiceImpl(null, configurationService)],
[IWorkspaceContextService, new WorkspaceContextService(configurationService, new Workspace(URI.file(testWorkspacePath)))],
[IWorkspaceContextService, new TestContextService(new Workspace(URI.file(testWorkspacePath)))],
[IWorkbenchEditorService, new TestEditorService()],
[IEditorGroupService, new TestEditorGroupService()],
[IEnvironmentService, TestEnvironmentService],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册