mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-05 15:36:22 +01:00
editors - deprecate typed openEditor and add IEditorGroupService.sideGroup (#127747)
This commit is contained in:
19 files changed
+79
-23
No files matched your search
@@ -8,7 +8,7 @@ import { Part } from 'vs/workbench/browser/part';
|
||||
import { Dimension, isAncestor, $, EventHelper, addDisposableGenericMouseDownListner } from 'vs/base/browser/dom';
|
||||
import { Event, Emitter, Relay } from 'vs/base/common/event';
|
||||
import { contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { GroupDirection, IAddGroupOptions, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupChangeKind, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { GroupDirection, IAddGroupOptions, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupChangeKind, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorGroupsService, IEditorSideGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IView, orthogonal, LayoutPriority, IViewSize, Direction, SerializableGrid, Sizing, ISerializedGrid, Orientation, GridBranchNode, isGridBranchNode, GridNode, createSerializedGrid, Grid } from 'vs/base/browser/ui/grid/grid';
|
||||
import { GroupIdentifier, IEditorInputWithOptions, IEditorPartOptions, IEditorPartOptionsChangeEvent } from 'vs/workbench/common/editor';
|
||||
@@ -31,6 +31,8 @@ import { assertIsDefined } from 'vs/base/common/types';
|
||||
import { IBoundarySashes } from 'vs/base/browser/ui/grid/gridview';
|
||||
import { CompositeDragAndDropObserver } from 'vs/workbench/browser/dnd';
|
||||
import { Promises } from 'vs/base/common/async';
|
||||
import { findGroup } from 'vs/workbench/services/editor/common/editorGroupFinder';
|
||||
import { SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
||||
interface IEditorPartUIState {
|
||||
serializedGrid: ISerializedGrid;
|
||||
@@ -197,6 +199,14 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
|
||||
return this._activeGroup;
|
||||
}
|
||||
|
||||
readonly sideGroup: IEditorSideGroup = {
|
||||
openEditor: (editor, options) => {
|
||||
const [group] = this.instantiationService.invokeFunction(accessor => findGroup(accessor, { editor, options }, SIDE_GROUP));
|
||||
|
||||
return group.openEditor(editor, options);
|
||||
}
|
||||
};
|
||||
|
||||
get groups(): IEditorGroupView[] {
|
||||
return Array.from(this.groupViews.values());
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { IKeyMods, IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { AbstractGotoLineQuickAccessProvider } from 'vs/editor/contrib/quickAccess/gotoLineQuickAccess';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -18,6 +18,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/editorNavigationQuickAccess';
|
||||
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
|
||||
export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
||||
|
||||
@@ -25,6 +26,7 @@ export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProv
|
||||
|
||||
constructor(
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super();
|
||||
@@ -54,7 +56,7 @@ export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProv
|
||||
preserveFocus: options.preserveFocus
|
||||
};
|
||||
|
||||
this.editorService.openEditor(this.editorService.activeEditor, editorOptions, SIDE_GROUP);
|
||||
this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor, editorOptions);
|
||||
}
|
||||
|
||||
// Otherwise let parent handle it
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { localize } from 'vs/nls';
|
||||
import { IKeyMods, IQuickPickSeparator, IQuickInputService, IQuickPick } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IQuickAccessRegistry, Extensions as QuickaccessExtensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
@@ -29,6 +29,7 @@ import { IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/edi
|
||||
import { IOutlineService, OutlineTarget } from 'vs/workbench/services/outline/browser/outline';
|
||||
import { isCompositeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
|
||||
export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccessProvider {
|
||||
|
||||
@@ -36,6 +37,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
|
||||
constructor(
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IOutlineService private readonly outlineService: IOutlineService,
|
||||
) {
|
||||
@@ -80,7 +82,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
preserveFocus: options.preserveFocus
|
||||
};
|
||||
|
||||
this.editorService.openEditor(this.editorService.activeEditor, editorOptions, SIDE_GROUP);
|
||||
this.editorGroupService.sideGroup.openEditor(this.editorService.activeEditor, editorOptions);
|
||||
}
|
||||
|
||||
// Otherwise let parent handle it
|
||||
|
||||
@@ -26,7 +26,6 @@ import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent, IListDragAn
|
||||
import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels';
|
||||
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { IMenuService, MenuId, IMenu, Action2, registerAction2, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
@@ -80,7 +79,6 @@ export class OpenEditorsView extends ViewPane {
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@@ -362,7 +360,8 @@ export class OpenEditorsView extends ViewPane {
|
||||
if (!preserveActivateGroup) {
|
||||
this.editorGroupService.activateGroup(element.group); // needed for https://github.com/microsoft/vscode/issues/6672
|
||||
}
|
||||
this.editorService.openEditor(element.editor, options, options.sideBySide ? SIDE_GROUP : element.group);
|
||||
const targetGroup = options.sideBySide ? this.editorGroupService.sideGroup : this.editorGroupService.activeGroup;
|
||||
targetGroup.openEditor(element.editor, options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ suite('EditorAutoSave', () => {
|
||||
));
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
const editorService: EditorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -65,8 +65,8 @@ suite('Files - TextFileEditorTracker', () => {
|
||||
}
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
instantiationService.stub(IWorkspaceTrustRequestService, new TestWorkspaceTrustRequestService(false));
|
||||
|
||||
const editorService: EditorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -45,7 +45,7 @@ import { GotoSymbolQuickAccessProvider } from 'vs/workbench/contrib/codeEditor/b
|
||||
import { ITextModelService } from 'vs/editor/common/services/resolverService';
|
||||
import { ScrollType, IEditor, ICodeEditorViewState, IDiffEditorViewState } from 'vs/editor/common/editorCommon';
|
||||
import { once } from 'vs/base/common/functional';
|
||||
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { getIEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
@@ -177,7 +177,8 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
|
||||
@IHistoryService private readonly historyService: IHistoryService,
|
||||
@IFilesConfigurationService private readonly filesConfigurationService: IFilesConfigurationService,
|
||||
@ITextModelService private readonly textModelService: ITextModelService,
|
||||
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService
|
||||
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService
|
||||
) {
|
||||
super(AnythingQuickAccessProvider.PREFIX, {
|
||||
canAcceptInBackground: true,
|
||||
@@ -960,7 +961,8 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
|
||||
|
||||
// Open editor (typed)
|
||||
if (isEditorInput(resourceOrEditor)) {
|
||||
await this.editorService.openEditor(resourceOrEditor, editorOptions, targetGroup);
|
||||
const group = (targetGroup === SIDE_GROUP) ? this.editorGroupService.sideGroup : this.editorGroupService.activeGroup;
|
||||
await group.openEditor(resourceOrEditor, editorOptions);
|
||||
}
|
||||
|
||||
// Open editor (untyped)
|
||||
|
||||
@@ -134,6 +134,17 @@ export const enum GroupsOrder {
|
||||
GRID_APPEARANCE
|
||||
}
|
||||
|
||||
export interface IEditorSideGroup {
|
||||
|
||||
/**
|
||||
* Open an editor in this group.
|
||||
*
|
||||
* @returns a promise that resolves around an IEditor instance unless
|
||||
* the call failed, or the editor was not opened as active editor.
|
||||
*/
|
||||
openEditor(editor: IEditorInput, options?: IEditorOptions): Promise<IEditorPane | undefined>;
|
||||
}
|
||||
|
||||
export interface IEditorGroupsService {
|
||||
|
||||
readonly _serviceBrand: undefined;
|
||||
@@ -189,6 +200,12 @@ export interface IEditorGroupsService {
|
||||
*/
|
||||
readonly activeGroup: IEditorGroup;
|
||||
|
||||
/**
|
||||
* A side group allows a subset of methods on a group that is either
|
||||
* created to the side or picked if already there.
|
||||
*/
|
||||
readonly sideGroup: IEditorSideGroup;
|
||||
|
||||
/**
|
||||
* All groups that are currently visible in the editor area in the
|
||||
* order of their creation (oldest first).
|
||||
|
||||
@@ -194,12 +194,17 @@ export interface IEditorService {
|
||||
* @returns the editor that opened or `undefined` if the operation failed or the editor was not
|
||||
* opened to be active.
|
||||
*/
|
||||
openEditor(editor: IEditorInput, options?: IEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<IEditorPane | undefined>;
|
||||
openEditor(editor: IResourceEditorInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<IEditorPane | undefined>;
|
||||
openEditor(editor: ITextResourceEditorInput | IUntitledTextResourceEditorInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<IEditorPane | undefined>;
|
||||
openEditor(editor: IResourceDiffEditorInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<ITextDiffEditorPane | undefined>;
|
||||
openEditor(editor: IUntypedEditorInput, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<IEditorPane | undefined>;
|
||||
|
||||
/**
|
||||
* @deprecated when using `IEditorInput`, please call `group.openEditor` directly.
|
||||
* Use `IEditorGroupService.sideGroup.openEditor` to be able to open an editor to the side.
|
||||
*/
|
||||
openEditor(editor: IEditorInput, options?: IEditorOptions, group?: IEditorGroup | GroupIdentifier | SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE): Promise<IEditorPane | undefined>;
|
||||
|
||||
/**
|
||||
* Open editors in an editor group.
|
||||
*
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { workbenchInstantiationService, registerTestEditor, TestFileEditorInput, TestEditorPart, ITestInstantiationService, TestServiceAccessor, createEditorPart } from 'vs/workbench/test/browser/workbenchTestServices';
|
||||
import { GroupDirection, GroupsOrder, MergeGroupMode, GroupOrientation, GroupChangeKind, GroupLocation, isEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { GroupDirection, GroupsOrder, MergeGroupMode, GroupOrientation, GroupChangeKind, GroupLocation, isEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { CloseDirection, IEditorPartOptions, EditorsOrder, EditorInputCapabilities } from 'vs/workbench/common/editor';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
@@ -32,6 +32,7 @@ suite('EditorGroupsService', () => {
|
||||
|
||||
async function createPart(instantiationService = workbenchInstantiationService()): Promise<[TestEditorPart, ITestInstantiationService]> {
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
return [part, instantiationService];
|
||||
}
|
||||
@@ -191,6 +192,25 @@ suite('EditorGroupsService', () => {
|
||||
groupMovedListener.dispose();
|
||||
});
|
||||
|
||||
test('sideGroup', async () => {
|
||||
const instantiationService = workbenchInstantiationService({ contextKeyService: instantiationService => instantiationService.createInstance(MockScopableContextKeyService) });
|
||||
const [part] = await createPart(instantiationService);
|
||||
|
||||
const rootGroup = part.activeGroup;
|
||||
|
||||
let input1 = new TestFileEditorInput(URI.file('foo/bar1'), TEST_EDITOR_INPUT_ID);
|
||||
let input2 = new TestFileEditorInput(URI.file('foo/bar2'), TEST_EDITOR_INPUT_ID);
|
||||
let input3 = new TestFileEditorInput(URI.file('foo/bar3'), TEST_EDITOR_INPUT_ID);
|
||||
|
||||
await rootGroup.openEditor(input1, { pinned: true });
|
||||
await part.sideGroup.openEditor(input2, { pinned: true });
|
||||
assert.strictEqual(part.count, 2);
|
||||
|
||||
part.activateGroup(rootGroup);
|
||||
await part.sideGroup.openEditor(input3, { pinned: true });
|
||||
assert.strictEqual(part.count, 2);
|
||||
});
|
||||
|
||||
test('save & restore state', async function () {
|
||||
let [part, instantiationService] = await createPart();
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ suite('EditorResolverService', () => {
|
||||
|
||||
async function createEditorResolverService(instantiationService: ITestInstantiationService = workbenchInstantiationService()): Promise<[EditorPart, EditorResolverService, TestServiceAccessor]> {
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
const editorResolverService = instantiationService.createInstance(EditorResolverService);
|
||||
instantiationService.stub(IEditorResolverService, editorResolverService);
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ suite('EditorService', () => {
|
||||
|
||||
async function createEditorService(instantiationService: ITestInstantiationService = workbenchInstantiationService()): Promise<[EditorPart, EditorService, TestServiceAccessor]> {
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
instantiationService.stub(IWorkspaceTrustRequestService, new TestWorkspaceTrustRequestService(false));
|
||||
|
||||
const editorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { workbenchInstantiationService, TestFileEditorInput, registerTestEditor,
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { GroupDirection } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { EditorActivation } from 'vs/platform/editor/common/editor';
|
||||
import { WillSaveStateReason } from 'vs/platform/storage/common/storage';
|
||||
import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||
@@ -41,6 +41,7 @@ suite('EditorsObserver', function () {
|
||||
instantiationService.invokeFunction(accessor => Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory).start(accessor));
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
disposables.add(toDisposable(() => part.clearState()));
|
||||
|
||||
return part;
|
||||
|
||||
@@ -29,7 +29,6 @@ suite('HistoryService', function () {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
const editorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -93,10 +93,10 @@ suite('WorkingCopyBackupTracker (browser)', function () {
|
||||
instantiationService.stub(IWorkingCopyBackupService, workingCopyBackupService);
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
disposables.add(registerTestResourceEditor());
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
instantiationService.stub(IWorkspaceTrustRequestService, new TestWorkspaceTrustRequestService(false));
|
||||
|
||||
const editorService: EditorService = instantiationService.createInstance(EditorService);
|
||||
@@ -202,8 +202,8 @@ suite('WorkingCopyBackupTracker (browser)', function () {
|
||||
instantiationService.stub(IWorkingCopyBackupService, workingCopyBackupService);
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
instantiationService.stub(IWorkspaceTrustRequestService, new TestWorkspaceTrustRequestService(false));
|
||||
|
||||
const editorService: EditorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -55,6 +55,7 @@ suite('WorkingCopyEditorService', () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
instantiationService.stub(IWorkspaceTrustRequestService, new TestWorkspaceTrustRequestService(false));
|
||||
const editorService = instantiationService.createInstance(EditorService);
|
||||
const accessor = instantiationService.createInstance(TestServiceAccessor);
|
||||
|
||||
-1
@@ -134,7 +134,6 @@ flakySuite('WorkingCopyBackupTracker (native)', function () {
|
||||
));
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
const editorService: EditorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -41,7 +41,6 @@ suite('Workbench editor utils', () => {
|
||||
const instantiationService = workbenchInstantiationService();
|
||||
|
||||
const part = await createEditorPart(instantiationService, disposables);
|
||||
|
||||
instantiationService.stub(IEditorGroupsService, part);
|
||||
|
||||
const editorService = instantiationService.createInstance(EditorService);
|
||||
|
||||
@@ -683,6 +683,7 @@ export class TestEditorGroupsService implements IEditorGroupsService {
|
||||
contentDimension = { width: 800, height: 600 };
|
||||
|
||||
get activeGroup(): IEditorGroup { return this.groups[0]; }
|
||||
get sideGroup(): IEditorGroup { return this.groups[0]; }
|
||||
get count(): number { return this.groups.length; }
|
||||
|
||||
getGroups(_order?: GroupsOrder): readonly IEditorGroup[] { return this.groups; }
|
||||
|
||||
Reference in new issue
Block a user