From 8907b120c1cd4bc80181bc3a263020aeae95f424 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 6 Jul 2016 15:23:03 +0200 Subject: [PATCH] fix a bit of #8578 --- .../browser/parts/editor/baseEditor.ts | 87 +---------------- .../parts/editor/editor.contribution.ts | 3 +- .../browser/parts/editor/editorPart.ts | 14 +-- src/vs/workbench/browser/workbench.ts | 4 +- src/vs/workbench/common/editor.ts | 94 +++++++++++++++++++ .../common/editor/editorStacksModel.ts | 3 +- .../extensions.contribution.ts | 3 +- .../files/browser/editors/fileEditorInput.ts | 5 +- .../parts/files/browser/files.contribution.ts | 3 +- .../files/test/browser/textFileEditor.test.ts | 2 +- .../parts/html/browser/html.contribution.ts | 3 +- .../services/editor/browser/editorService.ts | 4 +- .../services/history/browser/history.ts | 3 +- .../browser/parts/editor/baseEditor.test.ts | 4 +- .../browser/parts/quickOpen/quickopen.test.ts | 2 +- .../common/editor/editorStacksModel.test.ts | 3 +- 16 files changed, 123 insertions(+), 114 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/baseEditor.ts b/src/vs/workbench/browser/parts/editor/baseEditor.ts index eb288e1763a..4dbbf9578dc 100644 --- a/src/vs/workbench/browser/parts/editor/baseEditor.ts +++ b/src/vs/workbench/browser/parts/editor/baseEditor.ts @@ -11,7 +11,7 @@ import types = require('vs/base/common/types'); import {Builder} from 'vs/base/browser/builder'; import {Registry} from 'vs/platform/platform'; import {Panel} from 'vs/workbench/browser/panel'; -import {EditorInput, IFileEditorInput, EditorOptions} from 'vs/workbench/common/editor'; +import {EditorInput, IFileEditorInput, EditorOptions, IEditorDescriptor, IEditorInputFactory, IEditorRegistry, Extensions} from 'vs/workbench/common/editor'; import {IEditor, Position, POSITIONS} from 'vs/platform/editor/common/editor'; import {IInstantiationService, IConstructorSignature0} from 'vs/platform/instantiation/common/instantiation'; import {SyncDescriptor, AsyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; @@ -144,7 +144,7 @@ export abstract class BaseEditor extends Panel implements IEditor { * A lightweight descriptor of an editor. The descriptor is deferred so that heavy editors * can load lazily in the workbench. */ -export class EditorDescriptor extends AsyncDescriptor { +export class EditorDescriptor extends AsyncDescriptor implements IEditorDescriptor { private id: string; private name: string; @@ -168,89 +168,6 @@ export class EditorDescriptor extends AsyncDescriptor { } } -export const Extensions = { - Editors: 'workbench.contributions.editors' -}; - -export interface IEditorRegistry { - - /** - * Registers an editor to the platform for the given input type. The second parameter also supports an - * array of input classes to be passed in. If the more than one editor is registered for the same editor - * input, the input itself will be asked which editor it prefers if this method is provided. Otherwise - * the first editor in the list will be returned. - * - * @param editorInputDescriptor a constructor function that returns an instance of EditorInput for which the - * registered editor should be used for. - */ - registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor): void; - registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; - - /** - * Returns the editor descriptor for the given input or null if none. - */ - getEditor(input: EditorInput): EditorDescriptor; - - /** - * Returns the editor descriptor for the given identifier or null if none. - */ - getEditorById(editorId: string): EditorDescriptor; - - /** - * Returns an array of registered editors known to the platform. - */ - getEditors(): EditorDescriptor[]; - - /** - * Registers the default input to be used for files in the workbench. - * - * @param editorInputDescriptor a descriptor that resolves to an instance of EditorInput that - * should be used to handle file inputs. - */ - registerDefaultFileInput(editorInputDescriptor: AsyncDescriptor): void; - - /** - * Returns a descriptor of the default input to be used for files in the workbench. - * - * @return a descriptor that resolves to an instance of EditorInput that should be used to handle - * file inputs. - */ - getDefaultFileInput(): AsyncDescriptor; - - /** - * Registers a editor input factory for the given editor input to the registry. An editor input factory - * is capable of serializing and deserializing editor inputs from string data. - * - * @param editorInputId the identifier of the editor input - * @param factory the editor input factory for serialization/deserialization - */ - registerEditorInputFactory(editorInputId: string, ctor: IConstructorSignature0): void; - - /** - * Returns the editor input factory for the given editor input. - * - * @param editorInputId the identifier of the editor input - */ - getEditorInputFactory(editorInputId: string): IEditorInputFactory; - - setInstantiationService(service: IInstantiationService): void; -} - -export interface IEditorInputFactory { - - /** - * Returns a string representation of the provided editor input that contains enough information - * to deserialize back to the original editor input from the deserialize() method. - */ - serialize(editorInput: EditorInput): string; - - /** - * Returns an editor input from the provided serialized form of the editor input. This form matches - * the value returned from the serialize() method. - */ - deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): EditorInput; -} - const INPUT_DESCRIPTORS_PROPERTY = '__$inputDescriptors'; class EditorRegistry implements IEditorRegistry { diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 12a73a2e715..10c6c06ee1c 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -9,7 +9,8 @@ import nls = require('vs/nls'); import {Action, IAction} from 'vs/base/common/actions'; import {IEditorQuickOpenEntry, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor} from 'vs/workbench/browser/quickopen'; import {StatusbarItemDescriptor, StatusbarAlignment, IStatusbarRegistry, Extensions as StatusExtensions} from 'vs/workbench/browser/parts/statusbar/statusbar'; -import {EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {EditorDescriptor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {IEditorRegistry, Extensions as EditorExtensions} from 'vs/workbench/common/editor'; import {StringEditorInput} from 'vs/workbench/common/editor/stringEditorInput'; import {StringEditor} from 'vs/workbench/browser/parts/editor/stringEditor'; import {DiffEditorInput} from 'vs/workbench/common/editor/diffEditorInput'; diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 8df606bc0a9..828e8bed984 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -19,8 +19,8 @@ import errors = require('vs/base/common/errors'); import {Scope as MementoScope} from 'vs/workbench/common/memento'; import {Scope} from 'vs/workbench/browser/actionBarRegistry'; import {Part} from 'vs/workbench/browser/part'; -import {IEditorRegistry, Extensions as EditorExtensions, BaseEditor, EditorDescriptor} from 'vs/workbench/browser/parts/editor/baseEditor'; -import {EditorInput, EditorOptions, ConfirmResult, EditorInputEvent, IWorkbenchEditorConfiguration} from 'vs/workbench/common/editor'; +import {BaseEditor, EditorDescriptor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {IEditorRegistry, Extensions as EditorExtensions, EditorInput, EditorOptions, ConfirmResult, EditorInputEvent, IWorkbenchEditorConfiguration, IEditorDescriptor} from 'vs/workbench/common/editor'; import {SideBySideEditorControl, Rochade, ISideBySideEditorControl, ProgressState} from 'vs/workbench/browser/parts/editor/sideBySideEditorControl'; import {WorkbenchProgressService} from 'vs/workbench/services/progress/browser/progressService'; import {GroupArrangement} from 'vs/workbench/services/editor/common/editorService'; @@ -226,7 +226,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return this.doOpenEditor(position, descriptor, input, options, widthRatios); } - private doOpenEditor(position: Position, descriptor: EditorDescriptor, input: EditorInput, options: EditorOptions, widthRatios: number[]): TPromise { + private doOpenEditor(position: Position, descriptor: IEditorDescriptor, input: EditorInput, options: EditorOptions, widthRatios: number[]): TPromise { // Update stacks: We do this early on before the UI is there because we want our stacks model to have // a consistent view of the editor world and updating it later async after the UI is there will cause @@ -267,7 +267,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService }); } - private doShowEditor(group: EditorGroup, descriptor: EditorDescriptor, input: EditorInput, options: EditorOptions, widthRatios: number[], monitor: ProgressMonitor): TPromise { + private doShowEditor(group: EditorGroup, descriptor: IEditorDescriptor, input: EditorInput, options: EditorOptions, widthRatios: number[], monitor: ProgressMonitor): TPromise { let position = this.stacks.positionOfGroup(group); const editorAtPosition = this.visibleEditors[position]; @@ -310,7 +310,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService }, (e: any) => this.messageService.show(Severity.Error, types.isString(e) ? new Error(e) : e)); } - private doCreateEditor(group: EditorGroup, descriptor: EditorDescriptor, monitor: ProgressMonitor): TPromise { + private doCreateEditor(group: EditorGroup, descriptor: IEditorDescriptor, monitor: ProgressMonitor): TPromise { let position = this.stacks.positionOfGroup(group); // We need the container for this editor now @@ -354,7 +354,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService }); } - private doInstantiateEditor(group: EditorGroup, descriptor: EditorDescriptor): TPromise { + private doInstantiateEditor(group: EditorGroup, descriptor: IEditorDescriptor): TPromise { let position = this.stacks.positionOfGroup(group); // Return early if already instantiated @@ -389,7 +389,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return TPromise.wrapError(arg); }; - let instantiateEditorPromise = editorInstantiationService.createInstance(descriptor).then(onInstantiate, onInstantiate); + let instantiateEditorPromise = editorInstantiationService.createInstance(descriptor).then(onInstantiate, onInstantiate); if (!loaded) { this.mapEditorInstantiationPromiseToEditor[position][descriptor.getId()] = instantiateEditorPromise; diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts index 90db1a88951..a3065581c77 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -22,8 +22,8 @@ import {Identifiers} from 'vs/workbench/common/constants'; import {isWindows, isLinux} from 'vs/base/common/platform'; import {IOptions} from 'vs/workbench/common/options'; import {IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions} from 'vs/workbench/common/contributions'; -import {IEditorRegistry, Extensions as EditorExtensions, BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor'; -import {TextEditorOptions, EditorInput, EditorOptions} from 'vs/workbench/common/editor'; +import {BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {IEditorRegistry, Extensions as EditorExtensions, TextEditorOptions, EditorInput, EditorOptions} from 'vs/workbench/common/editor'; import {Part} from 'vs/workbench/browser/part'; import {HistoryService} from 'vs/workbench/services/history/browser/history'; import {ActivitybarPart} from 'vs/workbench/browser/parts/activitybar/activitybarPart'; diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index f3b73db2596..e784eeebf77 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -14,6 +14,8 @@ import {IEditorInput, IEditorModel, IEditorOptions, IEditorOptionsBag, ITextEdit import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {Event as BaseEvent} from 'vs/base/common/events'; import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; +import {SyncDescriptor, AsyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; +import {IInstantiationService, IConstructorSignature0} from 'vs/platform/instantiation/common/instantiation'; export enum ConfirmResult { SAVE, @@ -21,6 +23,98 @@ export enum ConfirmResult { CANCEL } +export interface IEditorDescriptor { + + getId(): string; + + getName(): string; + + describes(obj: any): boolean; +} + +export const Extensions = { + Editors: 'workbench.contributions.editors' +}; + +export interface IEditorRegistry { + + /** + * Registers an editor to the platform for the given input type. The second parameter also supports an + * array of input classes to be passed in. If the more than one editor is registered for the same editor + * input, the input itself will be asked which editor it prefers if this method is provided. Otherwise + * the first editor in the list will be returned. + * + * @param editorInputDescriptor a constructor function that returns an instance of EditorInput for which the + * registered editor should be used for. + */ + registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor): void; + registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor[]): void; + + /** + * Returns the editor descriptor for the given input or null if none. + */ + getEditor(input: EditorInput): IEditorDescriptor; + + /** + * Returns the editor descriptor for the given identifier or null if none. + */ + getEditorById(editorId: string): IEditorDescriptor; + + /** + * Returns an array of registered editors known to the platform. + */ + getEditors(): IEditorDescriptor[]; + + /** + * Registers the default input to be used for files in the workbench. + * + * @param editorInputDescriptor a descriptor that resolves to an instance of EditorInput that + * should be used to handle file inputs. + */ + registerDefaultFileInput(editorInputDescriptor: AsyncDescriptor): void; + + /** + * Returns a descriptor of the default input to be used for files in the workbench. + * + * @return a descriptor that resolves to an instance of EditorInput that should be used to handle + * file inputs. + */ + getDefaultFileInput(): AsyncDescriptor; + + /** + * Registers a editor input factory for the given editor input to the registry. An editor input factory + * is capable of serializing and deserializing editor inputs from string data. + * + * @param editorInputId the identifier of the editor input + * @param factory the editor input factory for serialization/deserialization + */ + registerEditorInputFactory(editorInputId: string, ctor: IConstructorSignature0): void; + + /** + * Returns the editor input factory for the given editor input. + * + * @param editorInputId the identifier of the editor input + */ + getEditorInputFactory(editorInputId: string): IEditorInputFactory; + + setInstantiationService(service: IInstantiationService): void; +} + +export interface IEditorInputFactory { + + /** + * Returns a string representation of the provided editor input that contains enough information + * to deserialize back to the original editor input from the deserialize() method. + */ + serialize(editorInput: EditorInput): string; + + /** + * Returns an editor input from the provided serialized form of the editor input. This form matches + * the value returned from the serialize() method. + */ + deserialize(instantiationService: IInstantiationService, serializedEditorInput: string): EditorInput; +} + /** * Editor inputs are lightweight objects that can be passed to the workbench API to open inside the editor part. * Each editor input is mapped to an editor that is capable of opening it through the Platform facade. diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index d0271149301..9bde9eee0a8 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -6,7 +6,7 @@ 'use strict'; import Event, {Emitter} from 'vs/base/common/event'; -import {EditorInput, getUntitledOrFileResource, IEditorStacksModel, IEditorGroup, IEditorIdentifier, IGroupEvent, GroupIdentifier, IStacksModelChangeEvent, IWorkbenchEditorConfiguration, EditorOpenPositioning} from 'vs/workbench/common/editor'; +import {IEditorRegistry, Extensions, EditorInput, getUntitledOrFileResource, IEditorStacksModel, IEditorGroup, IEditorIdentifier, IGroupEvent, GroupIdentifier, IStacksModelChangeEvent, IWorkbenchEditorConfiguration, EditorOpenPositioning} from 'vs/workbench/common/editor'; import URI from 'vs/base/common/uri'; import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; @@ -14,7 +14,6 @@ import {IConfigurationService} from 'vs/platform/configuration/common/configurat import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle'; import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; import {dispose, IDisposable} from 'vs/base/common/lifecycle'; -import {IEditorRegistry, Extensions} from 'vs/workbench/browser/parts/editor/baseEditor'; import {Registry} from 'vs/platform/platform'; import {Position, Direction} from 'vs/platform/editor/common/editor'; import {DiffEditorInput} from 'vs/workbench/common/editor/diffEditorInput'; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts index cf7970d2ac0..9748988854e 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts @@ -16,7 +16,8 @@ import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-bro import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { ExtensionsWorkbenchExtension, StatusUpdater } from 'vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension'; import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/parts/output/common/output'; -import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/parts/editor/baseEditor'; +import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; +import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { VIEWLET_ID, IExtensionsWorkbenchService } from './extensions'; import { ExtensionsWorkbenchService } from './extensionsWorkbenchService'; diff --git a/src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts b/src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts index bb3fec822ce..24577d7ea41 100644 --- a/src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts +++ b/src/vs/workbench/parts/files/browser/editors/fileEditorInput.ts @@ -13,8 +13,7 @@ import labels = require('vs/base/common/labels'); import URI from 'vs/base/common/uri'; import strings = require('vs/base/common/strings'); import assert = require('vs/base/common/assert'); -import {EditorModel, EncodingMode, ConfirmResult} from 'vs/workbench/common/editor'; -import {IEditorRegistry, Extensions, EditorDescriptor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {IEditorRegistry, Extensions, EditorModel, EncodingMode, ConfirmResult, IEditorDescriptor} from 'vs/workbench/common/editor'; import {BinaryEditorModel} from 'vs/workbench/common/editor/binaryEditorModel'; import {IFileOperationResult, FileOperationResult} from 'vs/platform/files/common/files'; import {FileEditorDescriptor} from 'vs/workbench/parts/files/browser/files'; @@ -195,7 +194,7 @@ export class FileEditorInput extends CommonFileEditorInput { let editorRegistry = (Registry.as(Extensions.Editors)); // Lookup Editor by Mime - let descriptor: EditorDescriptor; + let descriptor: IEditorDescriptor; let mimes = this.mime.split(','); for (let m = 0; m < mimes.length; m++) { let mime = strings.trim(mimes[m]); diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index bb3b62b5bda..da6aa382069 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -15,8 +15,7 @@ import {Registry} from 'vs/platform/platform'; import {IConfigurationRegistry, Extensions as ConfigurationExtensions} from 'vs/platform/configuration/common/configurationRegistry'; import {IWorkbenchActionRegistry, Extensions as ActionExtensions} from 'vs/workbench/common/actionRegistry'; import {IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions} from 'vs/workbench/common/contributions'; -import {IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory} from 'vs/workbench/browser/parts/editor/baseEditor'; -import {EditorInput, IFileEditorInput} from 'vs/workbench/common/editor'; +import {IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory, EditorInput, IFileEditorInput} from 'vs/workbench/common/editor'; import {FileEditorDescriptor} from 'vs/workbench/parts/files/browser/files'; import {AutoSaveConfiguration, SUPPORTED_ENCODINGS} from 'vs/platform/files/common/files'; import {FILE_EDITOR_INPUT_ID, VIEWLET_ID} from 'vs/workbench/parts/files/common/files'; diff --git a/src/vs/workbench/parts/files/test/browser/textFileEditor.test.ts b/src/vs/workbench/parts/files/test/browser/textFileEditor.test.ts index 1fe2869bc88..47407880d9e 100644 --- a/src/vs/workbench/parts/files/test/browser/textFileEditor.test.ts +++ b/src/vs/workbench/parts/files/test/browser/textFileEditor.test.ts @@ -12,7 +12,7 @@ import {FileEditorDescriptor} from 'vs/workbench/parts/files/browser/files'; import {Registry} from 'vs/platform/platform'; import {SyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; import {FileEditorInput} from 'vs/workbench/parts/files/browser/editors/fileEditorInput'; -import {Extensions} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {Extensions} from 'vs/workbench/common/editor'; import {TestTextFileService, TestEventService, TestContextService} from 'vs/workbench/test/common/servicesTestUtils'; import {IEventService} from 'vs/platform/event/common/event'; import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; diff --git a/src/vs/workbench/parts/html/browser/html.contribution.ts b/src/vs/workbench/parts/html/browser/html.contribution.ts index 435aebf7e4a..27823655306 100644 --- a/src/vs/workbench/parts/html/browser/html.contribution.ts +++ b/src/vs/workbench/parts/html/browser/html.contribution.ts @@ -13,7 +13,8 @@ import {Position as EditorPosition} from 'vs/platform/editor/common/editor'; import {HtmlInput} from '../common/htmlInput'; import {HtmlPreviewPart} from 'vs/workbench/parts/html/browser/htmlPreviewPart'; import {Registry} from 'vs/platform/platform'; -import {EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {EditorDescriptor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {IEditorRegistry, Extensions as EditorExtensions} from 'vs/workbench/common/editor'; import {SyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; // --- Register Editor diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 7bf4c20dbbc..c12e22efb72 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -13,8 +13,8 @@ import {basename, dirname} from 'vs/base/common/paths'; import types = require('vs/base/common/types'); import {IDiffEditor, ICodeEditor} from 'vs/editor/browser/editorBrowser'; import {ICommonCodeEditor, IModel, EditorType, IEditor as ICommonEditor} from 'vs/editor/common/editorCommon'; -import {BaseEditor, IEditorRegistry, Extensions} from 'vs/workbench/browser/parts/editor/baseEditor'; -import {EditorInput, EditorOptions, IFileEditorInput, TextEditorOptions} from 'vs/workbench/common/editor'; +import {BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {EditorInput, EditorOptions, IFileEditorInput, TextEditorOptions, IEditorRegistry, Extensions} from 'vs/workbench/common/editor'; import {ResourceEditorInput} from 'vs/workbench/common/editor/resourceEditorInput'; import {UntitledEditorInput} from 'vs/workbench/common/editor/untitledEditorInput'; import {DiffEditorInput} from 'vs/workbench/common/editor/diffEditorInput'; diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index 836c71cd1ee..d89e53165ff 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -10,7 +10,7 @@ import platform = require('vs/base/common/platform'); import nls = require('vs/nls'); import {EventType} from 'vs/base/common/events'; import {IEditor as IBaseEditor} from 'vs/platform/editor/common/editor'; -import {TextEditorOptions, EditorInput, IGroupEvent} from 'vs/workbench/common/editor'; +import {TextEditorOptions, EditorInput, IGroupEvent, IEditorRegistry, Extensions} from 'vs/workbench/common/editor'; import {BaseTextEditor} from 'vs/workbench/browser/parts/editor/textEditor'; import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService'; import {IHistoryService} from 'vs/workbench/services/history/common/history'; @@ -21,7 +21,6 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {IDisposable, dispose} from 'vs/base/common/lifecycle'; import {IStorageService, StorageScope} from 'vs/platform/storage/common/storage'; import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle'; -import {IEditorRegistry, Extensions} from 'vs/workbench/browser/parts/editor/baseEditor'; import {Registry} from 'vs/platform/platform'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {IEditorGroupService} from 'vs/workbench/services/group/common/groupService'; diff --git a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts index 195ab30a533..d3251f6aa4b 100644 --- a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts @@ -6,8 +6,8 @@ 'use strict'; import * as assert from 'assert'; -import {BaseEditor, EditorInputAction, EditorInputActionContributor, EditorDescriptor, Extensions, IEditorRegistry, IEditorInputFactory} from 'vs/workbench/browser/parts/editor/baseEditor'; -import {EditorInput, EditorOptions} from 'vs/workbench/common/editor'; +import {BaseEditor, EditorInputAction, EditorInputActionContributor, EditorDescriptor} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {EditorInput, EditorOptions, Extensions, IEditorRegistry, IEditorInputFactory} from 'vs/workbench/common/editor'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService'; import * as Platform from 'vs/platform/platform'; diff --git a/src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts b/src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts index 0245d57963e..b735ff398c0 100644 --- a/src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts +++ b/src/vs/workbench/test/browser/parts/quickOpen/quickopen.test.ts @@ -10,7 +10,7 @@ import 'vs/workbench/browser/parts/editor/editor.contribution'; // make sure to import {TestQuickOpenService} from 'vs/workbench/test/common/servicesTestUtils'; import {Registry} from 'vs/platform/platform'; import {QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenAction} from 'vs/workbench/browser/quickopen'; -import {Extensions} from 'vs/workbench/browser/parts/editor/baseEditor'; +import {Extensions} from 'vs/workbench/common/editor'; suite('Workbench QuickOpen', () => { diff --git a/src/vs/workbench/test/common/editor/editorStacksModel.test.ts b/src/vs/workbench/test/common/editor/editorStacksModel.test.ts index 07116d281ea..3147339032f 100644 --- a/src/vs/workbench/test/common/editor/editorStacksModel.test.ts +++ b/src/vs/workbench/test/common/editor/editorStacksModel.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import {EditorStacksModel, EditorGroup} from 'vs/workbench/common/editor/editorStacksModel'; -import {EditorInput, IFileEditorInput, IEditorIdentifier, IEditorGroup, IStacksModelChangeEvent} from 'vs/workbench/common/editor'; +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, TestConfigurationService, TestLifecycleService, TestContextService, TestWorkspace, TestConfiguration} from 'vs/workbench/test/common/servicesTestUtils'; import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService'; @@ -16,7 +16,6 @@ import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollect import {IStorageService} from 'vs/platform/storage/common/storage'; import {ILifecycleService} from 'vs/platform/lifecycle/common/lifecycle'; import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; -import {IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory} from 'vs/workbench/browser/parts/editor/baseEditor'; import {Registry} from 'vs/platform/platform'; import {Position, Direction} from 'vs/platform/editor/common/editor'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; -- GitLab