diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index 8b01f38ce8144a4bcf23c1e38433de0527d26f52..ff1080dba6a12d261f4ad2cedb1bce3742d04d82 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -32,7 +32,7 @@ import { NavigateBetweenGroupsAction, FocusActiveGroupAction, FocusFirstGroupAction, FocusSecondGroupAction, FocusThirdGroupAction, EvenGroupWidthsAction, MaximizeGroupAction, MinimizeOtherGroupsAction, FocusPreviousGroup, FocusNextGroup, ShowEditorsInGroupOneAction, toEditorQuickOpenEntry, CloseLeftEditorsInGroupAction, OpenNextEditor, OpenPreviousEditor, NavigateBackwardsAction, NavigateForwardAction, NavigateLastAction, ReopenClosedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, OpenPreviousEditorFromHistoryAction, ShowAllEditorsAction, ClearEditorHistoryAction, ShowEditorsInGroupTwoAction, MoveEditorRightInGroupAction, OpenNextEditorInGroup, OpenPreviousEditorInGroup, OpenNextRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorAction, - ShowEditorsInGroupThreeAction, FocusLastEditorInStackAction, OpenNextRecentlyUsedEditorInGroupAction, MoveEditorToPreviousGroupAction, MoveEditorToNextGroupAction, MoveEditorToFirstGroupAction, MoveEditorToSecondGroupAction, MoveEditorToThirdGroupAction, MoveEditorLeftInGroupAction, ClearRecentFilesAction, OpenLastEditorInGroup + ShowEditorsInGroupThreeAction, FocusLastEditorInStackAction, OpenNextRecentlyUsedEditorInGroupAction, MoveEditorToPreviousGroupAction, MoveEditorToNextGroupAction, MoveEditorToFirstGroupAction, MoveEditorToSecondGroupAction, MoveEditorToThirdGroupAction, MoveEditorLeftInGroupAction, ClearRecentFilesAction, OpenLastEditorInGroup, SplitEditorGroupHorizontalAction, SplitEditorGroupVerticalAction } from 'vs/workbench/browser/parts/editor/editorActions'; import * as editorCommands from 'vs/workbench/browser/parts/editor/editorCommands'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -42,6 +42,9 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { isMacintosh } from 'vs/base/common/platform'; import { GroupOnePicker, GroupTwoPicker, GroupThreePicker, AllEditorsPicker } from 'vs/workbench/browser/parts/editor/editorPicker'; import { Schemas } from 'vs/base/common/network'; +import { GridOpenEditorsAction, GridCloseActiveEditorAction, GridRemoveActiveGroupAction, GridOpenOneEditorAction, NextEditorContribution } from 'vs/workbench/browser/parts/editor2/nextEditorActions'; +import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; +import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; // Register String Editor Registry.as(EditorExtensions.Editors).registerEditor( @@ -433,4 +436,16 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorComman MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: nls.localize('closeEditorsInGroup', "Close All Editors in Group"), category } }); MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_SAVED_EDITORS_COMMAND_ID, title: nls.localize('closeSavedEditors', "Close Saved Editors in Group"), category } }); MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: nls.localize('closeOtherEditors', "Close Other Editors"), category } }); -MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: nls.localize('closeRightEditors', "Close Editors to the Right"), category } }); \ No newline at end of file +MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: nls.localize('closeRightEditors', "Close Editors to the Right"), category } }); + + +// TODO@grid temporary contributions for testing +const gridCategory = nls.localize('grid', "Grid"); +registry.registerWorkbenchAction(new SyncActionDescriptor(GridOpenEditorsAction, GridOpenEditorsAction.ID, GridOpenEditorsAction.LABEL), 'Grid: Open Some Editors', gridCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(GridCloseActiveEditorAction, GridCloseActiveEditorAction.ID, GridCloseActiveEditorAction.LABEL), 'Grid: Close Active Editor', gridCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(GridRemoveActiveGroupAction, GridRemoveActiveGroupAction.ID, GridRemoveActiveGroupAction.LABEL), 'Grid: Remove Active Group', gridCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(GridOpenOneEditorAction, GridOpenOneEditorAction.ID, GridOpenOneEditorAction.LABEL), 'Grid: Open One Editor', gridCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorGroupHorizontalAction, SplitEditorGroupHorizontalAction.ID, SplitEditorGroupHorizontalAction.LABEL), 'Grid: Split Horizontal', gridCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorGroupVerticalAction, SplitEditorGroupVerticalAction.ID, SplitEditorGroupVerticalAction.LABEL), 'Grid: Split Vertical', gridCategory); + +Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NextEditorContribution, LifecyclePhase.Running); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor2/editor2.contribution.ts b/src/vs/workbench/browser/parts/editor2/editor2.contribution.ts deleted file mode 100644 index 48620ed870ca7d9f2091ef104beb3c836735b887..0000000000000000000000000000000000000000 --- a/src/vs/workbench/browser/parts/editor2/editor2.contribution.ts +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * 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 'vs/workbench/browser/parts/editor/editor.contribution'; // TODO@grid merge editor.contribution into this -import { localize } from 'vs/nls'; -import { Registry } from 'vs/platform/registry/common/platform'; -import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; -import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { GridOpenEditorsAction, GridCloseActiveEditorAction, GridRemoveActiveGroupAction, NextEditorContribution, GridOpenOneEditorAction } from 'vs/workbench/browser/parts/editor2/nextEditorActions'; -import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; -import { SplitEditorGroupHorizontalAction, SplitEditorGroupVerticalAction } from 'vs/workbench/browser/parts/editor/editorActions'; - -// Register Next Editor Actions -const category = localize('grid', "Grid"); -const registry = Registry.as(ActionExtensions.WorkbenchActions); -registry.registerWorkbenchAction(new SyncActionDescriptor(GridOpenEditorsAction, GridOpenEditorsAction.ID, GridOpenEditorsAction.LABEL), 'Grid: Open Some Editors', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(GridCloseActiveEditorAction, GridCloseActiveEditorAction.ID, GridCloseActiveEditorAction.LABEL), 'Grid: Close Active Editor', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(GridRemoveActiveGroupAction, GridRemoveActiveGroupAction.ID, GridRemoveActiveGroupAction.LABEL), 'Grid: Remove Active Group', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(GridOpenOneEditorAction, GridOpenOneEditorAction.ID, GridOpenOneEditorAction.LABEL), 'Grid: Open One Editor', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorGroupHorizontalAction, SplitEditorGroupHorizontalAction.ID, SplitEditorGroupHorizontalAction.LABEL), 'Grid: Split Horizontal', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorGroupVerticalAction, SplitEditorGroupVerticalAction.ID, SplitEditorGroupVerticalAction.LABEL), 'Grid: Split Vertical', category); - -// Register Workbench Contribution -Registry.as(WorkbenchExtensions.Workbench).registerWorkbenchContribution(NextEditorContribution, LifecyclePhase.Running); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor2/media/nextTitleControl.css b/src/vs/workbench/browser/parts/editor2/media/nextTitleControl.css index 4f6c5cc51334ba668cceedfb5f7595472415e2b0..226fcffa65ad19427fd68852e873e5ad7f11bb1c 100644 --- a/src/vs/workbench/browser/parts/editor2/media/nextTitleControl.css +++ b/src/vs/workbench/browser/parts/editor2/media/nextTitleControl.css @@ -84,8 +84,6 @@ background: url('close-inverse.svg') center center no-repeat; } -/** TODO@grid revisit the split editor action (vertical-layout/horizontal-layout does not exist anymore) */ - .monaco-workbench > .part.editor > .content .editor-group-container > .title .split-editor-horizontal-action { background: url('split-editor-horizontal.svg') center center no-repeat; } diff --git a/src/vs/workbench/browser/parts/editor2/nextEditorActions.ts b/src/vs/workbench/browser/parts/editor2/nextEditorActions.ts index 4f7c643302b2d7cc42a05d8210d5aa24e6294249..28d02609fd553fb5c083440957226e6411363c56 100644 --- a/src/vs/workbench/browser/parts/editor2/nextEditorActions.ts +++ b/src/vs/workbench/browser/parts/editor2/nextEditorActions.ts @@ -41,7 +41,7 @@ export class GridOpenEditorsAction extends Action { run(): TPromise { const inputs = [ - join(process.cwd(), 'src/vs/workbench/browser/parts/editor2/editor2.contribution.ts'), + join(process.cwd(), 'src/vs/workbench/browser/parts/editor/editor.contribution.ts'), join(process.cwd(), 'src/vs/workbench/browser/parts/editor2/nextEditorActions.ts'), join(process.cwd(), 'src/vs/workbench/browser/parts/editor2/nextEditorGroupView.ts'), join(process.cwd(), 'src/vs/workbench/browser/parts/editor2/nextEditorPart.ts'), diff --git a/src/vs/workbench/browser/parts/editor2/nextEditorPart.ts b/src/vs/workbench/browser/parts/editor2/nextEditorPart.ts index cb7e4af3dd8469178b1d12447c581ed6dcab3c63..d7f3f977c267bf97893527ede79da67a2835ddc5 100644 --- a/src/vs/workbench/browser/parts/editor2/nextEditorPart.ts +++ b/src/vs/workbench/browser/parts/editor2/nextEditorPart.ts @@ -6,7 +6,7 @@ 'use strict'; import 'vs/css!./media/nextEditorpart'; -import 'vs/workbench/browser/parts/editor2/editor2.contribution'; +import 'vs/workbench/browser/parts/editor/editor.contribution'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { Part } from 'vs/workbench/browser/part'; import { Dimension, addClass, isAncestor } from 'vs/base/browser/dom';