From 4c8a49599bbc9bb168ba92259491b41880ae7e59 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Sat, 19 May 2018 15:11:30 +0200 Subject: [PATCH] grid - first cut nexteditor => editor --- src/vs/workbench/browser/layout.ts | 4 +- .../browser/parts/editor/baseEditor.ts | 14 +- .../workbench/browser/parts/editor/editor.ts | 46 +++---- .../browser/parts/editor/editorActions.ts | 12 +- .../browser/parts/editor/editorCommands.ts | 8 +- ...{nextEditorControl.ts => editorControl.ts} | 6 +- ...ditorDropTarget.ts => editorDropTarget.ts} | 20 +-- ...tEditorGroupView.ts => editorGroupView.ts} | 58 ++++---- .../{nextEditorPart.ts => editorPart.ts} | 124 +++++++++--------- .../browser/parts/editor/editorPicker.ts | 10 +- ...torDropTarget.css => editordroptarget.css} | 0 ...ditorGroupView.css => editorgroupview.css} | 0 ...itleControl.css => notabstitlecontrol.css} | 0 ...sTitleControl.css => tabstitlecontrol.css} | 0 ...{nextTitleControl.css => titlecontrol.css} | 0 ...sTitleControl.ts => noTabsTitleControl.ts} | 10 +- .../browser/parts/editor/sideBySideEditor.ts | 4 +- ...absTitleControl.ts => tabsTitleControl.ts} | 16 +-- .../browser/parts/editor/textDiffEditor.ts | 4 +- .../browser/parts/editor/textEditor.ts | 4 +- .../{nextTitleControl.ts => titleControl.ts} | 16 +-- src/vs/workbench/common/editor.ts | 34 ++--- src/vs/workbench/common/editor/editorGroup.ts | 4 +- .../workbench/electron-browser/workbench.ts | 6 +- .../browser/editors/fileEditorTracker.ts | 4 +- .../files/browser/editors/textFileEditor.ts | 4 +- .../parts/files/common/explorerModel.ts | 4 +- .../files/electron-browser/explorerViewlet.ts | 4 +- .../electron-browser/views/openEditorsView.ts | 34 ++--- .../html/electron-browser/htmlPreviewPart.ts | 4 +- .../preferences/browser/preferencesEditor.ts | 6 +- .../common/preferencesContribution.ts | 4 +- .../quickopen/browser/gotoLineHandler.ts | 4 +- .../quickopen/browser/gotoSymbolHandler.ts | 4 +- .../webview/electron-browser/webviewEditor.ts | 4 +- .../editor/browser/nextEditorService.ts | 46 +++---- .../services/editor/common/editorService.ts | 14 +- .../editor/common/nextEditorService.ts | 20 +-- .../test/browser/nextEditorService.test.ts | 20 +-- .../services/group/common/groupService.ts | 12 +- .../group/common/nextEditorGroupsService.ts | 40 +++--- .../browser/nextEditorGroupsService.test.ts | 18 +-- .../history/electron-browser/history.ts | 4 +- .../preferences/browser/preferencesService.ts | 16 +-- .../preferences/common/preferences.ts | 8 +- .../workbench/test/workbenchTestServices.ts | 52 ++++---- 46 files changed, 363 insertions(+), 363 deletions(-) rename src/vs/workbench/browser/parts/editor/{nextEditorControl.ts => editorControl.ts} (97%) rename src/vs/workbench/browser/parts/editor/{nextEditorDropTarget.ts => editorDropTarget.ts} (96%) rename src/vs/workbench/browser/parts/editor/{nextEditorGroupView.ts => editorGroupView.ts} (93%) rename src/vs/workbench/browser/parts/editor/{nextEditorPart.ts => editorPart.ts} (82%) rename src/vs/workbench/browser/parts/editor/media/{nextEditorDropTarget.css => editordroptarget.css} (100%) rename src/vs/workbench/browser/parts/editor/media/{nextEditorGroupView.css => editorgroupview.css} (100%) rename src/vs/workbench/browser/parts/editor/media/{nextNoTabsTitleControl.css => notabstitlecontrol.css} (100%) rename src/vs/workbench/browser/parts/editor/media/{nextTabsTitleControl.css => tabstitlecontrol.css} (100%) rename src/vs/workbench/browser/parts/editor/media/{nextTitleControl.css => titlecontrol.css} (100%) rename src/vs/workbench/browser/parts/editor/{nextNoTabsTitleControl.ts => noTabsTitleControl.ts} (94%) rename src/vs/workbench/browser/parts/editor/{nextTabsTitleControl.ts => tabsTitleControl.ts} (98%) rename src/vs/workbench/browser/parts/editor/{nextTitleControl.ts => titleControl.ts} (96%) diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 8fa9629284c..04def1df4d6 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -21,7 +21,7 @@ import { NotificationsCenter } from 'vs/workbench/browser/parts/notifications/no import { NotificationsToasts } from 'vs/workbench/browser/parts/notifications/notificationsToasts'; import { Dimension, getClientArea, size, position, hide, show } from 'vs/base/browser/dom'; import { INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; -import { NextEditorPart } from 'vs/workbench/browser/parts/editor/nextEditorPart'; +import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; import { TitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'; import { ActivitybarPart } from 'vs/workbench/browser/parts/activitybar/activitybarPart'; import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart'; @@ -76,7 +76,7 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr private parts: { titlebar: TitlebarPart, activitybar: ActivitybarPart, - editor: NextEditorPart, + editor: EditorPart, sidebar: SidebarPart, panel: PanelPart, statusbar: StatusbarPart diff --git a/src/vs/workbench/browser/parts/editor/baseEditor.ts b/src/vs/workbench/browser/parts/editor/baseEditor.ts index 539f4b0742d..757c6757618 100644 --- a/src/vs/workbench/browser/parts/editor/baseEditor.ts +++ b/src/vs/workbench/browser/parts/editor/baseEditor.ts @@ -10,7 +10,7 @@ import { EditorInput, EditorOptions, IEditor } from 'vs/workbench/common/editor' import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; /** * The base class of editors in the workbench. Editors register themselves for specific editor inputs. @@ -30,7 +30,7 @@ export abstract class BaseEditor extends Panel implements IEditor { protected _input: EditorInput; private _options: EditorOptions; - private _group: INextEditorGroup; + private _group: IEditorGroup; constructor( id: string, @@ -48,7 +48,7 @@ export abstract class BaseEditor extends Panel implements IEditor { return this._options; } - get group(): INextEditorGroup { + get group(): IEditorGroup { return this._group; } @@ -106,9 +106,9 @@ export abstract class BaseEditor extends Panel implements IEditor { */ protected abstract createEditor(parent: HTMLElement): void; - setVisible(visible: boolean, group?: INextEditorGroup): void; // setVisible is sync for editors - setVisible(visible: boolean, group?: INextEditorGroup): TPromise; - setVisible(visible: boolean, group?: INextEditorGroup): TPromise { + setVisible(visible: boolean, group?: IEditorGroup): void; // setVisible is sync for editors + setVisible(visible: boolean, group?: IEditorGroup): TPromise; + setVisible(visible: boolean, group?: IEditorGroup): TPromise { const promise = super.setVisible(visible); // Propagate to Editor @@ -124,7 +124,7 @@ export abstract class BaseEditor extends Panel implements IEditor { * @param visible the state of visibility of this editor * @param group the editor group this editor is in. */ - protected setEditorVisible(visible: boolean, group: INextEditorGroup): void { + protected setEditorVisible(visible: boolean, group: IEditorGroup): void { this._group = group; } diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts index 480d857fbb5..635b0915364 100644 --- a/src/vs/workbench/browser/parts/editor/editor.ts +++ b/src/vs/workbench/browser/parts/editor/editor.ts @@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { GroupIdentifier, IWorkbenchEditorConfiguration, IWorkbenchEditorPartConfiguration, EditorOptions, TextEditorOptions, IEditorInput } from 'vs/workbench/common/editor'; import { EditorGroup } from 'vs/workbench/common/editor/editorGroup'; -import { INextEditorGroup, GroupDirection, IAddGroupOptions, IMergeGroupOptions } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup, GroupDirection, IAddGroupOptions, IMergeGroupOptions } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { IDisposable } from 'vs/base/common/lifecycle'; import { Dimension } from 'vs/base/browser/dom'; import { Event } from 'vs/base/common/event'; @@ -22,11 +22,11 @@ export const EDITOR_TITLE_HEIGHT = 35; export const EDITOR_MIN_DIMENSIONS = new Dimension(220, 70); export const EDITOR_MAX_DIMENSIONS = new Dimension(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY); -export interface INextEditorPartOptions extends IWorkbenchEditorPartConfiguration { +export interface IEditorPartOptions extends IWorkbenchEditorPartConfiguration { iconTheme?: string; } -export const DEFAULT_EDITOR_PART_OPTIONS: INextEditorPartOptions = { +export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = { showTabs: true, tabCloseButton: 'right', tabSizing: 'fit', @@ -41,8 +41,8 @@ export function impactsEditorPartOptions(event: IConfigurationChangeEvent): bool return event.affectsConfiguration('workbench.editor') || event.affectsConfiguration('workbench.iconTheme'); } -export function getEditorPartOptions(config: IWorkbenchEditorConfiguration): INextEditorPartOptions { - const options: INextEditorPartOptions = assign(Object.create(null), DEFAULT_EDITOR_PART_OPTIONS); +export function getEditorPartOptions(config: IWorkbenchEditorConfiguration): IEditorPartOptions { + const options: IEditorPartOptions = assign(Object.create(null), DEFAULT_EDITOR_PART_OPTIONS); if (!config || !config.workbench) { return options; @@ -59,33 +59,33 @@ export function getEditorPartOptions(config: IWorkbenchEditorConfiguration): INe return options; } -export interface INextEditorPartOptionsChangeEvent { - oldPartOptions: INextEditorPartOptions; - newPartOptions: INextEditorPartOptions; +export interface IEditorPartOptionsChangeEvent { + oldPartOptions: IEditorPartOptions; + newPartOptions: IEditorPartOptions; } -export interface INextEditorGroupsAccessor { - readonly groups: INextEditorGroupView[]; - readonly activeGroup: INextEditorGroupView; +export interface IEditorGroupsAccessor { + readonly groups: IEditorGroupView[]; + readonly activeGroup: IEditorGroupView; - readonly partOptions: INextEditorPartOptions; - readonly onDidEditorPartOptionsChange: Event; + readonly partOptions: IEditorPartOptions; + readonly onDidEditorPartOptionsChange: Event; - getGroup(identifier: GroupIdentifier): INextEditorGroupView; + getGroup(identifier: GroupIdentifier): IEditorGroupView; - activateGroup(identifier: INextEditorGroupView | GroupIdentifier): INextEditorGroupView; - focusGroup(identifier: INextEditorGroupView | GroupIdentifier): INextEditorGroupView; + activateGroup(identifier: IEditorGroupView | GroupIdentifier): IEditorGroupView; + focusGroup(identifier: IEditorGroupView | GroupIdentifier): IEditorGroupView; - addGroup(location: INextEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): INextEditorGroupView; - mergeGroup(group: INextEditorGroupView | GroupIdentifier, target: INextEditorGroupView | GroupIdentifier, options?: IMergeGroupOptions): INextEditorGroupView; + addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroupView; + mergeGroup(group: IEditorGroupView | GroupIdentifier, target: IEditorGroupView | GroupIdentifier, options?: IMergeGroupOptions): IEditorGroupView; - moveGroup(group: INextEditorGroupView | GroupIdentifier, location: INextEditorGroupView | GroupIdentifier, direction: GroupDirection): INextEditorGroupView; - copyGroup(group: INextEditorGroupView | GroupIdentifier, location: INextEditorGroupView | GroupIdentifier, direction: GroupDirection): INextEditorGroupView; + moveGroup(group: IEditorGroupView | GroupIdentifier, location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView; + copyGroup(group: IEditorGroupView | GroupIdentifier, location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView; - removeGroup(group: INextEditorGroupView | GroupIdentifier): void; + removeGroup(group: IEditorGroupView | GroupIdentifier): void; } -export interface INextEditorGroupView extends IDisposable, ISerializableView, INextEditorGroup { +export interface IEditorGroupView extends IDisposable, ISerializableView, IEditorGroup { readonly group: EditorGroup; readonly whenRestored: TPromise; readonly disposed: boolean; @@ -100,7 +100,7 @@ export interface INextEditorGroupView extends IDisposable, ISerializableView, IN shutdown(): void; } -export function getActiveTextEditorOptions(group: INextEditorGroup, expectedActiveEditor?: IEditorInput, presetOptions?: EditorOptions): EditorOptions { +export function getActiveTextEditorOptions(group: IEditorGroup, expectedActiveEditor?: IEditorInput, presetOptions?: EditorOptions): EditorOptions { const activeGroupCodeEditor = group.activeControl ? getCodeEditor(group.activeControl.getControl()) : void 0; if (activeGroupCodeEditor) { if (!expectedActiveEditor || expectedActiveEditor.matches(group.activeEditor)) { diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index a0d9b968f12..d0a16d54cfe 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -20,7 +20,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { CLOSE_EDITOR_COMMAND_ID, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, MOVE_ACTIVE_EDITOR_COMMAND_ID, NAVIGATE_IN_ACTIVE_GROUP_PREFIX, ActiveEditorMoveArguments } from 'vs/workbench/browser/parts/editor/editorCommands'; -import { INextEditorGroupsService, INextEditorGroup, GroupsArrangement, EditorsOrder, GroupLocation, GroupDirection, preferredGroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup, GroupsArrangement, EditorsOrder, GroupLocation, GroupDirection, preferredGroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -37,7 +37,7 @@ export class BaseSplitEditorGroupAction extends Action { } public run(context?: IEditorIdentifier): TPromise { - let sourceGroup: INextEditorGroup; + let sourceGroup: IEditorGroup; if (context && typeof context.groupId === 'number') { sourceGroup = this.editorGroupService.getGroup(context.groupId); } else { @@ -173,7 +173,7 @@ export class JoinTwoGroupsAction extends Action { } public run(context?: IEditorIdentifier): TPromise { - let sourceGroup: INextEditorGroup; + let sourceGroup: IEditorGroup; if (context && typeof context.groupId === 'number') { sourceGroup = this.editorGroupService.getGroup(context.groupId); } else { @@ -413,7 +413,7 @@ export class CloseOneEditorAction extends Action { } public run(context?: IEditorCommandsContext): TPromise { - let group: INextEditorGroup; + let group: IEditorGroup; let editorIndex: number; if (context) { group = this.editorGroupService.getGroup(context.groupId); @@ -501,7 +501,7 @@ export class CloseLeftEditorsInGroupAction extends Action { } } -function getTarget(editorService: INextEditorService, editorGroupService: INextEditorGroupsService, context?: IEditorIdentifier): { editor: IEditorInput, group: INextEditorGroup } { +function getTarget(editorService: INextEditorService, editorGroupService: INextEditorGroupsService, context?: IEditorIdentifier): { editor: IEditorInput, group: IEditorGroup } { if (context) { return { editor: context.editor, group: editorGroupService.getGroup(context.groupId) }; } @@ -592,7 +592,7 @@ export class BaseMoveGroupAction extends Action { } public run(context?: IEditorIdentifier): TPromise { - let sourceGroup: INextEditorGroup; + let sourceGroup: IEditorGroup; if (context && typeof context.groupId === 'number') { sourceGroup = this.editorGroupService.getGroup(context.groupId); } else { diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index 3e382a1b9ab..2a5751c9f08 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -20,7 +20,7 @@ import { IDiffEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IListService } from 'vs/platform/list/browser/listService'; import { List } from 'vs/base/browser/ui/list/listWidget'; import { distinct } from 'vs/base/common/arrays'; -import { INextEditorGroupsService, INextEditorGroup, GroupDirection, GroupLocation, GroupsOrder, preferredGroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup, GroupDirection, GroupLocation, GroupsOrder, preferredGroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -133,7 +133,7 @@ function moveActiveEditorToGroup(args: ActiveEditorMoveArguments, control: IEdit const groups = editorGroupService.groups; const sourceGroup = control.group; - let targetGroup: INextEditorGroup; + let targetGroup: IEditorGroup; switch (args.to) { case 'left': @@ -425,7 +425,7 @@ function registerEditorCommands() { handler: (accessor, resource: URI | object, context: IEditorCommandsContext) => { const editorGroupService = accessor.get(INextEditorGroupsService); - let group: INextEditorGroup; + let group: IEditorGroup; if (context && typeof context.groupId === 'number') { group = editorGroupService.getGroup(context.groupId); } else { @@ -522,7 +522,7 @@ function registerEditorCommands() { }); } -function resolveCommandsContext(editorGroupService: INextEditorGroupsService, context?: IEditorCommandsContext): { group: INextEditorGroup, editor: IEditorInput, control: IEditor } { +function resolveCommandsContext(editorGroupService: INextEditorGroupsService, context?: IEditorCommandsContext): { group: IEditorGroup, editor: IEditorInput, control: IEditor } { // Resolve from context let group = context && typeof context.groupId === 'number' ? editorGroupService.getGroup(context.groupId) : undefined; diff --git a/src/vs/workbench/browser/parts/editor/nextEditorControl.ts b/src/vs/workbench/browser/parts/editor/editorControl.ts similarity index 97% rename from src/vs/workbench/browser/parts/editor/nextEditorControl.ts rename to src/vs/workbench/browser/parts/editor/editorControl.ts index a92d7b87af5..ac68527c088 100644 --- a/src/vs/workbench/browser/parts/editor/nextEditorControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorControl.ts @@ -16,14 +16,14 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IProgressService, LongRunningOperation } from 'vs/platform/progress/common/progress'; import { toWinJsPromise } from 'vs/base/common/async'; -import { INextEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; +import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'; export interface IOpenEditorResult { readonly control: BaseEditor; readonly editorChanged: boolean; } -export class NextEditorControl extends Disposable { +export class EditorControl extends Disposable { private dimension: Dimension; private editorOperation: LongRunningOperation; @@ -32,7 +32,7 @@ export class NextEditorControl extends Disposable { constructor( private parent: HTMLElement, - private groupView: INextEditorGroupView, + private groupView: IEditorGroupView, @IPartService private partService: IPartService, @IInstantiationService private instantiationService: IInstantiationService, @IProgressService progressService: IProgressService diff --git a/src/vs/workbench/browser/parts/editor/nextEditorDropTarget.ts b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts similarity index 96% rename from src/vs/workbench/browser/parts/editor/nextEditorDropTarget.ts rename to src/vs/workbench/browser/parts/editor/editorDropTarget.ts index f385b05e626..eaa53578675 100644 --- a/src/vs/workbench/browser/parts/editor/nextEditorDropTarget.ts +++ b/src/vs/workbench/browser/parts/editor/editorDropTarget.ts @@ -5,10 +5,10 @@ 'use strict'; -import 'vs/css!./media/nextEditorDropTarget'; +import 'vs/css!./media/editordroptarget'; import { LocalSelectionTransfer, DraggedEditorIdentifier, ResourcesDropHandler, DraggedEditorGroupIdentifier, DragAndDropObserver } from 'vs/workbench/browser/dnd'; import { addDisposableListener, EventType, EventHelper, isAncestor, toggleClass, addClass, removeClass } from 'vs/base/browser/dom'; -import { INextEditorGroupsAccessor, EDITOR_TITLE_HEIGHT, INextEditorGroupView, getActiveTextEditorOptions } from 'vs/workbench/browser/parts/editor/editor'; +import { IEditorGroupsAccessor, EDITOR_TITLE_HEIGHT, IEditorGroupView, getActiveTextEditorOptions } from 'vs/workbench/browser/parts/editor/editor'; import { EDITOR_DRAG_AND_DROP_BACKGROUND, Themable } from 'vs/workbench/common/theme'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; @@ -37,8 +37,8 @@ class DropOverlay extends Themable { private readonly groupTransfer = LocalSelectionTransfer.getInstance(); constructor( - private accessor: INextEditorGroupsAccessor, - private groupView: INextEditorGroupView, + private accessor: IEditorGroupsAccessor, + private groupView: IEditorGroupView, themeService: IThemeService, private instantiationService: IInstantiationService ) { @@ -145,7 +145,7 @@ class DropOverlay extends Themable { })); } - private findSourceGroupView(): INextEditorGroupView { + private findSourceGroupView(): IEditorGroupView { // Check for group transfer if (this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype)) { @@ -164,7 +164,7 @@ class DropOverlay extends Themable { // Determine target group const ensureTargetGroup = () => { - let targetGroup: INextEditorGroupView; + let targetGroup: IEditorGroupView; if (typeof splitDirection === 'number') { targetGroup = this.accessor.addGroup(this.groupView, splitDirection, { activate: true }); } else { @@ -185,7 +185,7 @@ class DropOverlay extends Themable { } // Split to new group - let targetGroup: INextEditorGroupView; + let targetGroup: IEditorGroupView; if (typeof splitDirection === 'number') { if (this.isCopyOperation(event)) { targetGroup = this.accessor.copyGroup(sourceGroup, this.groupView, splitDirection); @@ -342,7 +342,7 @@ class DropOverlay extends Themable { } } -export class NextEditorDropTarget extends Themable { +export class EditorDropTarget extends Themable { private _overlay: DropOverlay; @@ -352,7 +352,7 @@ export class NextEditorDropTarget extends Themable { private readonly groupTransfer = LocalSelectionTransfer.getInstance(); constructor( - private accessor: INextEditorGroupsAccessor, + private accessor: IEditorGroupsAccessor, private container: HTMLElement, @IThemeService themeService: IThemeService, @IInstantiationService private instantiationService: IInstantiationService @@ -425,7 +425,7 @@ export class NextEditorDropTarget extends Themable { this.disposeOverlay(); } - private findTargetGroupView(child: HTMLElement): INextEditorGroupView { + private findTargetGroupView(child: HTMLElement): IEditorGroupView { const groups = this.accessor.groups; for (let i = 0; i < groups.length; i++) { const groupView = groups[i]; diff --git a/src/vs/workbench/browser/parts/editor/nextEditorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts similarity index 93% rename from src/vs/workbench/browser/parts/editor/nextEditorGroupView.ts rename to src/vs/workbench/browser/parts/editor/editorGroupView.ts index 81d3959e461..dd98815568b 100644 --- a/src/vs/workbench/browser/parts/editor/nextEditorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -5,7 +5,7 @@ 'use strict'; -import 'vs/css!./media/nextEditorGroupView'; +import 'vs/css!./media/editorgroupview'; import { TPromise } from 'vs/base/common/winjs.base'; import { EditorGroup, IEditorOpenOptions, EditorCloseEvent, ISerializedEditorGroup, isSerializedEditorGroup } from 'vs/workbench/common/editor/editorGroup'; import { EditorInput, EditorOptions, GroupIdentifier, ConfirmResult, SideBySideEditorInput, IEditorOpeningEvent, CloseDirection, IEditorCloseEvent } from 'vs/workbench/common/editor'; @@ -20,8 +20,8 @@ import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/com import { editorBackground, contrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; import { Themable, EDITOR_GROUP_HEADER_TABS_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_ACTIVE_EMPTY_BACKGROUND, EDITOR_GROUP_EMPTY_BACKGROUND } from 'vs/workbench/common/theme'; import { IMoveEditorOptions, ICopyEditorOptions, ICloseEditorsFilter, IGroupChangeEvent, GroupChangeKind, EditorsOrder } from 'vs/workbench/services/group/common/nextEditorGroupsService'; -import { NextTabsTitleControl } from 'vs/workbench/browser/parts/editor/nextTabsTitleControl'; -import { NextEditorControl } from 'vs/workbench/browser/parts/editor/nextEditorControl'; +import { TabsTitleControl } from 'vs/workbench/browser/parts/editor/tabsTitleControl'; +import { EditorControl } from 'vs/workbench/browser/parts/editor/editorControl'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { ProgressService } from 'vs/workbench/services/progress/browser/progressService'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; @@ -33,30 +33,30 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { RunOnceWorker } from 'vs/base/common/async'; import { EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch'; -import { NextTitleControl } from 'vs/workbench/browser/parts/editor/nextTitleControl'; -import { INextEditorGroupsAccessor, INextEditorGroupView, INextEditorPartOptionsChangeEvent, EDITOR_TITLE_HEIGHT, EDITOR_MIN_DIMENSIONS, EDITOR_MAX_DIMENSIONS, getActiveTextEditorOptions } from 'vs/workbench/browser/parts/editor/editor'; -import { NextNoTabsTitleControl } from './nextNoTabsTitleControl'; +import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl'; +import { IEditorGroupsAccessor, IEditorGroupView, IEditorPartOptionsChangeEvent, EDITOR_TITLE_HEIGHT, EDITOR_MIN_DIMENSIONS, EDITOR_MAX_DIMENSIONS, getActiveTextEditorOptions } from 'vs/workbench/browser/parts/editor/editor'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { join } from 'vs/base/common/paths'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ActionRunner, IAction, Action } from 'vs/base/common/actions'; import { CLOSE_EDITOR_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; +import { NoTabsTitleControl } from 'vs/workbench/browser/parts/editor/noTabsTitleControl'; -export class NextEditorGroupView extends Themable implements INextEditorGroupView { +export class EditorGroupView extends Themable implements IEditorGroupView { //#region factory - static createNew(accessor: INextEditorGroupsAccessor, label: string, instantiationService: IInstantiationService): INextEditorGroupView { - return instantiationService.createInstance(NextEditorGroupView, accessor, null, label); + static createNew(accessor: IEditorGroupsAccessor, label: string, instantiationService: IInstantiationService): IEditorGroupView { + return instantiationService.createInstance(EditorGroupView, accessor, null, label); } - static createFromSerialized(serialized: ISerializedEditorGroup, accessor: INextEditorGroupsAccessor, label: string, instantiationService: IInstantiationService): INextEditorGroupView { - return instantiationService.createInstance(NextEditorGroupView, accessor, serialized, label); + static createFromSerialized(serialized: ISerializedEditorGroup, accessor: IEditorGroupsAccessor, label: string, instantiationService: IInstantiationService): IEditorGroupView { + return instantiationService.createInstance(EditorGroupView, accessor, serialized, label); } - static createCopy(copyFrom: INextEditorGroupView, accessor: INextEditorGroupsAccessor, label: string, instantiationService: IInstantiationService): INextEditorGroupView { - return instantiationService.createInstance(NextEditorGroupView, accessor, copyFrom, label); + static createCopy(copyFrom: IEditorGroupView, accessor: IEditorGroupsAccessor, label: string, instantiationService: IInstantiationService): IEditorGroupView { + return instantiationService.createInstance(EditorGroupView, accessor, copyFrom, label); } //#endregion @@ -98,19 +98,19 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie private scopedInstantiationService: IInstantiationService; private titleContainer: HTMLElement; - private titleAreaControl: NextTitleControl; + private titleAreaControl: TitleControl; private progressBar: ProgressBar; private editorContainer: HTMLElement; - private editorControl: NextEditorControl; + private editorControl: EditorControl; private ignoreOpenEditorErrors: boolean; private disposedEditorsWorker: RunOnceWorker; constructor( - private accessor: INextEditorGroupsAccessor, - from: INextEditorGroupView | ISerializedEditorGroup, + private accessor: IEditorGroupsAccessor, + from: IEditorGroupView | ISerializedEditorGroup, private _label: string, @IInstantiationService private instantiationService: IInstantiationService, @IContextKeyService private contextKeyService: IContextKeyService, @@ -122,7 +122,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie ) { super(themeService); - if (from instanceof NextEditorGroupView) { + if (from instanceof EditorGroupView) { this._group = this._register(from.group.clone()); } else if (isSerializedEditorGroup(from)) { this._group = this._register(instantiationService.createInstance(EditorGroup, from)); @@ -176,7 +176,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie this.element.appendChild(this.editorContainer); // Editor control - this.editorControl = this._register(this.scopedInstantiationService.createInstance(NextEditorControl, this.editorContainer, this)); + this.editorControl = this._register(this.scopedInstantiationService.createInstance(EditorControl, this.editorContainer, this)); // Track Focus this.doTrackFocus(); @@ -302,20 +302,20 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie // Create new based on options if (this.accessor.partOptions.showTabs) { - this.titleAreaControl = this.scopedInstantiationService.createInstance(NextTabsTitleControl, this.titleContainer, this.accessor, this); + this.titleAreaControl = this.scopedInstantiationService.createInstance(TabsTitleControl, this.titleContainer, this.accessor, this); } else { - this.titleAreaControl = this.scopedInstantiationService.createInstance(NextNoTabsTitleControl, this.titleContainer, this.accessor, this); + this.titleAreaControl = this.scopedInstantiationService.createInstance(NoTabsTitleControl, this.titleContainer, this.accessor, this); } } - private restoreEditors(from: INextEditorGroupView | ISerializedEditorGroup): TPromise { + private restoreEditors(from: IEditorGroupView | ISerializedEditorGroup): TPromise { if (this._group.count === 0) { return TPromise.as(void 0); // nothing to show } // Determine editor options let options: EditorOptions; - if (from instanceof NextEditorGroupView) { + if (from instanceof EditorGroupView) { options = getActiveTextEditorOptions(from); // if we copy from another group, ensure to copy its active editor viewstate } else { options = new EditorOptions(); @@ -443,7 +443,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie } } - private onDidEditorPartOptionsChange(event: INextEditorPartOptionsChangeEvent): void { + private onDidEditorPartOptionsChange(event: IEditorPartOptionsChangeEvent): void { // Title container this.updateTitleContainer(); @@ -494,7 +494,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie //#endregion - //region INextEditorGroupView + //region IEditorGroupView get group(): EditorGroup { return this._group; @@ -542,7 +542,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie //#endregion - //#region INextEditorGroup + //#region IEditorGroup //#region basics() @@ -747,7 +747,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie //#region moveEditor() - moveEditor(editor: EditorInput, target: INextEditorGroupView, options?: IMoveEditorOptions): void { + moveEditor(editor: EditorInput, target: IEditorGroupView, options?: IMoveEditorOptions): void { // Move within same group if (this === target) { @@ -783,7 +783,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie this._onDidGroupChange.fire({ kind: GroupChangeKind.EDITOR_MOVE, editor }); } - private doMoveOrCopyEditorAcrossGroups(editor: EditorInput, target: INextEditorGroupView, moveOptions: IMoveEditorOptions = Object.create(null), keepCopy?: boolean): void { + private doMoveOrCopyEditorAcrossGroups(editor: EditorInput, target: IEditorGroupView, moveOptions: IMoveEditorOptions = Object.create(null), keepCopy?: boolean): void { // When moving an editor, try to preserve as much view state as possible by checking // for the editor to be a text editor and creating the options accordingly if so @@ -803,7 +803,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie //#region copyEditor() - copyEditor(editor: EditorInput, target: INextEditorGroupView, options?: ICopyEditorOptions): void { + copyEditor(editor: EditorInput, target: IEditorGroupView, options?: ICopyEditorOptions): void { // Move within same group because we do not support to show the same editor // multiple times in the same group diff --git a/src/vs/workbench/browser/parts/editor/nextEditorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts similarity index 82% rename from src/vs/workbench/browser/parts/editor/nextEditorPart.ts rename to src/vs/workbench/browser/parts/editor/editorPart.ts index 999782f208d..2dd90d16fad 100644 --- a/src/vs/workbench/browser/parts/editor/nextEditorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -18,8 +18,8 @@ import { GroupIdentifier, IWorkbenchEditorConfiguration } from 'vs/workbench/com import { values } from 'vs/base/common/map'; import { EDITOR_GROUP_BORDER } from 'vs/workbench/common/theme'; import { distinct } from 'vs/base/common/arrays'; -import { INextEditorGroupsAccessor, INextEditorGroupView, INextEditorPartOptions, getEditorPartOptions, impactsEditorPartOptions, INextEditorPartOptionsChangeEvent, EDITOR_MAX_DIMENSIONS, EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor'; -import { NextEditorGroupView } from 'vs/workbench/browser/parts/editor/nextEditorGroupView'; +import { IEditorGroupsAccessor, IEditorGroupView, IEditorPartOptions, getEditorPartOptions, impactsEditorPartOptions, IEditorPartOptionsChangeEvent, EDITOR_MAX_DIMENSIONS, EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor'; +import { EditorGroupView } from 'vs/workbench/browser/parts/editor/editorGroupView'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { assign } from 'vs/base/common/objects'; @@ -32,41 +32,41 @@ import { GroupOrientation as LegacyGroupOrientation } from 'vs/workbench/service import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; -import { NextEditorDropTarget } from 'vs/workbench/browser/parts/editor/nextEditorDropTarget'; +import { EditorDropTarget } from 'vs/workbench/browser/parts/editor/editorDropTarget'; import { localize } from 'vs/nls'; // TODO@grid enable minimized/maximized groups in one dimension // - doCreateGroupView(): needs listener if the view gets minimized, the previous active group should become active // - doSetGroupActive(): needs a listener if the group is minimized, it should now restore to be maximized -interface INextEditorPartUIState { +interface IEditorPartUIState { serializedGrid: ISerializedGrid; activeGroup: GroupIdentifier; mostRecentActiveGroups: GroupIdentifier[]; } -export class NextEditorPart extends Part implements INextEditorGroupsService, INextEditorGroupsAccessor { +export class EditorPart extends Part implements INextEditorGroupsService, IEditorGroupsAccessor { _serviceBrand: any; - private static readonly NEXT_EDITOR_PART_UI_STATE_STORAGE_KEY = 'nexteditorpart.uiState'; + private static readonly EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.uiState'; //#region Events private _onDidLayout: Emitter = this._register(new Emitter()); get onDidLayout(): Event { return this._onDidLayout.event; } - private _onDidActiveGroupChange: Emitter = this._register(new Emitter()); - get onDidActiveGroupChange(): Event { return this._onDidActiveGroupChange.event; } + private _onDidActiveGroupChange: Emitter = this._register(new Emitter()); + get onDidActiveGroupChange(): Event { return this._onDidActiveGroupChange.event; } - private _onDidAddGroup: Emitter = this._register(new Emitter()); - get onDidAddGroup(): Event { return this._onDidAddGroup.event; } + private _onDidAddGroup: Emitter = this._register(new Emitter()); + get onDidAddGroup(): Event { return this._onDidAddGroup.event; } - private _onDidRemoveGroup: Emitter = this._register(new Emitter()); - get onDidRemoveGroup(): Event { return this._onDidRemoveGroup.event; } + private _onDidRemoveGroup: Emitter = this._register(new Emitter()); + get onDidRemoveGroup(): Event { return this._onDidRemoveGroup.event; } - private _onDidMoveGroup: Emitter = this._register(new Emitter()); - get onDidMoveGroup(): Event { return this._onDidMoveGroup.event; } + private _onDidMoveGroup: Emitter = this._register(new Emitter()); + get onDidMoveGroup(): Event { return this._onDidMoveGroup.event; } private _onDidPreferredSizeChange: Emitter = this._register(new Emitter()); get onDidPreferredSizeChange(): Event { return this._onDidPreferredSizeChange.event; } @@ -77,14 +77,14 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN private _preferredSize: Dimension; private memento: object; - private _partOptions: INextEditorPartOptions; + private _partOptions: IEditorPartOptions; - private _activeGroup: INextEditorGroupView; - private groupViews: Map = new Map(); + private _activeGroup: IEditorGroupView; + private groupViews: Map = new Map(); private mostRecentActiveGroups: GroupIdentifier[] = []; private container: HTMLElement; - private gridWidget: SerializableGrid; + private gridWidget: SerializableGrid; private _whenRestored: TPromise; private whenRestoredComplete: TValueCallback; @@ -114,10 +114,10 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN //#region IEditorPartOptions - private enforcedPartOptions: INextEditorPartOptions[] = []; + private enforcedPartOptions: IEditorPartOptions[] = []; - private _onDidEditorPartOptionsChange: Emitter = this._register(new Emitter()); - get onDidEditorPartOptionsChange(): Event { return this._onDidEditorPartOptionsChange.event; } + private _onDidEditorPartOptionsChange: Emitter = this._register(new Emitter()); + get onDidEditorPartOptionsChange(): Event { return this._onDidEditorPartOptionsChange.event; } private registerListeners(): void { this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e))); @@ -142,11 +142,11 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN this._onDidEditorPartOptionsChange.fire({ oldPartOptions, newPartOptions }); } - get partOptions(): INextEditorPartOptions { + get partOptions(): IEditorPartOptions { return this._partOptions; } - enforcePartOptions(options: INextEditorPartOptions): IDisposable { + enforcePartOptions(options: IEditorPartOptions): IDisposable { this.enforcedPartOptions.push(options); this.handleChangedPartOptions(); @@ -158,13 +158,13 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN //#endregion - //#region INextEditorGroupsService + //#region IEditorGroupsService - get activeGroup(): INextEditorGroupView { + get activeGroup(): IEditorGroupView { return this._activeGroup; } - get groups(): INextEditorGroupView[] { + get groups(): IEditorGroupView[] { return values(this.groupViews); } @@ -184,7 +184,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return this._whenRestored; } - getGroups(order = GroupsOrder.CREATION_TIME): INextEditorGroupView[] { + getGroups(order = GroupsOrder.CREATION_TIME): IEditorGroupView[] { switch (order) { case GroupsOrder.CREATION_TIME: return this.groups; @@ -197,7 +197,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return distinct([...mostRecentActive, ...this.groups]); case GroupsOrder.GRID_APPEARANCE: - const views: INextEditorGroupView[] = []; + const views: IEditorGroupView[] = []; if (this.gridWidget) { this.fillGridNodes(views, this.gridWidget.getViews()); } @@ -206,7 +206,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN } } - private fillGridNodes(target: INextEditorGroupView[], node: GridBranchNode | GridNode): void { + private fillGridNodes(target: IEditorGroupView[], node: GridBranchNode | GridNode): void { if (isGridBranchNode(node)) { node.children.forEach(child => this.fillGridNodes(target, child)); } else { @@ -214,11 +214,11 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN } } - getGroup(identifier: GroupIdentifier): INextEditorGroupView { + getGroup(identifier: GroupIdentifier): IEditorGroupView { return this.groupViews.get(identifier); } - findGroup(scope: IFindGroupScope, source: INextEditorGroupView | GroupIdentifier = this.activeGroup): INextEditorGroupView { + findGroup(scope: IFindGroupScope, source: IEditorGroupView | GroupIdentifier = this.activeGroup): IEditorGroupView { // by direction if (typeof scope.direction === 'number') { @@ -229,7 +229,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return this.doFindGroupByLocation(scope.location, source); } - private doFindGroupByDirection(direction: GroupDirection, source: INextEditorGroupView | GroupIdentifier): INextEditorGroupView { + private doFindGroupByDirection(direction: GroupDirection, source: IEditorGroupView | GroupIdentifier): IEditorGroupView { const sourceGroupView = this.assertGroupView(source); const groups = this.getGroups(GroupsOrder.GRID_APPEARANCE); const index = groups.indexOf(sourceGroupView); @@ -242,7 +242,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return void 0; } - private doFindGroupByLocation(location: GroupLocation, source: INextEditorGroupView | GroupIdentifier): INextEditorGroupView { + private doFindGroupByLocation(location: GroupLocation, source: IEditorGroupView | GroupIdentifier): IEditorGroupView { const sourceGroupView = this.assertGroupView(source); const groups = this.getGroups(GroupsOrder.CREATION_TIME); const index = groups.indexOf(sourceGroupView); @@ -259,14 +259,14 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN } } - activateGroup(group: INextEditorGroupView | GroupIdentifier): INextEditorGroupView { + activateGroup(group: IEditorGroupView | GroupIdentifier): IEditorGroupView { const groupView = this.assertGroupView(group); this.doSetGroupActive(groupView); return groupView; } - focusGroup(group: INextEditorGroupView | GroupIdentifier): INextEditorGroupView { + focusGroup(group: IEditorGroupView | GroupIdentifier): IEditorGroupView { const groupView = this.assertGroupView(group); // Activate and focus group @@ -276,7 +276,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return groupView; } - resizeGroup(group: INextEditorGroupView | GroupIdentifier, sizeDelta: number): INextEditorGroupView { + resizeGroup(group: IEditorGroupView | GroupIdentifier, sizeDelta: number): IEditorGroupView { const groupView = this.assertGroupView(group); const currentSize = this.gridWidget.getViewSize(groupView); @@ -332,7 +332,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN } } - addGroup(location: INextEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): INextEditorGroupView { + addGroup(location: IEditorGroupView | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroupView { const locationView = this.assertGroupView(location); const group = this.doAddGroup(locationView, direction); @@ -344,7 +344,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return group; } - private doAddGroup(locationView: INextEditorGroupView, direction: GroupDirection, groupToCopy?: INextEditorGroupView): INextEditorGroupView { + private doAddGroup(locationView: IEditorGroupView, direction: GroupDirection, groupToCopy?: IEditorGroupView): IEditorGroupView { const newGroupView = this.doCreateGroupView(groupToCopy); // Add to grid widget @@ -367,19 +367,19 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return newGroupView; } - private doCreateGroupView(from?: INextEditorGroupView | ISerializedEditorGroup): INextEditorGroupView { + private doCreateGroupView(from?: IEditorGroupView | ISerializedEditorGroup): IEditorGroupView { // Label: just use the number of existing groups as label const label = this.getGroupLabel(this.count + 1); // Create group view - let groupView: INextEditorGroupView; - if (from instanceof NextEditorGroupView) { - groupView = NextEditorGroupView.createCopy(from, this, label, this.instantiationService); + let groupView: IEditorGroupView; + if (from instanceof EditorGroupView) { + groupView = EditorGroupView.createCopy(from, this, label, this.instantiationService); } else if (isSerializedEditorGroup(from)) { - groupView = NextEditorGroupView.createFromSerialized(from, this, label, this.instantiationService); + groupView = EditorGroupView.createFromSerialized(from, this, label, this.instantiationService); } else { - groupView = NextEditorGroupView.createNew(this, label, this.instantiationService); + groupView = EditorGroupView.createNew(this, label, this.instantiationService); } // Keep in map @@ -408,7 +408,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return groupView; } - private doSetGroupActive(group: INextEditorGroupView): void { + private doSetGroupActive(group: IEditorGroupView): void { if (this._activeGroup === group) { return; // return if this is already the active group } @@ -431,7 +431,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN this._onDidActiveGroupChange.fire(group); } - private doUpdateMostRecentActive(group: INextEditorGroupView, makeMostRecentlyActive?: boolean): void { + private doUpdateMostRecentActive(group: IEditorGroupView, makeMostRecentlyActive?: boolean): void { const index = this.mostRecentActiveGroups.indexOf(group.id); // Remove from MRU list @@ -454,7 +454,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN } } - removeGroup(group: INextEditorGroupView | GroupIdentifier): void { + removeGroup(group: IEditorGroupView | GroupIdentifier): void { const groupView = this.assertGroupView(group); if (this.groupViews.size === 1) { return; // Cannot remove the last root group @@ -469,10 +469,10 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN this.doRemoveGroupWithEditors(groupView); } - private doRemoveGroupWithEditors(groupView: INextEditorGroupView): void { + private doRemoveGroupWithEditors(groupView: IEditorGroupView): void { const mostRecentlyActiveGroups = this.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE); - let lastActiveGroup: INextEditorGroupView; + let lastActiveGroup: IEditorGroupView; if (this._activeGroup === groupView) { lastActiveGroup = mostRecentlyActiveGroups[1]; } else { @@ -484,7 +484,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN this.mergeGroup(groupView, lastActiveGroup); } - private doRemoveEmptyGroup(groupView: INextEditorGroupView): void { + private doRemoveEmptyGroup(groupView: IEditorGroupView): void { const groupHasFocus = isAncestor(document.activeElement, groupView.element); // Activate next group if the removed one was active @@ -525,7 +525,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return localize('groupLabel', "Group {0}", index); } - moveGroup(group: INextEditorGroupView | GroupIdentifier, location: INextEditorGroupView | GroupIdentifier, direction: GroupDirection): INextEditorGroupView { + moveGroup(group: IEditorGroupView | GroupIdentifier, location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView { const sourceView = this.assertGroupView(group); const targetView = this.assertGroupView(location); @@ -551,7 +551,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return sourceView; } - copyGroup(group: INextEditorGroupView | GroupIdentifier, location: INextEditorGroupView | GroupIdentifier, direction: GroupDirection): INextEditorGroupView { + copyGroup(group: IEditorGroupView | GroupIdentifier, location: IEditorGroupView | GroupIdentifier, direction: GroupDirection): IEditorGroupView { const groupView = this.assertGroupView(group); const locationView = this.assertGroupView(location); @@ -568,7 +568,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return copiedGroupView; } - mergeGroup(group: INextEditorGroupView | GroupIdentifier, target: INextEditorGroupView | GroupIdentifier, options?: IMergeGroupOptions): INextEditorGroupView { + mergeGroup(group: IEditorGroupView | GroupIdentifier, target: IEditorGroupView | GroupIdentifier, options?: IMergeGroupOptions): IEditorGroupView { const sourceView = this.assertGroupView(group); const targetView = this.assertGroupView(target); @@ -595,7 +595,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN return targetView; } - private assertGroupView(group: INextEditorGroupView | GroupIdentifier): INextEditorGroupView { + private assertGroupView(group: IEditorGroupView | GroupIdentifier): IEditorGroupView { if (typeof group === 'number') { group = this.getGroup(group); } @@ -655,7 +655,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN this.doCreateGridControl(this.container); // Drop support - this._register(this.instantiationService.createInstance(NextEditorDropTarget, this, this.container)); + this._register(this.instantiationService.createInstance(EditorDropTarget, this, this.container)); return this.container; } @@ -722,16 +722,16 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN } } - private doGetPreviousState(): INextEditorPartUIState { + private doGetPreviousState(): IEditorPartUIState { const legacyState = this.doGetPreviousLegacyState(); if (legacyState) { return legacyState; // TODO@ben remove after a while } - return this.memento[NextEditorPart.NEXT_EDITOR_PART_UI_STATE_STORAGE_KEY] as INextEditorPartUIState; + return this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY] as IEditorPartUIState; } - private doGetPreviousLegacyState(): INextEditorPartUIState { + private doGetPreviousLegacyState(): IEditorPartUIState { const LEGACY_EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.uiState'; const LEGACY_STACKS_MODEL_STORAGE_KEY = 'editorStacks.model'; @@ -765,7 +765,7 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN if (legacyUIState && Array.isArray(legacyUIState.groups) && legacyUIState.groups.length > 0) { const splitHorizontally = legacyPartState && legacyPartState.groupOrientation === 'horizontal'; - const legacyState: INextEditorPartUIState = Object.create(null); + const legacyState: IEditorPartUIState = Object.create(null); const positionOneGroup = legacyUIState.groups[0]; const positionTwoGroup = legacyUIState.groups[1]; @@ -878,16 +878,16 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN // Persist grid UI state if (this.gridWidget) { - const uiState: INextEditorPartUIState = { + const uiState: IEditorPartUIState = { serializedGrid: this.gridWidget.serialize(), activeGroup: this._activeGroup.id, mostRecentActiveGroups: this.mostRecentActiveGroups }; if (this.isEmpty()) { - delete this.memento[NextEditorPart.NEXT_EDITOR_PART_UI_STATE_STORAGE_KEY]; + delete this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY]; } else { - this.memento[NextEditorPart.NEXT_EDITOR_PART_UI_STATE_STORAGE_KEY] = uiState; + this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY] = uiState; } } diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index da534b3006b..d8b00110e4f 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -16,7 +16,7 @@ import { getIconClasses } from 'vs/workbench/browser/labels'; import { IModelService } from 'vs/editor/common/services/modelService'; import { QuickOpenHandler } from 'vs/workbench/browser/quickopen'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; -import { INextEditorGroupsService, INextEditorGroup, EditorsOrder, GroupsOrder } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup, EditorsOrder, GroupsOrder } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { EditorInput, toResource } from 'vs/workbench/common/editor'; import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer'; @@ -25,7 +25,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup { constructor( private editor: EditorInput, - private _group: INextEditorGroup, + private _group: IEditorGroup, @IModeService private modeService: IModeService, @IModelService private modelService: IModelService ) { @@ -47,7 +47,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup { return this.editor.isDirty() ? 'dirty' : ''; } - public get group(): INextEditorGroup { + public get group(): IEditorGroup { return this._group; } @@ -129,7 +129,7 @@ export abstract class BaseEditorPicker extends QuickOpenHandler { // Grouping (for more than one group) if (this.editorGroupService.count > 1) { - let lastGroup: INextEditorGroup; + let lastGroup: IEditorGroup; entries.forEach(e => { if (!lastGroup || lastGroup !== e.group) { e.setGroupLabel(e.group.label); @@ -157,7 +157,7 @@ export class ActiveEditorGroupPicker extends BaseEditorPicker { return this.group.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE).map((editor, index) => this.instantiationService.createInstance(EditorPickerEntry, editor, this.group)); } - private get group(): INextEditorGroup { + private get group(): IEditorGroup { return this.editorGroupService.activeGroup; } diff --git a/src/vs/workbench/browser/parts/editor/media/nextEditorDropTarget.css b/src/vs/workbench/browser/parts/editor/media/editordroptarget.css similarity index 100% rename from src/vs/workbench/browser/parts/editor/media/nextEditorDropTarget.css rename to src/vs/workbench/browser/parts/editor/media/editordroptarget.css diff --git a/src/vs/workbench/browser/parts/editor/media/nextEditorGroupView.css b/src/vs/workbench/browser/parts/editor/media/editorgroupview.css similarity index 100% rename from src/vs/workbench/browser/parts/editor/media/nextEditorGroupView.css rename to src/vs/workbench/browser/parts/editor/media/editorgroupview.css diff --git a/src/vs/workbench/browser/parts/editor/media/nextNoTabsTitleControl.css b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css similarity index 100% rename from src/vs/workbench/browser/parts/editor/media/nextNoTabsTitleControl.css rename to src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css diff --git a/src/vs/workbench/browser/parts/editor/media/nextTabsTitleControl.css b/src/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css similarity index 100% rename from src/vs/workbench/browser/parts/editor/media/nextTabsTitleControl.css rename to src/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css diff --git a/src/vs/workbench/browser/parts/editor/media/nextTitleControl.css b/src/vs/workbench/browser/parts/editor/media/titlecontrol.css similarity index 100% rename from src/vs/workbench/browser/parts/editor/media/nextTitleControl.css rename to src/vs/workbench/browser/parts/editor/media/titlecontrol.css diff --git a/src/vs/workbench/browser/parts/editor/nextNoTabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts similarity index 94% rename from src/vs/workbench/browser/parts/editor/nextNoTabsTitleControl.ts rename to src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts index e593134552b..38c9efc0df6 100644 --- a/src/vs/workbench/browser/parts/editor/nextNoTabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts @@ -5,16 +5,16 @@ 'use strict'; -import 'vs/css!./media/nextNoTabsTitleControl'; +import 'vs/css!./media/notabstitlecontrol'; import { toResource, Verbosity, IEditorInput } from 'vs/workbench/common/editor'; -import { NextTitleControl } from 'vs/workbench/browser/parts/editor/nextTitleControl'; +import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl'; import { ResourceLabel } from 'vs/workbench/browser/labels'; import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; import { EventType as TouchEventType, GestureEvent, Gesture } from 'vs/base/browser/touch'; import { addDisposableListener, EventType, addClass, EventHelper, removeClass } from 'vs/base/browser/dom'; -import { INextEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; +import { IEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; -export class NextNoTabsTitleControl extends NextTitleControl { +export class NoTabsTitleControl extends TitleControl { private titleContainer: HTMLElement; private editorLabel: ResourceLabel; private lastRenderedEditor: IEditorInput; @@ -124,7 +124,7 @@ export class NextNoTabsTitleControl extends NextTitleControl { }); } - updateOptions(oldOptions: INextEditorPartOptions, newOptions: INextEditorPartOptions): void { + updateOptions(oldOptions: IEditorPartOptions, newOptions: IEditorPartOptions): void { if (oldOptions.labelFormat !== newOptions.labelFormat) { this.redraw(); } diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts index 8e3101531e3..d60fe823a4b 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts @@ -15,7 +15,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; export class SideBySideEditor extends BaseEditor { @@ -56,7 +56,7 @@ export class SideBySideEditor extends BaseEditor { } } - protected setEditorVisible(visible: boolean, group: INextEditorGroup): void { + protected setEditorVisible(visible: boolean, group: IEditorGroup): void { if (this.masterEditor) { this.masterEditor.setVisible(visible, group); } diff --git a/src/vs/workbench/browser/parts/editor/nextTabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts similarity index 98% rename from src/vs/workbench/browser/parts/editor/nextTabsTitleControl.ts rename to src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 3b5b71b2e74..6c7fcb23ae2 100644 --- a/src/vs/workbench/browser/parts/editor/nextTabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -5,7 +5,7 @@ 'use strict'; -import 'vs/css!./media/nextTabsTitleControl'; +import 'vs/css!./media/tabstitlecontrol'; import { TPromise } from 'vs/base/common/winjs.base'; import { isMacintosh } from 'vs/base/common/platform'; import { shorten } from 'vs/base/common/labels'; @@ -22,7 +22,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IMenuService } from 'vs/platform/actions/common/actions'; -import { NextTitleControl } from 'vs/workbench/browser/parts/editor/nextTitleControl'; +import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IDisposable, dispose, combinedDisposable } from 'vs/base/common/lifecycle'; import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; @@ -35,11 +35,11 @@ import { ResourcesDropHandler, fillResourceDataTransfers, DraggedEditorIdentifie import { Color } from 'vs/base/common/color'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { addClass, addDisposableListener, hasClass, EventType, EventHelper, removeClass, Dimension, scheduleAtNextAnimationFrame, findParentWithClass, clearNode } from 'vs/base/browser/dom'; import { localize } from 'vs/nls'; -import { INextEditorGroupsAccessor, INextEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; +import { IEditorGroupsAccessor, IEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; interface IEditorInputLabel { name: string; @@ -49,7 +49,7 @@ interface IEditorInputLabel { type AugmentedLabel = IEditorInputLabel & { editor: IEditorInput }; -export class NextTabsTitleControl extends NextTitleControl { +export class TabsTitleControl extends TitleControl { private titleContainer: HTMLElement; private tabsContainer: HTMLElement; @@ -66,8 +66,8 @@ export class NextTabsTitleControl extends NextTitleControl { constructor( parent: HTMLElement, - accessor: INextEditorGroupsAccessor, - group: INextEditorGroup, + accessor: IEditorGroupsAccessor, + group: IEditorGroup, @IContextMenuService contextMenuService: IContextMenuService, @IInstantiationService instantiationService: IInstantiationService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @@ -335,7 +335,7 @@ export class NextTabsTitleControl extends NextTitleControl { this.withTab(editor, tabContainer => this.redrawEditorDirty(editor, tabContainer)); } - updateOptions(oldOptions: INextEditorPartOptions, newOptions: INextEditorPartOptions): void { + updateOptions(oldOptions: IEditorPartOptions, newOptions: IEditorPartOptions): void { // A change to a label format options requires to recompute all labels if (oldOptions.labelFormat !== newOptions.labelFormat) { diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 1946ac227c4..7696d121c1d 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -37,7 +37,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import URI from 'vs/base/common/uri'; import { once } from 'vs/base/common/event'; import { DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/browser/nextEditorService'; -import { INextEditorGroup, INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup, INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; import { CancellationToken } from 'vs/base/common/cancellation'; @@ -93,7 +93,7 @@ export class TextDiffEditor extends BaseTextEditor { // Support navigation within the diff editor by overriding the editor service within const delegatingEditorService = this.instantiationService.createInstance(DelegatingWorkbenchEditorService); - delegatingEditorService.setEditorOpenHandler((group: INextEditorGroup, input: EditorInput, options?: EditorOptions) => { + delegatingEditorService.setEditorOpenHandler((group: IEditorGroup, input: EditorInput, options?: EditorOptions) => { // Check if target group is same as this editor ones if (group === this.group) { diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 6fae2041eb3..4089abd5310 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -24,7 +24,7 @@ import { ITextFileService, SaveReason, AutoSaveMode } from 'vs/workbench/service import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { isDiffEditor, isCodeEditor, ICodeEditor, getCodeEditor } from 'vs/editor/browser/editorBrowser'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; @@ -197,7 +197,7 @@ export abstract class BaseTextEditor extends BaseEditor { }); } - protected setEditorVisible(visible: boolean, group: INextEditorGroup): void { + protected setEditorVisible(visible: boolean, group: IEditorGroup): void { // Pass on to Editor if (visible) { diff --git a/src/vs/workbench/browser/parts/editor/nextTitleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts similarity index 96% rename from src/vs/workbench/browser/parts/editor/nextTitleControl.ts rename to src/vs/workbench/browser/parts/editor/titleControl.ts index 9a58164e126..3a562d2505c 100644 --- a/src/vs/workbench/browser/parts/editor/nextTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -5,7 +5,7 @@ 'use strict'; -import 'vs/css!./media/nextTitleControl'; +import 'vs/css!./media/titlecontrol'; import { localize } from 'vs/nls'; import { prepareActions } from 'vs/workbench/browser/actions'; import { IAction, Action, IRunEvent } from 'vs/base/common/actions'; @@ -34,8 +34,8 @@ import { getCodeEditor } from 'vs/editor/browser/editorBrowser'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { Dimension, addDisposableListener, EventType } from 'vs/base/browser/dom'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; -import { INextEditorGroupsAccessor, INextEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroupsAccessor, IEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; import { listActiveSelectionBackground, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; import { LocalSelectionTransfer, DraggedEditorGroupIdentifier, DraggedEditorIdentifier, fillResourceDataTransfers } from 'vs/workbench/browser/dnd'; import { applyDragImage } from 'vs/base/browser/dnd'; @@ -45,7 +45,7 @@ export interface IToolbarActions { secondary: IAction[]; } -export abstract class NextTitleControl extends Themable { +export abstract class TitleControl extends Themable { protected closeOneEditorAction: CloseOneEditorAction; @@ -68,8 +68,8 @@ export abstract class NextTitleControl extends Themable { constructor( parent: HTMLElement, - protected accessor: INextEditorGroupsAccessor, - protected group: INextEditorGroup, + protected accessor: IEditorGroupsAccessor, + protected group: IEditorGroup, @IContextMenuService private contextMenuService: IContextMenuService, @IInstantiationService protected instantiationService: IInstantiationService, @IContextKeyService private contextKeyService: IContextKeyService, @@ -310,7 +310,7 @@ export abstract class NextTitleControl extends Themable { return keybinding ? keybinding.getLabel() : void 0; } - //#region INextTitleAreaControl + //#region ITitleAreaControl abstract openEditor(editor: IEditorInput): void; @@ -330,7 +330,7 @@ export abstract class NextTitleControl extends Themable { abstract updateEditorDirty(editor: IEditorInput): void; - abstract updateOptions(oldOptions: INextEditorPartOptions, newOptions: INextEditorPartOptions): void; + abstract updateOptions(oldOptions: IEditorPartOptions, newOptions: IEditorPartOptions): void; abstract updateStyles(): void; diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index df1c274e65f..01ed3bbdb58 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -18,7 +18,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { ITextModel } from 'vs/editor/common/model'; import { Schemas } from 'vs/base/common/network'; import { LRUCache } from 'vs/base/common/map'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { ICompositeControl } from 'vs/workbench/common/composite'; export const EditorsVisibleContext = new RawContextKey('editorIsOpen', false); @@ -54,7 +54,7 @@ export interface IEditor { /** * The assigned group this editor is showing in. */ - group: INextEditorGroup; + group: IEditorGroup; /** * Returns the unique identifier of this editor. @@ -999,9 +999,9 @@ export class EditorViewStateMemento { private limit: number = 10 ) { } - public saveState(group: INextEditorGroup, resource: URI, state: T): void; - public saveState(group: INextEditorGroup, editor: EditorInput, state: T): void; - public saveState(group: INextEditorGroup, resourceOrEditor: URI | EditorInput, state: T): void { + public saveState(group: IEditorGroup, resource: URI, state: T): void; + public saveState(group: IEditorGroup, editor: EditorInput, state: T): void; + public saveState(group: IEditorGroup, resourceOrEditor: URI | EditorInput, state: T): void { const resource = this.doGetResource(resourceOrEditor); if (!resource || !group) { return; // we are not in a good state to save any viewstate for a resource @@ -1025,9 +1025,9 @@ export class EditorViewStateMemento { } } - public loadState(group: INextEditorGroup, resource: URI): T; - public loadState(group: INextEditorGroup, editor: EditorInput): T; - public loadState(group: INextEditorGroup, resourceOrEditor: URI | EditorInput): T { + public loadState(group: IEditorGroup, resource: URI): T; + public loadState(group: IEditorGroup, editor: EditorInput): T; + public loadState(group: IEditorGroup, resourceOrEditor: URI | EditorInput): T { const resource = this.doGetResource(resourceOrEditor); if (resource) { const cache = this.doLoad(); @@ -1146,10 +1146,10 @@ export const Extensions = { Registry.add(Extensions.EditorInputFactories, new EditorInputFactoryRegistry()); -//#region obsolete +//#region TODO@grid obsolete export interface IStacksModelChangeEvent { - group: IEditorGroup; + group: ILegacyEditorGroup; editor?: IEditorInput; structural?: boolean; } @@ -1161,14 +1161,14 @@ export interface IEditorStacksModel { onWillCloseEditor: Event; onEditorClosed: Event; - groups: IEditorGroup[]; - activeGroup: IEditorGroup; - isActive(group: IEditorGroup): boolean; + groups: ILegacyEditorGroup[]; + activeGroup: ILegacyEditorGroup; + isActive(group: ILegacyEditorGroup): boolean; - getGroup(id: GroupIdentifier): IEditorGroup; + getGroup(id: GroupIdentifier): ILegacyEditorGroup; - positionOfGroup(group: IEditorGroup): Position; - groupAt(position: Position): IEditorGroup; + positionOfGroup(group: ILegacyEditorGroup): Position; + groupAt(position: Position): ILegacyEditorGroup; next(jumpGroups: boolean, cycleAtEnd?: boolean): IEditorIdentifier; previous(jumpGroups: boolean, cycleAtStart?: boolean): IEditorIdentifier; @@ -1179,7 +1179,7 @@ export interface IEditorStacksModel { toString(): string; } -export interface IEditorGroup { +export interface ILegacyEditorGroup { id: GroupIdentifier; count: number; activeEditor: IEditorInput; diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index cfd86ab4825..239ecd2f2e1 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -6,7 +6,7 @@ 'use strict'; import { Event, Emitter, once } from 'vs/base/common/event'; -import { Extensions, IEditorInputFactoryRegistry, EditorInput, toResource, IEditorGroup, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, SideBySideEditorInput, CloseDirection } from 'vs/workbench/common/editor'; +import { Extensions, IEditorInputFactoryRegistry, EditorInput, toResource, ILegacyEditorGroup, IEditorIdentifier, IEditorCloseEvent, GroupIdentifier, SideBySideEditorInput, CloseDirection } from 'vs/workbench/common/editor'; import URI from 'vs/base/common/uri'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; @@ -54,7 +54,7 @@ export function isSerializedEditorGroup(obj?: any): obj is ISerializedEditorGrou return obj && typeof obj === 'object' && Array.isArray(group.editors) && Array.isArray(group.mru); } -export class EditorGroup extends Disposable implements IEditorGroup { +export class EditorGroup extends Disposable implements ILegacyEditorGroup { private static IDS = 0; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index e32aff2d5ce..1c5fe096d37 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -30,6 +30,7 @@ import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart'; import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart'; import { StatusbarPart } from 'vs/workbench/browser/parts/statusbar/statusbarPart'; import { TitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'; +import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; import { WorkbenchLayout } from 'vs/workbench/browser/layout'; import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; @@ -109,7 +110,6 @@ import { registerWindowDriver } from 'vs/platform/driver/electron-browser/driver import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { PreferencesService } from 'vs/workbench/services/preferences/browser/preferencesService'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; -import { NextEditorPart } from 'vs/workbench/browser/parts/editor/nextEditorPart'; import { INextEditorGroupsService, GroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { NextEditorService } from 'vs/workbench/services/editor/browser/nextEditorService'; import { IExtensionUrlHandler, ExtensionUrlHandler } from 'vs/platform/url/electron-browser/inactiveExtensionUrlHandler'; @@ -205,7 +205,7 @@ export class Workbench extends Disposable implements IPartService { private activitybarPart: ActivitybarPart; private sidebarPart: SidebarPart; private panelPart: PanelPart; - private editorPart: NextEditorPart; + private editorPart: EditorPart; private statusbarPart: StatusbarPart; private quickOpen: QuickOpenController; private notificationsCenter: NotificationsCenter; @@ -380,7 +380,7 @@ export class Workbench extends Disposable implements IPartService { // Editor and Group services const restorePreviousEditorState = !this.hasInitialFilesToOpen; - this.editorPart = this.instantiationService.createInstance(NextEditorPart, Identifiers.EDITOR_PART, restorePreviousEditorState); + this.editorPart = this.instantiationService.createInstance(EditorPart, Identifiers.EDITOR_PART, restorePreviousEditorState); this._register(toDisposable(() => this.editorPart.shutdown())); this.editorGroupService = this.editorPart; serviceCollection.set(INextEditorGroupsService, this.editorPart); diff --git a/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts b/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts index 1010c916c0d..a6593d8ab21 100644 --- a/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts +++ b/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts @@ -28,7 +28,7 @@ import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEd import { IWindowService } from 'vs/platform/windows/common/windows'; import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; export class FileEditorTracker implements IWorkbenchContribution { @@ -265,7 +265,7 @@ export class FileEditorTracker implements IWorkbenchContribution { return path.indexOf(candidate); } - private getViewStateFor(resource: URI, group: INextEditorGroup): IEditorViewState | undefined { + private getViewStateFor(resource: URI, group: IEditorGroup): IEditorViewState | undefined { const editors = this.editorService.visibleControls; for (let i = 0; i < editors.length; i++) { diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index 05c7fb06a24..43704d9d117 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -30,7 +30,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ScrollType } from 'vs/editor/common/editorCommon'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { CancellationToken } from 'vs/base/common/cancellation'; /** @@ -76,7 +76,7 @@ export class TextFileEditor extends BaseTextEditor { return this._input as FileEditorInput; } - setEditorVisible(visible: boolean, group: INextEditorGroup): void { + setEditorVisible(visible: boolean, group: IEditorGroup): void { super.setEditorVisible(visible, group); // React to editors closing to preserve view state. This needs to happen diff --git a/src/vs/workbench/parts/files/common/explorerModel.ts b/src/vs/workbench/parts/files/common/explorerModel.ts index 015b408ef38..f2c6923f7a7 100644 --- a/src/vs/workbench/parts/files/common/explorerModel.ts +++ b/src/vs/workbench/parts/files/common/explorerModel.ts @@ -17,7 +17,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { getPathLabel } from 'vs/base/common/labels'; import { Schemas } from 'vs/base/common/network'; import { startsWith, startsWithIgnoreCase, rtrim } from 'vs/base/common/strings'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; export class Model { @@ -452,7 +452,7 @@ export class NewStatPlaceholder extends ExplorerItem { export class OpenEditor implements IEditorIdentifier { - constructor(private _editor: IEditorInput, private _group: INextEditorGroup) { + constructor(private _editor: IEditorInput, private _group: IEditorGroup) { // noop } diff --git a/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts b/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts index d6989a13538..2d390929e8c 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts @@ -32,7 +32,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/browser/nextEditorService'; -import { INextEditorGroup, INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup, INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; import { IEditorOptions } from 'vs/platform/editor/common/editor'; import { IEditorInput } from 'vs/workbench/common/editor'; @@ -190,7 +190,7 @@ export class ExplorerViewlet extends PersistentViewsViewlet implements IExplorer // We try to be smart and only use the delay if we recognize that the user action is likely to cause // a new entry in the opened editors view. const delegatingEditorService = this.instantiationService.createInstance(DelegatingWorkbenchEditorService); - delegatingEditorService.setEditorOpenHandler((group: INextEditorGroup, editor: IEditorInput, options?: IEditorOptions) => { + delegatingEditorService.setEditorOpenHandler((group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions) => { let openEditorsView = this.getOpenEditorsView(); if (openEditorsView) { let delay = 0; diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index 8f97ed9e753..9e5d9ff4858 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -10,7 +10,7 @@ import { IAction } from 'vs/base/common/actions'; import * as dom from 'vs/base/browser/dom'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { INextEditorGroupsService, INextEditorGroup, GroupChangeKind } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup, GroupChangeKind } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorInput } from 'vs/workbench/common/editor'; @@ -51,7 +51,7 @@ export class OpenEditorsView extends ViewsViewletPanel { private dirtyCountElement: HTMLElement; private listRefreshScheduler: RunOnceScheduler; private structuralRefreshDelay: number; - private list: WorkbenchList; + private list: WorkbenchList; private contributedContextMenu: IMenu; private needsRefresh: boolean; private resourceContext: ResourceContextKey; @@ -113,7 +113,7 @@ export class OpenEditorsView extends ViewsViewletPanel { }; const groupDisposables = new Map(); - const addGroupListener = (group: INextEditorGroup) => { + const addGroupListener = (group: IEditorGroup) => { groupDisposables.set(group.id, group.onDidGroupChange(e => { if (this.listRefreshScheduler.isScheduled()) { return; @@ -214,9 +214,9 @@ export class OpenEditorsView extends ViewsViewletPanel { new EditorGroupRenderer(this.keybindingService, this.instantiationService, this.editorGroupService), new OpenEditorRenderer(getSelectedElements, this.instantiationService, this.keybindingService, this.configurationService, this.editorGroupService) ], { - identityProvider: (element: OpenEditor | INextEditorGroup) => element instanceof OpenEditor ? element.getId() : element.id.toString(), + identityProvider: (element: OpenEditor | IEditorGroup) => element instanceof OpenEditor ? element.getId() : element.id.toString(), selectOnMouseDown: false /* disabled to better support DND */ - }) as WorkbenchList; + }) as WorkbenchList; this.contributedContextMenu = this.menuService.createMenu(MenuId.OpenEditorsContext, this.list.contextKeyService); this.disposables.push(this.contributedContextMenu); @@ -302,7 +302,7 @@ export class OpenEditorsView extends ViewsViewletPanel { this.list.domFocus(); } - public getList(): WorkbenchList { + public getList(): WorkbenchList { return this.list; } @@ -316,8 +316,8 @@ export class OpenEditorsView extends ViewsViewletPanel { return this.editorGroupService.groups.length > 1; } - private get elements(): (INextEditorGroup | OpenEditor)[] { - const result: (INextEditorGroup | OpenEditor)[] = []; + private get elements(): (IEditorGroup | OpenEditor)[] { + const result: (IEditorGroup | OpenEditor)[] = []; this.editorGroupService.groups.forEach(g => { if (this.showGroups) { result.push(g); @@ -328,7 +328,7 @@ export class OpenEditorsView extends ViewsViewletPanel { return result; } - private getIndex(group: INextEditorGroup, editor: IEditorInput): number { + private getIndex(group: IEditorGroup, editor: IEditorInput): number { let index = editor ? group.getIndexOfEditor(editor) : 0; if (!this.showGroups) { return index; @@ -367,7 +367,7 @@ export class OpenEditorsView extends ViewsViewletPanel { } } - private onListContextMenu(e: IListContextMenuEvent): void { + private onListContextMenu(e: IListContextMenuEvent): void { const element = e.element; this.contextMenuService.showContextMenu({ getAnchor: () => e.anchor, @@ -464,19 +464,19 @@ interface IEditorGroupTemplateData { root: HTMLElement; name: HTMLSpanElement; actionBar: ActionBar; - editorGroup: INextEditorGroup; + editorGroup: IEditorGroup; toDispose: IDisposable[]; } -class OpenEditorsDelegate implements IDelegate { +class OpenEditorsDelegate implements IDelegate { public static readonly ITEM_HEIGHT = 22; - getHeight(element: OpenEditor | INextEditorGroup): number { + getHeight(element: OpenEditor | IEditorGroup): number { return OpenEditorsDelegate.ITEM_HEIGHT; } - getTemplateId(element: OpenEditor | INextEditorGroup): string { + getTemplateId(element: OpenEditor | IEditorGroup): string { if (element instanceof OpenEditor) { return OpenEditorRenderer.ID; } @@ -485,7 +485,7 @@ class OpenEditorsDelegate implements IDelegate { } } -class EditorGroupRenderer implements IRenderer { +class EditorGroupRenderer implements IRenderer { static readonly ID = 'editorgroup'; private transfer = LocalSelectionTransfer.getInstance(); @@ -536,7 +536,7 @@ class EditorGroupRenderer implements IRenderer(); constructor( - private getSelectedElements: () => (OpenEditor | INextEditorGroup)[], + private getSelectedElements: () => (OpenEditor | IEditorGroup)[], private instantiationService: IInstantiationService, private keybindingService: IKeybindingService, private configurationService: IConfigurationService, diff --git a/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts b/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts index 192cefdc578..43669742839 100644 --- a/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts +++ b/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts @@ -24,7 +24,7 @@ import { Dimension } from 'vs/base/browser/dom'; import { BaseWebviewEditor } from 'vs/workbench/parts/webview/electron-browser/baseWebviewEditor'; import { WebviewElement, WebviewOptions } from 'vs/workbench/parts/webview/electron-browser/webviewElement'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { CancellationToken } from 'vs/base/common/cancellation'; export interface HtmlPreviewEditorViewState { @@ -123,7 +123,7 @@ export class HtmlPreviewPart extends BaseWebviewEditor { return this._webview; } - protected setEditorVisible(visible: boolean, group: INextEditorGroup): void { + protected setEditorVisible(visible: boolean, group: IEditorGroup): void { this._doSetVisible(visible); super.setEditorVisible(visible, group); } diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 1f948141650..5f2618f5285 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -59,7 +59,7 @@ import { IProgressService } from 'vs/platform/progress/common/progress'; import { ILogService } from 'vs/platform/log/common/log'; import { PreferencesEditorInput, DefaultPreferencesEditorInput } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; import { PREFERENCES_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { CancellationToken } from 'vs/base/common/cancellation'; import { INextEditorService } from 'vs/workbench/services/editor/common/nextEditorService'; @@ -192,7 +192,7 @@ export class PreferencesEditor extends BaseEditor { return false; } - protected setEditorVisible(visible: boolean, group: INextEditorGroup): void { + protected setEditorVisible(visible: boolean, group: IEditorGroup): void { this.sideBySidePreferencesWidget.setEditorVisible(visible, group); super.setEditorVisible(visible, group); } @@ -861,7 +861,7 @@ class SideBySidePreferencesWidget extends Widget { } } - public setEditorVisible(visible: boolean, group: INextEditorGroup): void { + public setEditorVisible(visible: boolean, group: IEditorGroup): void { if (this.defaultPreferencesEditor) { this.defaultPreferencesEditor.setVisible(visible, group); } diff --git a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts index 123e2bd4069..5b6c7b6bb16 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesContribution.ts @@ -17,7 +17,7 @@ import { IPreferencesService, FOLDER_SETTINGS_PATH, DEFAULT_SETTINGS_EDITOR_SETT import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { INextEditorService, IOpenEditorOverride } from 'vs/workbench/services/editor/common/nextEditorService'; import { IEditorOptions, ITextEditorOptions } from 'vs/platform/editor/common/editor'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { endsWith } from 'vs/base/common/strings'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IEditorInput } from 'vs/workbench/common/editor'; @@ -61,7 +61,7 @@ export class PreferencesContribution implements IWorkbenchContribution { } } - private onEditorOpening(editor: IEditorInput, options: IEditorOptions | ITextEditorOptions, group: INextEditorGroup): IOpenEditorOverride { + private onEditorOpening(editor: IEditorInput, options: IEditorOptions | ITextEditorOptions, group: IEditorGroup): IOpenEditorOverride { const resource = editor.getResource(); if ( !resource || resource.scheme !== 'file' || // require a file path opening diff --git a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts index 2724d584a77..907bd914641 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts @@ -21,7 +21,7 @@ import { themeColorFromId } from 'vs/platform/theme/common/themeService'; import { IEditorOptions, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions'; import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService'; import { isCodeEditor, isDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; export const GOTO_LINE_PREFIX = ':'; @@ -239,7 +239,7 @@ export class GotoLineHandler extends QuickOpenHandler { return canRun ? true : nls.localize('cannotRunGotoLine', "Open a text file first to go to a line"); } - public decorateOutline(range: IRange, editor: IEditor, group: INextEditorGroup): void { + public decorateOutline(range: IRange, editor: IEditor, group: IEditorGroup): void { editor.changeDecorations(changeAccessor => { const deleteDecorations: string[] = []; diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts index ff1e9a1fbec..870b2c03a3a 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts @@ -25,7 +25,7 @@ import { themeColorFromId } from 'vs/platform/theme/common/themeService'; import { overviewRulerRangeHighlight } from 'vs/editor/common/view/editorColorRegistry'; import { GroupIdentifier, IEditorInput } from 'vs/workbench/common/editor'; import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; export const GOTO_SYMBOL_PREFIX = '@'; export const SCOPE_PREFIX = ':'; @@ -507,7 +507,7 @@ export class GotoSymbolHandler extends QuickOpenHandler { return TPromise.wrap(null); } - public decorateOutline(fullRange: IRange, startRange: IRange, editor: IEditor, group: INextEditorGroup): void { + public decorateOutline(fullRange: IRange, startRange: IRange, editor: IEditor, group: IEditorGroup): void { editor.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => { const deleteDecorations: string[] = []; diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts b/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts index 42d9a5716dc..1d8caf02ed3 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts @@ -13,7 +13,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { EditorOptions } from 'vs/workbench/common/editor'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { WebviewEditorInput } from 'vs/workbench/parts/webview/electron-browser/webviewEditorInput'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -100,7 +100,7 @@ export class WebviewEditor extends BaseWebviewEditor { return this._onDidFocusWebview.event; } - protected setEditorVisible(visible: boolean, group: INextEditorGroup): void { + protected setEditorVisible(visible: boolean, group: IEditorGroup): void { if (this.input && this.input instanceof WebviewEditorInput) { if (visible) { this.input.claimWebview(this); diff --git a/src/vs/workbench/services/editor/browser/nextEditorService.ts b/src/vs/workbench/services/editor/browser/nextEditorService.ts index eaf7320246c..7d274125f72 100644 --- a/src/vs/workbench/services/editor/browser/nextEditorService.ts +++ b/src/vs/workbench/services/editor/browser/nextEditorService.ts @@ -24,7 +24,7 @@ import { basename } from 'vs/base/common/paths'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { localize } from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; -import { INextEditorGroupsService, INextEditorGroup, GroupsOrder, IEditorReplacement, GroupChangeKind, preferredGroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup, GroupsOrder, IEditorReplacement, GroupChangeKind, preferredGroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { INextEditorService, IResourceEditor, ACTIVE_GROUP_TYPE, SIDE_GROUP_TYPE, SIDE_GROUP, ACTIVE_GROUP, IResourceEditorReplacement, IOpenEditorOverrideHandler } from 'vs/workbench/services/editor/common/nextEditorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Disposable, IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; @@ -82,7 +82,7 @@ export class NextEditorService extends Disposable implements INextEditorService this.editorGroupService.onDidAddGroup(group => this.registerGroupListeners(group)); } - private handleActiveEditorChange(group: INextEditorGroup): void { + private handleActiveEditorChange(group: IEditorGroup): void { if (group !== this.editorGroupService.activeGroup) { return; // ignore if not the active group } @@ -96,7 +96,7 @@ export class NextEditorService extends Disposable implements INextEditorService this._onDidActiveEditorChange.fire(); } - private registerGroupListeners(group: INextEditorGroup): void { + private registerGroupListeners(group: IEditorGroup): void { const groupDisposeables: IDisposable[] = []; groupDisposeables.push(group.onDidGroupChange(e => { @@ -123,7 +123,7 @@ export class NextEditorService extends Disposable implements INextEditorService }); } - private onGroupWillOpenEditor(group: INextEditorGroup, event: IEditorOpeningEvent): void { + private onGroupWillOpenEditor(group: IEditorGroup, event: IEditorOpeningEvent): void { for (let i = 0; i < this.openEditorHandlers.length; i++) { const handler = this.openEditorHandlers[i]; const result = handler(event.editor, event.options, group); @@ -217,9 +217,9 @@ export class NextEditorService extends Disposable implements INextEditorService //#region openEditor() - openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; - openEditor(editor: IResourceEditor, group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; - openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | ITextEditorOptions | INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE, group?: GroupIdentifier): TPromise { + openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; + openEditor(editor: IResourceEditor, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; + openEditor(editor: IEditorInput | IResourceEditor, optionsOrGroup?: IEditorOptions | ITextEditorOptions | IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE, group?: GroupIdentifier): TPromise { // Typed Editor Support if (editor instanceof EditorInput) { @@ -243,7 +243,7 @@ export class NextEditorService extends Disposable implements INextEditorService const typedInput = this.createInput(textInput); if (typedInput) { const editorOptions = TextEditorOptions.from(textInput); - const targetGroup = this.findTargetGroup(typedInput, editorOptions, optionsOrGroup as INextEditorGroup | GroupIdentifier); + const targetGroup = this.findTargetGroup(typedInput, editorOptions, optionsOrGroup as IEditorGroup | GroupIdentifier); return this.doOpenEditor(targetGroup, typedInput, editorOptions); } @@ -251,12 +251,12 @@ export class NextEditorService extends Disposable implements INextEditorService return TPromise.wrap(null); } - protected doOpenEditor(group: INextEditorGroup, editor: IEditorInput, options?: IEditorOptions): TPromise { + protected doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): TPromise { return group.openEditor(editor, options).then(() => group.activeControl); } - private findTargetGroup(input: IEditorInput, options?: IEditorOptions, group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): INextEditorGroup { - let targetGroup: INextEditorGroup; + private findTargetGroup(input: IEditorInput, options?: IEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): IEditorGroup { + let targetGroup: IEditorGroup; // Group: Instance of Group if (group && typeof group !== 'number') { @@ -313,7 +313,7 @@ export class NextEditorService extends Disposable implements INextEditorService return targetGroup; } - private findSideBySideGroup(): INextEditorGroup { + private findSideBySideGroup(): IEditorGroup { const direction = preferredGroupDirection(this.configurationService); let neighbourGroup = this.editorGroupService.findGroup({ direction }); @@ -341,9 +341,9 @@ export class NextEditorService extends Disposable implements INextEditorService //#region openEditors() - openEditors(editors: IEditorInputWithOptions[], group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; - openEditors(editors: IResourceEditor[], group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; - openEditors(editors: (IEditorInputWithOptions | IResourceEditor)[], group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise { + openEditors(editors: IEditorInputWithOptions[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; + openEditors(editors: IResourceEditor[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; + openEditors(editors: (IEditorInputWithOptions | IResourceEditor)[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise { // Convert to typed editors and options const typedEditors: IEditorInputWithOptions[] = []; @@ -356,7 +356,7 @@ export class NextEditorService extends Disposable implements INextEditorService }); // Find target groups to open - const mapGroupToEditors = new Map(); + const mapGroupToEditors = new Map(); if (group === SIDE_GROUP) { mapGroupToEditors.set(this.findSideBySideGroup(), typedEditors); } else { @@ -386,8 +386,8 @@ export class NextEditorService extends Disposable implements INextEditorService //#region isOpen() - isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput, group?: INextEditorGroup | GroupIdentifier): boolean { - let groups: INextEditorGroup[] = []; + isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): boolean { + let groups: IEditorGroup[] = []; if (typeof group === 'number') { groups.push(this.editorGroupService.getGroup(group)); } else if (group) { @@ -418,9 +418,9 @@ export class NextEditorService extends Disposable implements INextEditorService //#region replaceEditors() - replaceEditors(editors: IResourceEditorReplacement[], group: INextEditorGroup | GroupIdentifier): TPromise; - replaceEditors(editors: IEditorReplacement[], group: INextEditorGroup | GroupIdentifier): TPromise; - replaceEditors(editors: (IEditorReplacement | IResourceEditorReplacement)[], group: INextEditorGroup | GroupIdentifier): TPromise { + replaceEditors(editors: IResourceEditorReplacement[], group: IEditorGroup | GroupIdentifier): TPromise; + replaceEditors(editors: IEditorReplacement[], group: IEditorGroup | GroupIdentifier): TPromise; + replaceEditors(editors: (IEditorReplacement | IResourceEditorReplacement)[], group: IEditorGroup | GroupIdentifier): TPromise { const typedEditors: IEditorReplacement[] = []; editors.forEach(replaceEditorArg => { @@ -581,7 +581,7 @@ export class NextEditorService extends Disposable implements INextEditorService } export interface IEditorOpenHandler { - (group: INextEditorGroup, editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions): TPromise; + (group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions): TPromise; } /** @@ -615,7 +615,7 @@ export class DelegatingWorkbenchEditorService extends NextEditorService { this.editorOpenHandler = handler; } - protected doOpenEditor(group: INextEditorGroup, editor: IEditorInput, options?: IEditorOptions): TPromise { + protected doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): TPromise { const handleOpen = this.editorOpenHandler ? this.editorOpenHandler(group, editor, options) : TPromise.as(void 0); return handleOpen.then(control => { diff --git a/src/vs/workbench/services/editor/common/editorService.ts b/src/vs/workbench/services/editor/common/editorService.ts index ec801c75878..5b68ffdb96a 100644 --- a/src/vs/workbench/services/editor/common/editorService.ts +++ b/src/vs/workbench/services/editor/common/editorService.ts @@ -11,7 +11,7 @@ import { IEditorOptions, ITextEditorOptions, Position, IResourceInput } from 'vs import URI from 'vs/base/common/uri'; import { Registry } from 'vs/platform/registry/common/platform'; import { basename } from 'vs/base/common/paths'; -import { EditorInput, EditorOptions, TextEditorOptions, Extensions as EditorExtensions, IResourceDiffInput, IResourceSideBySideInput, IUntitledResourceInput, SideBySideEditorInput, IFileEditorInput, IFileInputFactory, IEditorInputFactoryRegistry, IEditorStacksModel, IEditorOpeningEvent, IEditorGroup, IStacksModelChangeEvent, IEditorCloseEvent, IEditorIdentifier, CloseDirection, IEditor, IEditorInput } from 'vs/workbench/common/editor'; +import { EditorInput, EditorOptions, TextEditorOptions, Extensions as EditorExtensions, IResourceDiffInput, IResourceSideBySideInput, IUntitledResourceInput, SideBySideEditorInput, IFileEditorInput, IFileInputFactory, IEditorInputFactoryRegistry, IEditorStacksModel, IEditorOpeningEvent, ILegacyEditorGroup, IStacksModelChangeEvent, IEditorCloseEvent, IEditorIdentifier, CloseDirection, IEditor, IEditorInput } from 'vs/workbench/common/editor'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; @@ -236,22 +236,22 @@ export class NoOpEditorStacksModel implements IEditorStacksModel { onWillCloseEditor: Event = new Emitter().event; onEditorClosed: Event = new Emitter().event; - groups: IEditorGroup[] = []; - activeGroup: IEditorGroup; + groups: ILegacyEditorGroup[] = []; + activeGroup: ILegacyEditorGroup; - isActive(group: IEditorGroup): boolean { + isActive(group: ILegacyEditorGroup): boolean { return false; } - getGroup(id: number): IEditorGroup { + getGroup(id: number): ILegacyEditorGroup { return null; } - positionOfGroup(group: IEditorGroup): Position { + positionOfGroup(group: ILegacyEditorGroup): Position { return Position.ONE; } - groupAt(position: Position): IEditorGroup { + groupAt(position: Position): ILegacyEditorGroup { return null; } diff --git a/src/vs/workbench/services/editor/common/nextEditorService.ts b/src/vs/workbench/services/editor/common/nextEditorService.ts index 100cb48d140..477ece960cb 100644 --- a/src/vs/workbench/services/editor/common/nextEditorService.ts +++ b/src/vs/workbench/services/editor/common/nextEditorService.ts @@ -10,7 +10,7 @@ import { IResourceInput, IEditorOptions, ITextEditorOptions } from 'vs/platform/ import { IEditorInput, IEditor, GroupIdentifier, IEditorInputWithOptions, IEditorIdentifier, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorCloseEvent } from 'vs/workbench/common/editor'; import { Event } from 'vs/base/common/event'; import { IEditor as ITextEditor } from 'vs/editor/common/editorCommon'; -import { INextEditorGroup, IEditorReplacement } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup, IEditorReplacement } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable } from 'vs/base/common/lifecycle'; @@ -30,7 +30,7 @@ export const SIDE_GROUP = -2; export type SIDE_GROUP_TYPE = typeof SIDE_GROUP; export interface IOpenEditorOverrideHandler { - (editor: IEditorInput, options: IEditorOptions | ITextEditorOptions, group: INextEditorGroup): IOpenEditorOverride; + (editor: IEditorInput, options: IEditorOptions | ITextEditorOptions, group: IEditorGroup): IOpenEditorOverride; } export interface IOpenEditorOverride { @@ -78,7 +78,7 @@ export interface INextEditorService { readonly activeTextEditorControl: ITextEditor; /** - * All editors that are opened. + * All editors that are opened. */ readonly editors: ReadonlyArray; @@ -112,7 +112,7 @@ export interface INextEditorService { * active group. Use `SIDE_GROUP_TYPE` to open the editor in a new editor group to the side * of the currently active group. */ - openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; + openEditor(editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; /** * Open an editor in an editor group. @@ -122,7 +122,7 @@ export interface INextEditorService { * active group. Use `SIDE_GROUP_TYPE` to open the editor in a new editor group to the side * of the currently active group. */ - openEditor(editor: IResourceEditor, group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; + openEditor(editor: IResourceEditor, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise; /** * Open editors in an editor group. @@ -132,8 +132,8 @@ export interface INextEditorService { * active group. Use `SIDE_GROUP_TYPE` to open the editor in a new editor group to the side * of the currently active group. */ - openEditors(editors: IEditorInputWithOptions[], group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise>; - openEditors(editors: IResourceEditor[], group?: INextEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise>; + openEditors(editors: IEditorInputWithOptions[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise>; + openEditors(editors: IResourceEditor[], group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): TPromise>; /** * Replaces editors in an editor group with the provided replacement. @@ -143,8 +143,8 @@ export interface INextEditorService { * @returns a promise that is resolved when the replaced active * editor (if any) has finished loading. */ - replaceEditors(editors: IResourceEditorReplacement[], group: INextEditorGroup | GroupIdentifier): TPromise; - replaceEditors(editors: IEditorReplacement[], group: INextEditorGroup | GroupIdentifier): TPromise; + replaceEditors(editors: IResourceEditorReplacement[], group: IEditorGroup | GroupIdentifier): TPromise; + replaceEditors(editors: IEditorReplacement[], group: IEditorGroup | GroupIdentifier): TPromise; /** * Find out if the provided editor (or resource of an editor) is opened in any or @@ -154,7 +154,7 @@ export interface INextEditorService { * * @param group optional to specify a group to check for the editor being opened */ - isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput, group?: INextEditorGroup | GroupIdentifier): boolean; + isOpen(editor: IEditorInput | IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): boolean; /** * Allows to override the opening of editors by installing a handler that will diff --git a/src/vs/workbench/services/editor/test/browser/nextEditorService.test.ts b/src/vs/workbench/services/editor/test/browser/nextEditorService.test.ts index 858027c757b..e90961dc3ea 100644 --- a/src/vs/workbench/services/editor/test/browser/nextEditorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/nextEditorService.test.ts @@ -16,8 +16,8 @@ import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestSe import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService'; import { NextEditorService, DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/browser/nextEditorService'; -import { INextEditorGroup, INextEditorGroupsService, GroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; -import { NextEditorPart } from 'vs/workbench/browser/parts/editor/nextEditorPart'; +import { IEditorGroup, INextEditorGroupsService, GroupDirection } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; import { Dimension } from 'vs/base/browser/dom'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService'; @@ -68,7 +68,7 @@ suite('Editor service', () => { test('basics', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -136,7 +136,7 @@ suite('Editor service', () => { test('openEditors() / replaceEditors()', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -260,7 +260,7 @@ suite('Editor service', () => { const inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.parse('my://resource')); const delegate = instantiationService.createInstance(DelegatingWorkbenchEditorService); - delegate.setEditorOpenHandler((group: INextEditorGroup, input: IEditorInput, options?: EditorOptions) => { + delegate.setEditorOpenHandler((group: IEditorGroup, input: IEditorInput, options?: EditorOptions) => { assert.strictEqual(input, inp); done(); @@ -274,7 +274,7 @@ suite('Editor service', () => { test('close editor does not dispose when editor opened in other group', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -310,7 +310,7 @@ suite('Editor service', () => { test('close editor does not dispose when editor opened in other group (diff input)', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -348,7 +348,7 @@ suite('Editor service', () => { test('close editor disposes properly (diff input)', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -375,7 +375,7 @@ suite('Editor service', () => { test('close editor disposes properly (diff input, left side still opened)', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -404,7 +404,7 @@ suite('Editor service', () => { test('open to the side', function () { const partInstantiator = workbenchInstantiationService(); - const part = partInstantiator.createInstance(NextEditorPart, 'id', false); + const part = partInstantiator.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); diff --git a/src/vs/workbench/services/group/common/groupService.ts b/src/vs/workbench/services/group/common/groupService.ts index 64e2d4c2fe0..f28b47cf510 100644 --- a/src/vs/workbench/services/group/common/groupService.ts +++ b/src/vs/workbench/services/group/common/groupService.ts @@ -7,7 +7,7 @@ import { createDecorator, ServiceIdentifier, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { Position } from 'vs/platform/editor/common/editor'; -import { IEditorStacksModel, IEditorGroup, IEditorOpeningEvent, IEditorInput } from 'vs/workbench/common/editor'; +import { IEditorStacksModel, ILegacyEditorGroup, IEditorOpeningEvent, IEditorInput } from 'vs/workbench/common/editor'; import { Event } from 'vs/base/common/event'; export enum GroupArrangement { @@ -75,19 +75,19 @@ export interface IEditorGroupService { /** * Keyboard focus the editor group at the provided position. */ - focusGroup(group: IEditorGroup): void; + focusGroup(group: ILegacyEditorGroup): void; focusGroup(position: Position): void; /** * Activate the editor group at the provided position without moving focus. */ - activateGroup(group: IEditorGroup): void; + activateGroup(group: ILegacyEditorGroup): void; activateGroup(position: Position): void; /** * Allows to move the editor group from one position to another. */ - moveGroup(from: IEditorGroup, to: IEditorGroup): void; + moveGroup(from: ILegacyEditorGroup, to: ILegacyEditorGroup): void; moveGroup(from: Position, to: Position): void; /** @@ -114,14 +114,14 @@ export interface IEditorGroupService { /** * Adds the pinned state to an editor, removing it from being a preview editor. */ - pinEditor(group: IEditorGroup, input: IEditorInput): void; + pinEditor(group: ILegacyEditorGroup, input: IEditorInput): void; pinEditor(position: Position, input: IEditorInput): void; /** * Moves an editor from one group to another. The index in the group is optional. * The inactive option is applied when moving across groups. */ - moveEditor(input: IEditorInput, from: IEditorGroup, to: IEditorGroup, moveOptions?: IMoveOptions): void; + moveEditor(input: IEditorInput, from: ILegacyEditorGroup, to: ILegacyEditorGroup, moveOptions?: IMoveOptions): void; moveEditor(input: IEditorInput, from: Position, to: Position, moveOptions?: IMoveOptions): void; /** diff --git a/src/vs/workbench/services/group/common/nextEditorGroupsService.ts b/src/vs/workbench/services/group/common/nextEditorGroupsService.ts index 8f9b9787fe3..c88a2d95e21 100644 --- a/src/vs/workbench/services/group/common/nextEditorGroupsService.ts +++ b/src/vs/workbench/services/group/common/nextEditorGroupsService.ts @@ -136,33 +136,33 @@ export interface INextEditorGroupsService { * An event for when the active editor group changes. The active editor * group is the default location for new editors to open. */ - readonly onDidActiveGroupChange: Event; + readonly onDidActiveGroupChange: Event; /** * An event for when a new group was added. */ - readonly onDidAddGroup: Event; + readonly onDidAddGroup: Event; /** * An event for when a group was removed. */ - readonly onDidRemoveGroup: Event; + readonly onDidRemoveGroup: Event; /** * An event for when a group was moved. */ - readonly onDidMoveGroup: Event; + readonly onDidMoveGroup: Event; /** * An active group is the default location for new editors to open. */ - readonly activeGroup: INextEditorGroup; + readonly activeGroup: IEditorGroup; /** * All groups that are currently visible in the editor area in the * order of their creation (oldest first). */ - readonly groups: ReadonlyArray; + readonly groups: ReadonlyArray; /** * The number of editor groups that are currently opened. @@ -184,27 +184,27 @@ export interface INextEditorGroupsService { * sorted by being most recent active or grid order. Will sort by creation * time by default (oldest group first). */ - getGroups(order?: GroupsOrder): ReadonlyArray; + getGroups(order?: GroupsOrder): ReadonlyArray; /** * Allows to convert a group identifier to a group. */ - getGroup(identifier: GroupIdentifier): INextEditorGroup; + getGroup(identifier: GroupIdentifier): IEditorGroup; /** * Move keyboard focus into the provided group. */ - focusGroup(group: INextEditorGroup | GroupIdentifier): INextEditorGroup; + focusGroup(group: IEditorGroup | GroupIdentifier): IEditorGroup; /** * Set a group as active. An active group is the default location for new editors to open. */ - activateGroup(group: INextEditorGroup | GroupIdentifier): INextEditorGroup; + activateGroup(group: IEditorGroup | GroupIdentifier): IEditorGroup; /** * Resize the group given the provided size delta. */ - resizeGroup(group: INextEditorGroup | GroupIdentifier, sizeDelta: number): INextEditorGroup; + resizeGroup(group: IEditorGroup | GroupIdentifier, sizeDelta: number): IEditorGroup; /** * Arrange all groups according to the provided arrangement. @@ -230,7 +230,7 @@ export interface INextEditorGroupsService { * @param scope the scope of the group to search in * @param source optional source to search from */ - findGroup(scope: IFindGroupScope, source?: INextEditorGroup | GroupIdentifier): INextEditorGroup; + findGroup(scope: IFindGroupScope, source?: IEditorGroup | GroupIdentifier): IEditorGroup; /** * Add a new group to the editor area. A new group is added by splitting a provided one in @@ -240,12 +240,12 @@ export interface INextEditorGroupsService { * @param direction the direction of where to split to * @param options configure the newly group with options */ - addGroup(location: INextEditorGroup | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): INextEditorGroup; + addGroup(location: IEditorGroup | GroupIdentifier, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroup; /** * Remove a group from the editor area. */ - removeGroup(group: INextEditorGroup | GroupIdentifier): void; + removeGroup(group: IEditorGroup | GroupIdentifier): void; /** * Move a group to a new group in the editor area. @@ -254,7 +254,7 @@ export interface INextEditorGroupsService { * @param location the group from which to split to add the moved group * @param direction the direction of where to split to */ - moveGroup(group: INextEditorGroup | GroupIdentifier, location: INextEditorGroup | GroupIdentifier, direction: GroupDirection): INextEditorGroup; + moveGroup(group: IEditorGroup | GroupIdentifier, location: IEditorGroup | GroupIdentifier, direction: GroupDirection): IEditorGroup; /** * Merge the editors of a group into a target group. By default, all editors will @@ -268,7 +268,7 @@ export interface INextEditorGroupsService { * `MOVE_EDITORS_KEEP_GROUP` to prevent the source group from closing. Set to * `COPY_EDITORS` to copy the editors into the target instead of moding them. */ - mergeGroup(group: INextEditorGroup | GroupIdentifier, target: INextEditorGroup | GroupIdentifier, options?: IMergeGroupOptions): INextEditorGroup; + mergeGroup(group: IEditorGroup | GroupIdentifier, target: IEditorGroup | GroupIdentifier, options?: IMergeGroupOptions): IEditorGroup; /** * Copy a group to a new group in the editor area. @@ -277,7 +277,7 @@ export interface INextEditorGroupsService { * @param location the group from which to split to add the copied group * @param direction the direction of where to split to */ - copyGroup(group: INextEditorGroup | GroupIdentifier, location: INextEditorGroup | GroupIdentifier, direction: GroupDirection): INextEditorGroup; + copyGroup(group: IEditorGroup | GroupIdentifier, location: IEditorGroup | GroupIdentifier, direction: GroupDirection): IEditorGroup; } export enum GroupChangeKind { @@ -302,7 +302,7 @@ export interface IGroupChangeEvent { editorIndex?: number; } -export interface INextEditorGroup { +export interface IEditorGroup { /** * A unique identifier of this group that remains identical even if the @@ -431,14 +431,14 @@ export interface INextEditorGroup { /** * Move an editor from this group either within this group or to another group. */ - moveEditor(editor: IEditorInput, target: INextEditorGroup, options?: IMoveEditorOptions): void; + moveEditor(editor: IEditorInput, target: IEditorGroup, options?: IMoveEditorOptions): void; /** * Copy an editor from this group to another group. * * Note: It is currently not supported to show the same editor more than once in the same group. */ - copyEditor(editor: IEditorInput, target: INextEditorGroup, options?: ICopyEditorOptions): void; + copyEditor(editor: IEditorInput, target: IEditorGroup, options?: ICopyEditorOptions): void; /** * Close an editor from the group. This may trigger a confirmation dialog if diff --git a/src/vs/workbench/services/group/test/browser/nextEditorGroupsService.test.ts b/src/vs/workbench/services/group/test/browser/nextEditorGroupsService.test.ts index cd82831b9a0..dafa4861832 100644 --- a/src/vs/workbench/services/group/test/browser/nextEditorGroupsService.test.ts +++ b/src/vs/workbench/services/group/test/browser/nextEditorGroupsService.test.ts @@ -6,12 +6,12 @@ 'use strict'; import * as assert from 'assert'; -import { NextEditorPart } from 'vs/workbench/browser/parts/editor/nextEditorPart'; +import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart'; import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { GroupDirection, GroupsOrder, MergeGroupMode, GroupOrientation, GroupChangeKind, EditorsOrder, GroupLocation } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { Dimension } from 'vs/base/browser/dom'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { INextEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; +import { IEditorPartOptions } from 'vs/workbench/browser/parts/editor/editor'; import { EditorInput, IFileEditorInput, IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorExtensions, EditorOptions, CloseDirection } from 'vs/workbench/common/editor'; import { TPromise } from 'vs/base/common/winjs.base'; import { IEditorModel } from 'vs/platform/editor/common/editor'; @@ -26,9 +26,9 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; export class TestEditorControl extends BaseEditor { - constructor(@ITelemetryService telemetryService: ITelemetryService) { super('MyFileEditorForNextEditorGroupService', NullTelemetryService, new TestThemeService()); } + constructor(@ITelemetryService telemetryService: ITelemetryService) { super('MyFileEditorForEditorGroupService', NullTelemetryService, new TestThemeService()); } - getId(): string { return 'myTestEditorForNextEditorGroupService'; } + getId(): string { return 'myTestEditorForEditorGroupService'; } layout(): void { } createEditor(): any { } } @@ -37,7 +37,7 @@ export class TestEditorInput extends EditorInput implements IFileEditorInput { constructor(private resource: URI) { super(); } - getTypeId() { return 'testEditorInputForNextEditorGroupService'; } + getTypeId() { return 'testEditorInputForEditorGroupService'; } resolve(): TPromise { return null; } matches(other: TestEditorInput): boolean { return other && this.resource.toString() === other.resource.toString() && other instanceof TestEditorInput; } setEncoding(encoding: string) { } @@ -81,10 +81,10 @@ suite('Editor groups service', () => { registerTestEditorInput(); - function createPart(): NextEditorPart { + function createPart(): EditorPart { const instantiationService = workbenchInstantiationService(); - const part = instantiationService.createInstance(NextEditorPart, 'id', false); + const part = instantiationService.createInstance(EditorPart, 'id', false); part.create(document.createElement('div')); part.layout(new Dimension(400, 300)); @@ -349,8 +349,8 @@ suite('Editor groups service', () => { test('options', function () { const part = createPart(); - let oldOptions: INextEditorPartOptions; - let newOptions: INextEditorPartOptions; + let oldOptions: IEditorPartOptions; + let newOptions: IEditorPartOptions; part.onDidEditorPartOptionsChange(event => { oldOptions = event.oldPartOptions; newOptions = event.newPartOptions; diff --git a/src/vs/workbench/services/history/electron-browser/history.ts b/src/vs/workbench/services/history/electron-browser/history.ts index d02d6f0fe7a..2e11fa31aa3 100644 --- a/src/vs/workbench/services/history/electron-browser/history.ts +++ b/src/vs/workbench/services/history/electron-browser/history.ts @@ -22,7 +22,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { Registry } from 'vs/platform/registry/common/platform'; import { once, debounceEvent } from 'vs/base/common/event'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; -import { INextEditorGroupsService, INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { getCodeEditor } from 'vs/editor/browser/editorBrowser'; import { getExcludes, ISearchConfiguration } from 'vs/platform/search/common/search'; @@ -609,7 +609,7 @@ export class HistoryService implements IHistoryService { this.windowService.removeFromRecentlyOpened([input.resource.fsPath]); } - private isFileOpened(resource: URI, group: INextEditorGroup): boolean { + private isFileOpened(resource: URI, group: IEditorGroup): boolean { if (!group) { return false; } diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index 5e21ad31293..43e370adaac 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -36,7 +36,7 @@ import { ICodeEditor, getCodeEditor } from 'vs/editor/browser/editorBrowser'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { assign } from 'vs/base/common/objects'; import { INextEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/nextEditorService'; -import { INextEditorGroup, INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup, INextEditorGroupsService } from 'vs/workbench/services/group/common/nextEditorGroupsService'; const emptyEditableSettingsContent = '{\n}'; @@ -182,7 +182,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic return this.openOrSwitchSettings(target, resource); } - openGlobalSettings(options?: IEditorOptions, group?: INextEditorGroup): TPromise { + openGlobalSettings(options?: IEditorOptions, group?: IEditorGroup): TPromise { return this.openOrSwitchSettings(ConfigurationTarget.USER, this.userSettingsResource, options, group); } @@ -190,7 +190,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic return this.editorService.openEditor(this.instantiationService.createInstance(SettingsEditor2Input), { pinned: true }).then(() => null); } - openWorkspaceSettings(options?: IEditorOptions, group?: INextEditorGroup): TPromise { + openWorkspaceSettings(options?: IEditorOptions, group?: IEditorGroup): TPromise { if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) { this.notificationService.info(nls.localize('openFolderFirst', "Open a folder first to create workspace settings")); return TPromise.as(null); @@ -198,7 +198,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic return this.openOrSwitchSettings(ConfigurationTarget.WORKSPACE, this.workspaceSettingsResource, options, group); } - openFolderSettings(folder: URI, options?: IEditorOptions, group?: INextEditorGroup): TPromise { + openFolderSettings(folder: URI, options?: IEditorOptions, group?: IEditorGroup): TPromise { return this.openOrSwitchSettings(ConfigurationTarget.WORKSPACE_FOLDER, this.getEditableSettingsURI(ConfigurationTarget.WORKSPACE_FOLDER, folder), options, group); } @@ -247,7 +247,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic }); } - private openOrSwitchSettings(configurationTarget: ConfigurationTarget, resource: URI, options?: IEditorOptions, group: INextEditorGroup = this.editorGroupService.activeGroup): TPromise { + private openOrSwitchSettings(configurationTarget: ConfigurationTarget, resource: URI, options?: IEditorOptions, group: IEditorGroup = this.editorGroupService.activeGroup): TPromise { const editorInput = this.getActiveSettingsEditorInput(group); if (editorInput && editorInput.master.getResource().fsPath !== resource.fsPath) { return this.doSwitchSettings(configurationTarget, resource, editorInput, group); @@ -255,7 +255,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic return this.doOpenSettings(configurationTarget, resource, options, group); } - private doOpenSettings(configurationTarget: ConfigurationTarget, resource: URI, options?: IEditorOptions, group?: INextEditorGroup): TPromise { + private doOpenSettings(configurationTarget: ConfigurationTarget, resource: URI, options?: IEditorOptions, group?: IEditorGroup): TPromise { const openDefaultSettings = !!this.configurationService.getValue(DEFAULT_SETTINGS_EDITOR_SETTING); return this.getOrCreateEditableSettingsEditorInput(configurationTarget, resource) .then(editableSettingsEditorInput => { @@ -275,7 +275,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic }); } - private doSwitchSettings(target: ConfigurationTarget, resource: URI, input: PreferencesEditorInput, group: INextEditorGroup): TPromise { + private doSwitchSettings(target: ConfigurationTarget, resource: URI, input: PreferencesEditorInput, group: IEditorGroup): TPromise { return this.getOrCreateEditableSettingsEditorInput(target, this.getEditableSettingsURI(target, resource)) .then(toInput => { const replaceWith = new PreferencesEditorInput(this.getPreferencesEditorInputName(target, resource), toInput.getDescription(), this.instantiationService.createInstance(DefaultPreferencesEditorInput, this.getDefaultSettingsResource(target)), toInput); @@ -290,7 +290,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic }); } - private getActiveSettingsEditorInput(group: INextEditorGroup = this.editorGroupService.activeGroup): PreferencesEditorInput { + private getActiveSettingsEditorInput(group: IEditorGroup = this.editorGroupService.activeGroup): PreferencesEditorInput { return group.editors.filter(e => e instanceof PreferencesEditorInput)[0]; } diff --git a/src/vs/workbench/services/preferences/common/preferences.ts b/src/vs/workbench/services/preferences/common/preferences.ts index d7679c4c93a..11d56b2aa20 100644 --- a/src/vs/workbench/services/preferences/common/preferences.ts +++ b/src/vs/workbench/services/preferences/common/preferences.ts @@ -17,7 +17,7 @@ import { Event } from 'vs/base/common/event'; import { IStringDictionary } from 'vs/base/common/collections'; import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; import { localize } from 'vs/nls'; -import { INextEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { IEditorGroup } from 'vs/workbench/services/group/common/nextEditorGroupsService'; export interface ISettingsGroup { id: string; @@ -146,9 +146,9 @@ export interface IPreferencesService { openRawUserSettings(): TPromise; openSettings(): TPromise; openSettings2(): TPromise; - openGlobalSettings(options?: IEditorOptions, group?: INextEditorGroup): TPromise; - openWorkspaceSettings(options?: IEditorOptions, group?: INextEditorGroup): TPromise; - openFolderSettings(folder: URI, options?: IEditorOptions, group?: INextEditorGroup): TPromise; + openGlobalSettings(options?: IEditorOptions, group?: IEditorGroup): TPromise; + openWorkspaceSettings(options?: IEditorOptions, group?: IEditorGroup): TPromise; + openFolderSettings(folder: URI, options?: IEditorOptions, group?: IEditorGroup): TPromise; switchSettings(target: ConfigurationTarget, resource: URI): TPromise; openGlobalKeybindingSettings(textual: boolean): TPromise; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 5a2c3c2aa5c..706f69c347d 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -14,7 +14,7 @@ import URI from 'vs/base/common/uri'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService'; -import { IEditorGroup, ConfirmResult, IEditorOpeningEvent, IEditorInputWithOptions, CloseDirection, IEditorIdentifier, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorInput, IEditor, IEditorCloseEvent } from 'vs/workbench/common/editor'; +import { ILegacyEditorGroup, ConfirmResult, IEditorOpeningEvent, IEditorInputWithOptions, CloseDirection, IEditorIdentifier, IUntitledResourceInput, IResourceDiffInput, IResourceSideBySideInput, IEditorInput, IEditor, IEditorCloseEvent } from 'vs/workbench/common/editor'; import { Event, Emitter } from 'vs/base/common/event'; import Severity from 'vs/base/common/severity'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; @@ -68,7 +68,7 @@ import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensi import { IKeybindingService } from '../../platform/keybinding/common/keybinding'; import { IDecorationsService, IResourceDecorationChangeEvent, IDecoration, IDecorationData, IDecorationsProvider } from 'vs/workbench/services/decorations/browser/decorations'; import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { INextEditorGroupsService, INextEditorGroup, GroupsOrder, GroupsArrangement, GroupDirection, IAddGroupOptions, IMergeGroupOptions, IMoveEditorOptions, ICopyEditorOptions, IEditorReplacement, IGroupChangeEvent, EditorsOrder, IFindGroupScope } from 'vs/workbench/services/group/common/nextEditorGroupsService'; +import { INextEditorGroupsService, IEditorGroup, GroupsOrder, GroupsArrangement, GroupDirection, IAddGroupOptions, IMergeGroupOptions, IMoveEditorOptions, ICopyEditorOptions, IEditorReplacement, IGroupChangeEvent, EditorsOrder, IFindGroupScope } from 'vs/workbench/services/group/common/nextEditorGroupsService'; import { INextEditorService, IOpenEditorOverrideHandler } from 'vs/workbench/services/editor/common/nextEditorService'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; @@ -557,19 +557,19 @@ export class TestEditorGroupService implements IEditorGroupService { return this._onTabOptionsChanged.event; } - public focusGroup(group: IEditorGroup): void; + public focusGroup(group: ILegacyEditorGroup): void; public focusGroup(position: Position): void; public focusGroup(arg1: any): void { } - public activateGroup(group: IEditorGroup): void; + public activateGroup(group: ILegacyEditorGroup): void; public activateGroup(position: Position): void; public activateGroup(arg1: any): void { } - public moveGroup(from: IEditorGroup, to: IEditorGroup): void; + public moveGroup(from: ILegacyEditorGroup, to: ILegacyEditorGroup): void; public moveGroup(from: Position, to: Position): void; public moveGroup(arg1: any, arg2: any): void { @@ -591,12 +591,12 @@ export class TestEditorGroupService implements IEditorGroupService { } - public pinEditor(group: IEditorGroup, input: IEditorInput): void; + public pinEditor(group: ILegacyEditorGroup, input: IEditorInput): void; public pinEditor(position: Position, input: IEditorInput): void; public pinEditor(arg1: any, input: IEditorInput): void { } - public moveEditor(input: IEditorInput, from: IEditorGroup, to: IEditorGroup, moveOptions?: IMoveOptions): void; + public moveEditor(input: IEditorInput, from: ILegacyEditorGroup, to: ILegacyEditorGroup, moveOptions?: IMoveOptions): void; public moveEditor(input: IEditorInput, from: Position, to: Position, moveOptions?: IMoveOptions): void; public moveEditor(input: IEditorInput, from: any, to: any, moveOptions?: IMoveOptions): void { } @@ -705,15 +705,15 @@ export class TestNextEditorGroupsService implements INextEditorGroupsService { constructor(public groups: TestNextEditorGroup[] = []) { } - onDidActiveGroupChange: Event = Event.None; - onDidAddGroup: Event = Event.None; - onDidRemoveGroup: Event = Event.None; - onDidMoveGroup: Event = Event.None; + onDidActiveGroupChange: Event = Event.None; + onDidAddGroup: Event = Event.None; + onDidRemoveGroup: Event = Event.None; + onDidMoveGroup: Event = Event.None; orientation: any; whenRestored: TPromise = TPromise.as(void 0); - get activeGroup(): INextEditorGroup { + get activeGroup(): IEditorGroup { return this.groups[0]; } @@ -721,11 +721,11 @@ export class TestNextEditorGroupsService implements INextEditorGroupsService { return this.groups.length; } - getGroups(order?: GroupsOrder): ReadonlyArray { + getGroups(order?: GroupsOrder): ReadonlyArray { return this.groups; } - getGroup(identifier: number): INextEditorGroup { + getGroup(identifier: number): IEditorGroup { for (let i = 0; i < this.groups.length; i++) { if (this.groups[i].id === identifier) { return this.groups[i]; @@ -739,19 +739,19 @@ export class TestNextEditorGroupsService implements INextEditorGroupsService { return 'Group 1'; } - focusGroup(group: number | INextEditorGroup): INextEditorGroup { + focusGroup(group: number | IEditorGroup): IEditorGroup { return null; } - findGroup(scope: IFindGroupScope, source?: number | INextEditorGroup): INextEditorGroup { + findGroup(scope: IFindGroupScope, source?: number | IEditorGroup): IEditorGroup { return null; } - activateGroup(group: number | INextEditorGroup): INextEditorGroup { + activateGroup(group: number | IEditorGroup): IEditorGroup { return null; } - resizeGroup(group: number | INextEditorGroup, sizeDelta: number): INextEditorGroup { + resizeGroup(group: number | IEditorGroup, sizeDelta: number): IEditorGroup { return null; } @@ -759,26 +759,26 @@ export class TestNextEditorGroupsService implements INextEditorGroupsService { setGroupOrientation(orientation: any): void { } - addGroup(location: number | INextEditorGroup, direction: GroupDirection, options?: IAddGroupOptions): INextEditorGroup { + addGroup(location: number | IEditorGroup, direction: GroupDirection, options?: IAddGroupOptions): IEditorGroup { return null; } - removeGroup(group: number | INextEditorGroup): void { } + removeGroup(group: number | IEditorGroup): void { } - moveGroup(group: number | INextEditorGroup, location: number | INextEditorGroup, direction: GroupDirection): INextEditorGroup { + moveGroup(group: number | IEditorGroup, location: number | IEditorGroup, direction: GroupDirection): IEditorGroup { return null; } - mergeGroup(group: number | INextEditorGroup, target: number | INextEditorGroup, options?: IMergeGroupOptions): INextEditorGroup { + mergeGroup(group: number | IEditorGroup, target: number | IEditorGroup, options?: IMergeGroupOptions): IEditorGroup { return null; } - copyGroup(group: number | INextEditorGroup, location: number | INextEditorGroup, direction: GroupDirection): INextEditorGroup { + copyGroup(group: number | IEditorGroup, location: number | IEditorGroup, direction: GroupDirection): IEditorGroup { return null; } } -export class TestNextEditorGroup implements INextEditorGroup { +export class TestNextEditorGroup implements IEditorGroup { constructor(public id: number) { } @@ -828,9 +828,9 @@ export class TestNextEditorGroup implements INextEditorGroup { return false; } - moveEditor(editor: IEditorInput, target: INextEditorGroup, options?: IMoveEditorOptions): void { } + moveEditor(editor: IEditorInput, target: IEditorGroup, options?: IMoveEditorOptions): void { } - copyEditor(editor: IEditorInput, target: INextEditorGroup, options?: ICopyEditorOptions): void { } + copyEditor(editor: IEditorInput, target: IEditorGroup, options?: ICopyEditorOptions): void { } closeEditor(editor?: IEditorInput): TPromise { return TPromise.as(void 0);