Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/controller/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { SelectColorThemeAction } from 'mo/monaco/selectColorThemeAction';
import { QuickAccessSettings } from 'mo/monaco/quickAccessSettingsAction';
import { SelectLocaleAction } from 'mo/i18n/selectLocaleAction';
import { CommandQuickSideBarViewAction } from 'mo/monaco/quickToggleSideBarAction';
import { ID_SIDE_BAR } from 'mo/common/id';
import { QuickTogglePanelAction } from 'mo/monaco/quickTogglePanelAction';
import { QuickSelectAllAction } from 'mo/monaco/quickSelectAllAction';
import { QuickCopyLineUp } from 'mo/monaco/quickCopyLineUp';
Expand Down Expand Up @@ -48,14 +47,15 @@ export class ExtensionController
quickUndoAction,
quickRedoAction,
quickCreateFileAction,
quickToggleSideBarAction,
} = this.builtinService.getModules();
(
[
[quickAcessViewAction, CommandQuickAccessViewAction],
[quickSelectColorThemeAction, SelectColorThemeAction],
[quickAccessSettingsAction, QuickAccessSettings],
[quickSelectLocaleAction, SelectLocaleAction],
[ID_SIDE_BAR, CommandQuickSideBarViewAction],
[quickToggleSideBarAction, CommandQuickSideBarViewAction],
[quickTogglePanelAction, QuickTogglePanelAction],
[quickSelectAllAction, QuickSelectAllAction],
[quickCopyLineUpAction, QuickCopyLineUp],
Expand Down
4 changes: 2 additions & 2 deletions src/monaco/quickToggleSideBarAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ import {
MenuBarService,
SidebarService,
} from 'mo/services';
import { ID_SIDE_BAR } from 'mo/common/id';
import type { UniqueId } from 'mo/common/types';
import { Action2 } from 'mo/monaco/action';
import { CATEGORIES, KeybindingWeight } from 'mo/monaco/common';
import { constants } from 'mo/services/builtinService/const';

export class CommandQuickSideBarViewAction extends Action2 {
static readonly ID = ID_SIDE_BAR;
static readonly ID = constants.ACTION_QUICK_TOGGLE_SIDE_BAR;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果修改了这个 Action 的 ID,需要额外修改一下 Menu 里对应的,否则 keybinding 会获取失败。

大概在 https://github.com/DTStack/molecule/blob/main/src/services/builtinService/const.ts#L603-L604

static readonly LABEL = localize(
'menu.showSideBar.label',
'Toggle Side Bar Visibility'
Expand Down
5 changes: 5 additions & 0 deletions src/services/builtinService/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const constants = {
ACTION_QUICK_REDO: 'editor.action.redo',
ACTION_QUICK_CREATE_FILE: 'workbench.action.quickCreateFile',
ACTION_QUICK_CREATE_FOLDER: 'workbench.action.quickCreateFolder',
ACTION_QUICK_TOGGLE_SIDE_BAR: 'workbench.action.quickToggleSideBar',
ACTION_QUICK_ACCESS_SETTINGS: 'workbench.action.quickAccessSettings',
ACTION_SELECT_THEME: 'workbench.action.selectTheme',
ACTION_SELECT_LOCALE: 'workbench.action.selectLocale',
Expand Down Expand Up @@ -698,6 +699,10 @@ export const modules = {
id: constants.MENU_VIEW_PANEL,
}),

quickToggleSideBarAction: () => ({
id: constants.ACTION_QUICK_TOGGLE_SIDE_BAR,
}),

quickSelectAllAction: () => ({
id: constants.ACTION_QUICK_SELECT_ALL,
}),
Expand Down