From d679692e01eee435610bc4ea07421e5e73386ecb Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 13 Dec 2016 18:40:22 +0100 Subject: [PATCH] #17110 Rename and clean up --- .../test/browser/fileEditorInput.test.ts | 2 +- .../test/browser/fileEditorTracker.test.ts | 2 +- .../output/test/outputLinkProvider.test.ts | 2 +- .../electron-browser/terminalInstance.test.ts | 2 +- .../backup/test/backupFileService.test.ts | 2 +- .../node/configurationEditingService.test.ts | 2 +- .../test/node/configurationService.test.ts | 2 +- .../node/configurationResolverService.test.ts | 2 +- .../textfile/test/textFileEditorModel.test.ts | 2 +- .../test/textFileEditorModelManager.test.ts | 2 +- .../textfile/test/textFileService.test.ts | 2 +- .../test/textModelResolverService.test.ts | 2 +- .../test/browser/editorStacksModel.test.ts | 2 +- .../workbench/test/browser/quickopen.test.ts | 50 ++++++++++++++++++- .../workbench/test/browser/services.test.ts | 2 +- .../common/editor/rangeDecorations.test.ts | 2 +- .../common/editor/resourceEditorInput.test.ts | 2 +- .../common/editor/stringEditorInput.test.ts | 2 +- .../test/common/editor/untitledEditor.test.ts | 2 +- .../electron-browser/quickopen.perf.test.ts | 2 +- .../electron-browser/textsearch.perf.test.ts | 2 +- .../api/mainThreadSaveParticipant.test.ts | 2 +- .../workbench/test/workbenchTestServices.ts | 8 ++- 23 files changed, 77 insertions(+), 23 deletions(-) diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts index 1a407b93bea..989a7b27ac0 100644 --- a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts @@ -9,7 +9,7 @@ import URI from 'vs/base/common/uri'; import { join } from 'vs/base/common/paths'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { EncodingMode } from 'vs/workbench/common/editor'; import { IEventService } from 'vs/platform/event/common/event'; diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts b/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts index 78fe0cbf076..98ced7c7ae2 100644 --- a/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts +++ b/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts @@ -11,7 +11,7 @@ import URI from 'vs/base/common/uri'; import { join, basename } from 'vs/base/common/paths'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { EditorStacksModel } from 'vs/workbench/common/editor/editorStacksModel'; diff --git a/src/vs/workbench/parts/output/test/outputLinkProvider.test.ts b/src/vs/workbench/parts/output/test/outputLinkProvider.test.ts index a00918547fa..393a51426f8 100644 --- a/src/vs/workbench/parts/output/test/outputLinkProvider.test.ts +++ b/src/vs/workbench/parts/output/test/outputLinkProvider.test.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; import URI from 'vs/base/common/uri'; import { isMacintosh, isLinux } from 'vs/base/common/platform'; import { OutputLinkComputer } from 'vs/workbench/parts/output/common/outputLinkComputer'; -import { TestContextService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; function toOSPath(p: string): string { if (isMacintosh || isLinux) { diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts index 36bf8882f1c..61b3a2142bf 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts @@ -12,7 +12,7 @@ import { IStringDictionary } from 'vs/base/common/collections'; import { IWorkspace } from 'vs/platform/workspace/common/workspace'; import { TerminalInstance } from 'vs/workbench/parts/terminal/electron-browser/terminalInstance'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { TestMessageService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestMessageService } from 'vs/workbench/test/workbenchTestServices'; suite('Workbench - TerminalInstance', () => { diff --git a/src/vs/workbench/services/backup/test/backupFileService.test.ts b/src/vs/workbench/services/backup/test/backupFileService.test.ts index d415b65f33f..be9b1fc0e6d 100644 --- a/src/vs/workbench/services/backup/test/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/backupFileService.test.ts @@ -22,7 +22,7 @@ import { parseArgs } from 'vs/platform/environment/node/argv'; import { TextModel } from 'vs/editor/common/model/textModel'; import { IRawTextContent } from 'vs/workbench/services/textfile/common/textfiles'; import { TPromise } from 'vs/base/common/winjs.base'; -import { TestWindowService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestWindowService } from 'vs/workbench/test/workbenchTestServices'; class TestEnvironmentService extends EnvironmentService { constructor(private _backupHome: string, private _backupWorkspacesPath: string) { 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 3df5c4d8c4a..09a3c7e31c5 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -17,7 +17,7 @@ import { parseArgs } from 'vs/platform/environment/node/argv'; 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 { TestEventService, workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestEventService, workbenchInstantiationService, TestTextFileService } 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'; 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 95c3a6b079f..a4146771c66 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationService.test.ts @@ -16,7 +16,7 @@ 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'); -import { TestEventService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestEventService } 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'; diff --git a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts index 4626da6689c..b5ae58ec84d 100644 --- a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts @@ -11,7 +11,7 @@ import { IConfigurationService, getConfigurationValue } from 'vs/platform/config import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/node/configurationResolverService'; -import { TestEnvironmentService, TestEditorService, } from 'vs/workbench/test/workbenchTestUtils'; +import { TestEnvironmentService, TestEditorService, } from 'vs/workbench/test/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; suite('Configuration Resolver Service', () => { diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts b/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts index 13b71f6ed35..eb616b9a2f1 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts @@ -12,7 +12,7 @@ import { EncodingMode } from 'vs/workbench/common/editor'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { IEventService } from 'vs/platform/event/common/event'; import { ITextFileService, ModelState, StateChange } from 'vs/workbench/services/textfile/common/textfiles'; -import { workbenchInstantiationService, TestTextFileService, createFileInput } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestTextFileService, createFileInput } from 'vs/workbench/test/workbenchTestServices'; import { onError, toResource } from 'vs/base/test/common/utils'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; import { FileOperationResult, IFileOperationResult } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts b/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts index 9d1a2434f9e..d16d887b677 100644 --- a/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileEditorModelManager.test.ts @@ -11,7 +11,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; import { join, basename } from 'vs/base/common/paths'; -import { workbenchInstantiationService, TestEditorGroupService, createFileInput } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestEditorGroupService, createFileInput } from 'vs/workbench/test/workbenchTestServices'; import { onError } from 'vs/base/test/common/utils'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; diff --git a/src/vs/workbench/services/textfile/test/textFileService.test.ts b/src/vs/workbench/services/textfile/test/textFileService.test.ts index cecc7366c20..b10e5b3ecd1 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.test.ts @@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as assert from 'assert'; import { ILifecycleService, ShutdownEvent, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; -import { workbenchInstantiationService, TestLifecycleService, TestTextFileService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestLifecycleService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { onError, toResource } from 'vs/base/test/common/utils'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; diff --git a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts index b688ffe7082..347ccc2d9e0 100644 --- a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts +++ b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts @@ -12,7 +12,7 @@ import URI from 'vs/base/common/uri'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; import { IModelService } from 'vs/editor/common/services/modelService'; diff --git a/src/vs/workbench/test/browser/editorStacksModel.test.ts b/src/vs/workbench/test/browser/editorStacksModel.test.ts index e29da015cbf..eea5e6d990f 100644 --- a/src/vs/workbench/test/browser/editorStacksModel.test.ts +++ b/src/vs/workbench/test/browser/editorStacksModel.test.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; import { EditorStacksModel, EditorGroup, GroupEvent } from 'vs/workbench/common/editor/editorStacksModel'; import { EditorInput, IFileEditorInput, IEditorIdentifier, IEditorGroup, IStacksModelChangeEvent, IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory } from 'vs/workbench/common/editor'; import URI from 'vs/base/common/uri'; -import { TestStorageService, TestLifecycleService, TestContextService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestStorageService, TestLifecycleService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; diff --git a/src/vs/workbench/test/browser/quickopen.test.ts b/src/vs/workbench/test/browser/quickopen.test.ts index d12587b8315..3a3b0acb619 100644 --- a/src/vs/workbench/test/browser/quickopen.test.ts +++ b/src/vs/workbench/test/browser/quickopen.test.ts @@ -7,10 +7,58 @@ import * as assert from 'assert'; import 'vs/workbench/browser/parts/editor/editor.contribution'; // make sure to load all contributed editor things into tests -import { TestQuickOpenService } from 'vs/workbench/test/workbenchTestUtils'; +import { Promise, TPromise } from 'vs/base/common/winjs.base'; +import Event from 'vs/base/common/event'; +import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { Registry } from 'vs/platform/platform'; import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenAction } from 'vs/workbench/browser/quickopen'; +export class TestQuickOpenService implements IQuickOpenService { + public _serviceBrand: any; + + private callback: (prefix: string) => void; + + constructor(callback?: (prefix: string) => void) { + this.callback = callback; + } + + pick(arg: any, options?: any, token?: any): Promise { + return TPromise.as(null); + } + + input(options?: any, token?: any): Promise { + return TPromise.as(null); + } + + accept(): void { + } + + focus(): void { + } + + close(): void { + } + + show(prefix?: string, options?: any): Promise { + if (this.callback) { + this.callback(prefix); + } + + return TPromise.as(true); + } + + get onShow(): Event { + return null; + } + + get onHide(): Event { + return null; + } + + public dispose() { } + public quickNavigate(): void { } +} + suite('Workbench QuickOpen', () => { test('QuickOpen Handler and Registry', () => { diff --git a/src/vs/workbench/test/browser/services.test.ts b/src/vs/workbench/test/browser/services.test.ts index 38bd0cd1160..8d3032bf5b8 100644 --- a/src/vs/workbench/test/browser/services.test.ts +++ b/src/vs/workbench/test/browser/services.test.ts @@ -16,7 +16,7 @@ import { EditorInput, EditorOptions, TextEditorOptions } from 'vs/workbench/comm import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; import { StringEditorModel } from 'vs/workbench/common/editor/stringEditorModel'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { Viewlet, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; import { IPanel } from 'vs/workbench/common/panel'; import { WorkbenchProgressService, ScopedService } from 'vs/workbench/services/progress/browser/progressService'; diff --git a/src/vs/workbench/test/common/editor/rangeDecorations.test.ts b/src/vs/workbench/test/common/editor/rangeDecorations.test.ts index f0414684cc4..d7c86209e15 100644 --- a/src/vs/workbench/test/common/editor/rangeDecorations.test.ts +++ b/src/vs/workbench/test/common/editor/rangeDecorations.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import URI from 'vs/base/common/uri'; -import { TestEditorService, workbenchInstantiationService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestEditorService, workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; diff --git a/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts b/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts index 0c1fac2f8b5..85c63eb3e1b 100644 --- a/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts +++ b/src/vs/workbench/test/common/editor/resourceEditorInput.test.ts @@ -10,7 +10,7 @@ import URI from 'vs/base/common/uri'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; diff --git a/src/vs/workbench/test/common/editor/stringEditorInput.test.ts b/src/vs/workbench/test/common/editor/stringEditorInput.test.ts index fa96c51805e..b6b2926d710 100644 --- a/src/vs/workbench/test/common/editor/stringEditorInput.test.ts +++ b/src/vs/workbench/test/common/editor/stringEditorInput.test.ts @@ -10,7 +10,7 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import URI from 'vs/base/common/uri'; import { StringEditorInput } from 'vs/workbench/common/editor/stringEditorInput'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; -import { TestEditorService } from 'vs/workbench/test/workbenchTestUtils'; +import { TestEditorService } from 'vs/workbench/test/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; diff --git a/src/vs/workbench/test/common/editor/untitledEditor.test.ts b/src/vs/workbench/test/common/editor/untitledEditor.test.ts index cc3ca50eccb..a4ca3e9ce16 100644 --- a/src/vs/workbench/test/common/editor/untitledEditor.test.ts +++ b/src/vs/workbench/test/common/editor/untitledEditor.test.ts @@ -10,7 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { join } from 'vs/base/common/paths'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; class ServiceAccessor { diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.test.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.test.ts index 3d421c6939e..52845c580bb 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.test.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.test.ts @@ -20,7 +20,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/workbenchTestUtils'; +import { TestEnvironmentService, TestEditorService, TestEditorGroupService } from 'vs/workbench/test/workbenchTestServices'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import * as Timer from 'vs/base/common/timer'; import { TPromise } from 'vs/base/common/winjs.base'; diff --git a/src/vs/workbench/test/electron-browser/textsearch.perf.test.ts b/src/vs/workbench/test/electron-browser/textsearch.perf.test.ts index 7f3fcd8fd98..ef12739a2c9 100644 --- a/src/vs/workbench/test/electron-browser/textsearch.perf.test.ts +++ b/src/vs/workbench/test/electron-browser/textsearch.perf.test.ts @@ -19,7 +19,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/workbenchTestUtils'; +import { TestEnvironmentService, TestEditorService, TestEditorGroupService } 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'; diff --git a/src/vs/workbench/test/node/api/mainThreadSaveParticipant.test.ts b/src/vs/workbench/test/node/api/mainThreadSaveParticipant.test.ts index aa7a698a06b..f688407d8c4 100644 --- a/src/vs/workbench/test/node/api/mainThreadSaveParticipant.test.ts +++ b/src/vs/workbench/test/node/api/mainThreadSaveParticipant.test.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { FinalNewLineParticipant } from 'vs/workbench/api/node/mainThreadSaveParticipant'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestUtils'; +import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; import { IModelService } from 'vs/editor/common/services/modelService'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index d820cb5397d..fbebbf037a3 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -6,6 +6,7 @@ 'use strict'; import 'vs/workbench/parts/files/browser/files.contribution'; // load our contribution into the test +import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { Promise, TPromise } from 'vs/base/common/winjs.base'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { EventEmitter } from 'vs/base/common/eventEmitter'; @@ -34,6 +35,7 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia import { IEditorGroupService, GroupArrangement, GroupOrientation } from 'vs/workbench/services/group/common/groupService'; import { TextFileService } from 'vs/workbench/services/textfile/common/textFileService'; import { IFileService, IResolveContentOptions, IFileOperationResult } from 'vs/platform/files/common/files'; +import { IModelService } from 'vs/editor/common/services/modelService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IRawTextContent, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; @@ -49,6 +51,10 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/ import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; +export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { + return instantiationService.createInstance(FileEditorInput, resource, void 0); +} + export const TestEnvironmentService = new EnvironmentService(parseArgs(process.argv), process.execPath); export class TestContextService implements IWorkspaceContextService { @@ -172,7 +178,7 @@ export function workbenchInstantiationService(): IInstantiationService { instantiationService.stub(IModeService, ModeServiceImpl); instantiationService.stub(IHistoryService, HistoryService); instantiationService.stub(IHistoryService, 'getHistory', []); - instantiationService.createInstance(ModelServiceImpl); + instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl)); instantiationService.stub(IFileService, TestFileService); instantiationService.stub(IBackupFileService, new TestBackupFileService()); instantiationService.stub(ITelemetryService, NullTelemetryService);