diff --git a/src/vs/test/utils/servicesTestUtils.ts b/src/vs/test/utils/servicesTestUtils.ts index bcb8b63c1a14211ce08654c6aeb2c7b5d8276394..fbcf18e6902983e3b2ce86bb314b8ce3e6cafc31 100644 --- a/src/vs/test/utils/servicesTestUtils.ts +++ b/src/vs/test/utils/servicesTestUtils.ts @@ -14,7 +14,7 @@ import * as paths from 'vs/base/common/paths'; import URI from 'vs/base/common/uri'; import { ITelemetryService, NullTelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Storage, InMemoryLocalStorage } from 'vs/workbench/node/storage'; -import { EditorInputEvent, IEditorGroup, ConfirmResult } from 'vs/workbench/common/editor'; +import { IEditorGroup, ConfirmResult } from 'vs/workbench/common/editor'; import Event, { Emitter } from 'vs/base/common/event'; import Severity from 'vs/base/common/severity'; import { IConfigurationService, getConfigurationValue, IConfigurationValue } from 'vs/platform/configuration/common/configuration'; @@ -317,14 +317,12 @@ export class TestEditorGroupService implements IEditorGroupService { private stacksModel: EditorStacksModel; private _onEditorsChanged: Emitter; - private _onEditorOpening: Emitter; private _onEditorOpenFail: Emitter; private _onEditorsMoved: Emitter; constructor(callback?: (method: string) => void) { this._onEditorsMoved = new Emitter(); this._onEditorsChanged = new Emitter(); - this._onEditorOpening = new Emitter(); this._onEditorOpenFail = new Emitter(); let services = new ServiceCollection(); @@ -348,10 +346,6 @@ export class TestEditorGroupService implements IEditorGroupService { return this._onEditorsChanged.event; } - public get onEditorOpening(): Event { - return this._onEditorOpening.event; - } - public get onEditorOpenFail(): Event { return this._onEditorOpenFail.event; } diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 098bcce4dc15f92a5d93b7b4d282a2dbea1590ab..7ecba1cbe254dd6d3809b808af47f2ff056a0cfb 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -20,7 +20,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import { Scope as MementoScope } from 'vs/workbench/common/memento'; import { Part } from 'vs/workbench/browser/part'; import { BaseEditor, EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; -import { IEditorRegistry, Extensions as EditorExtensions, EditorInput, EditorOptions, ConfirmResult, EditorInputEvent, IWorkbenchEditorConfiguration, IEditorDescriptor, TextEditorOptions } from 'vs/workbench/common/editor'; +import { IEditorRegistry, Extensions as EditorExtensions, EditorInput, EditorOptions, ConfirmResult, IWorkbenchEditorConfiguration, IEditorDescriptor, TextEditorOptions } 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/group/common/groupService'; @@ -85,7 +85,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService private previewEditors: boolean; private _onEditorsChanged: Emitter; - private _onEditorOpening: Emitter; private _onEditorsMoved: Emitter; private _onEditorOpenFail: Emitter; @@ -110,7 +109,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService super(id); this._onEditorsChanged = new Emitter(); - this._onEditorOpening = new Emitter(); this._onEditorsMoved = new Emitter(); this._onEditorOpenFail = new Emitter(); @@ -171,10 +169,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return this._onEditorsChanged.event; } - public get onEditorOpening(): Event { - return this._onEditorOpening.event; - } - public get onEditorsMoved(): Event { return this._onEditorsMoved.event; } @@ -203,13 +197,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return TPromise.as(null); } - // Emit early open event to allow for veto - const event = new EditorInputEvent(input); - this._onEditorOpening.fire(event); - if (event.isPrevented()) { - return TPromise.as(null); - } - // We need an editor descriptor for the input const descriptor = Registry.as(EditorExtensions.Editors).getEditor(input); if (!descriptor) { @@ -1137,7 +1124,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // Emitters this._onEditorsChanged.dispose(); - this._onEditorOpening.dispose(); this._onEditorsMoved.dispose(); this._onEditorOpenFail.dispose(); diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index a93f44aed7c47cca0e2981001ca23504eb2c4b94..27acb0ed8759f98ffe94957fe37ddb953fd41731 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -11,7 +11,6 @@ import URI from 'vs/base/common/uri'; import { IEditor, ICommonCodeEditor, IEditorViewState, IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/editorCommon'; import { IEditorInput, IEditorModel, IEditorOptions, ITextEditorOptions, IResourceInput, Position } from 'vs/platform/editor/common/editor'; 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'; @@ -278,29 +277,6 @@ export abstract class EditorInput implements IEditorInput { } } -export class EditorInputEvent extends BaseEvent { - private _editorInput: IEditorInput; - private prevented: boolean; - - constructor(editorInput: IEditorInput) { - super(null); - - this._editorInput = editorInput; - } - - public get editorInput(): IEditorInput { - return this._editorInput; - } - - public prevent(): void { - this.prevented = true; - } - - public isPrevented(): boolean { - return this.prevented; - } -} - export enum EncodingMode { /** diff --git a/src/vs/workbench/services/group/common/groupService.ts b/src/vs/workbench/services/group/common/groupService.ts index 67dd31d0b646fbfb2fb910e9f54e22703f42b80d..f71a46f7f1bac6a171be04876b9eeb480897c879 100644 --- a/src/vs/workbench/services/group/common/groupService.ts +++ b/src/vs/workbench/services/group/common/groupService.ts @@ -9,7 +9,6 @@ import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/co import { Position, IEditorInput } from 'vs/platform/editor/common/editor'; import { IEditorStacksModel, IEditorGroup } from 'vs/workbench/common/editor'; import Event from 'vs/base/common/event'; -import { EditorInputEvent } from 'vs/workbench/common/editor'; export enum GroupArrangement { MINIMIZE_OTHERS, @@ -30,11 +29,6 @@ export interface IEditorGroupService { */ onEditorsChanged: Event; - /** - * Emitted when an editor is about to open. - */ - onEditorOpening: Event; - /** * Emitted when opening an editor fails. */