mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
#17110 Rename and clean up
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
+1
-1
@@ -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', () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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<void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
get onHide(): Event<void> {
|
||||
return null;
|
||||
}
|
||||
|
||||
public dispose() { }
|
||||
public quickNavigate(): void { }
|
||||
}
|
||||
|
||||
suite('Workbench QuickOpen', () => {
|
||||
|
||||
test('QuickOpen Handler and Registry', () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user