提交 ef92f85c 编写于 作者: B Benjamin Pasero

grid - remove old group/editor services

上级 abe0207f
......@@ -28,7 +28,6 @@ import { Scope } from 'vs/workbench/common/memento';
import { ISerializedEditorGroup, isSerializedEditorGroup } from 'vs/workbench/common/editor/editorGroup';
import { TValueCallback, TPromise } from 'vs/base/common/winjs.base';
import { always } from 'vs/base/common/async';
import { GroupOrientation as LegacyGroupOrientation } from 'vs/workbench/services/group/common/groupService';
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';
......@@ -737,7 +736,7 @@ export class EditorPart extends Part implements INextEditorGroupsService, IEdito
interface ILegacyEditorPartUIState {
ratio: number[];
groupOrientation: LegacyGroupOrientation;
groupOrientation: 'vertical' | 'horizontal';
}
interface ISerializedLegacyEditorStacksModel {
......
......@@ -60,11 +60,9 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati
import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/electron-browser/configurationResolverService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { ITitleService } from 'vs/workbench/services/title/common/titleService';
import { IWorkbenchEditorService, WorkbenchEditorService, NoOpEditorPart, IResourceInputType } from 'vs/workbench/services/editor/common/editorService';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ClipboardService } from 'vs/platform/clipboard/electron-browser/clipboardService';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
......@@ -109,7 +107,7 @@ import { IPCClient } from 'vs/base/parts/ipc/common/ipc';
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 { INextEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/nextEditorService';
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';
......@@ -387,11 +385,6 @@ export class Workbench extends Disposable implements IPartService {
this.editorService = this.instantiationService.createInstance(NextEditorService);
serviceCollection.set(INextEditorService, this.editorService);
// TODO@grid Remove Legacy Editor Services
const noOpEditorPart = new NoOpEditorPart(this.instantiationService);
serviceCollection.set(IWorkbenchEditorService, this.instantiationService.createInstance(WorkbenchEditorService, noOpEditorPart));
serviceCollection.set(IEditorGroupService, noOpEditorPart);
// Title bar
this.titlebarPart = this.instantiationService.createInstance(TitlebarPart, Identifiers.TITLEBAR_PART);
this._register(toDisposable(() => this.titlebarPart.shutdown()));
......@@ -714,7 +707,7 @@ export class Workbench extends Disposable implements IPartService {
return restore;
}
private resolveEditorsToOpen(): TPromise<IResourceInputType[]> {
private resolveEditorsToOpen(): TPromise<IResourceEditor[]> {
const config = this.workbenchParams.configuration;
// Files to open, diff or create
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { createDecorator, ServiceIdentifier, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { Position } from 'vs/platform/editor/common/editor';
import { IEditorOpeningEvent, IEditorInput } from 'vs/workbench/common/editor';
import { Event } from 'vs/base/common/event';
export enum GroupArrangement {
MINIMIZE_OTHERS,
EVEN
}
export type GroupOrientation = 'vertical' | 'horizontal';
export const IEditorGroupService = createDecorator<IEditorGroupService>('editorGroupService');
export interface IEditorTabOptions {
showTabs?: boolean;
tabCloseButton?: 'left' | 'right' | 'off';
tabSizing?: 'fit' | 'shrink';
showIcons?: boolean;
previewEditors?: boolean;
labelFormat?: 'default' | 'short' | 'medium' | 'long';
iconTheme?: string;
}
export interface IMoveOptions {
index?: number;
inactive?: boolean;
preserveFocus?: boolean;
}
/**
* The editor service allows to open editors and work on the active
* editor input and models.
*/
export interface IEditorGroupService {
_serviceBrand: ServiceIdentifier<any>;
/**
* Emitted when editors or inputs change. Examples: opening, closing of editors. Active editor change.
*/
onEditorsChanged: Event<void>;
/**
* Emitted when an editor is opening. Allows to prevent/replace the opening via the event method.
*/
onEditorOpening: Event<IEditorOpeningEvent>;
/**
* Emitted when opening an editor fails.
*/
onEditorOpenFail: Event<IEditorInput>;
/**
* Emitted when an entire editor group is moved to another position.
*/
onEditorGroupMoved: Event<void>;
/**
* Emitted when the editor group orientation was changed.
*/
onGroupOrientationChanged: Event<void>;
/**
* Emitted when tab options changed.
*/
onTabOptionsChanged: Event<IEditorTabOptions>;
/**
* Keyboard focus the editor group at the provided position.
*/
focusGroup(group: any): void;
focusGroup(position: Position): void;
/**
* Activate the editor group at the provided position without moving focus.
*/
activateGroup(group: any): void;
activateGroup(position: Position): void;
/**
* Allows to move the editor group from one position to another.
*/
moveGroup(from: any, to: any): void;
moveGroup(from: Position, to: Position): void;
/**
* Allows to arrange editor groups according to the GroupArrangement enumeration.
*/
arrangeGroups(arrangement: GroupArrangement): void;
/**
* Changes the editor group layout between vertical and horizontal orientation. Only applies
* if more than one editor is opened.
*/
setGroupOrientation(orientation: GroupOrientation): void;
/**
* Returns the current editor group layout.
*/
getGroupOrientation(): GroupOrientation;
/**
* Resize visible editor groups
*/
resizeGroup(position: Position, groupSizeChange: number): void;
/**
* Adds the pinned state to an editor, removing it from being a preview editor.
*/
pinEditor(group: any, 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: any, to: any, moveOptions?: IMoveOptions): void;
moveEditor(input: IEditorInput, from: Position, to: Position, moveOptions?: IMoveOptions): void;
/**
* Provides access to the editor stacks model
*/
getStacksModel(): any;
/**
* Returns tab options.
*/
getTabOptions(): IEditorTabOptions;
/**
* Invoke a function in the context of the active editor.
*/
invokeWithinEditorContext<T>(fn: (accessor: ServicesAccessor) => T): T;
}
\ No newline at end of file
......@@ -37,7 +37,6 @@ import { IRawTextContent, ITextFileService } from 'vs/workbench/services/textfil
import { parseArgs } from 'vs/platform/environment/node/argv';
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { IInstantiationService, ServicesAccessor, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
......@@ -181,7 +180,6 @@ export class TestTextFileService extends TextFileService {
@ILifecycleService lifecycleService: ILifecycleService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IConfigurationService configurationService: IConfigurationService,
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@IFileService fileService: IFileService,
@IUntitledEditorService untitledEditorService: IUntitledEditorService,
@IInstantiationService instantiationService: IInstantiationService,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册