Skip to content

Conversation

ziscloud
Copy link

@ziscloud ziscloud commented May 3, 2025

Description

原来注册CommandQuickSideBarViewAction是依据ID_SIDE_BAR,这样是无法禁用CommandQuickSideBarViewAction的,但是在有些场景下是不需要这个action的。

通过添加quickToggleSideBarAction这个builtin module,使得通过经验builtin module达到禁用CommandQuickSideBarViewAction成为可能。

Changes

  • 将 ACTION_QUICK_CREATE_FOLDER常量添加到 const.ts 文件中
  • 在 extension.ts 中导入新的常量并更新相关动作映射
  • 修改 quickToggleSideBarAction.ts 中的 ID 引用,使用新常量替代原有值

ziscloud added 2 commits May 3, 2025 14:49
- 将 ACTION_QUICK_CREATE_FOLDER常量添加到 const.ts 文件中
- 在 extension.ts 中导入新的常量并更新相关动作映射
- 修改 quickToggleSideBarAction.ts 中的 ID 引用,使用新常量替代原有值

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants