feat: support keybinding via extensions #198
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
简介
主要变更
Provider
中initWorkbenchActions
的方法,改成通过 extension 的方式注册extensionService
中新增registerAction
方法,用户通过该方法注册 ActionkeybindingHelper
,提供 query 和 convert 方法id
查找对应的全局命令,目前判断是否是全局的方式是通过是否有 when 属性判断,如果无则代表无时无刻都可以执行的命令,则理解为全局命令ISimplyKeybinding
类型转为字符串以供展示id
,因为 query 要通过id
来查找注册的全局命令,这就使得如果注册的 id 和 menu id 如果不保持一致的话,会导致找不到命令,所以有一个强制要求,就是menu
的id
需要和注册的全局事件的id
保持一致components/menu
仅负责渲染,所以要求传入的数据是处理好的数据,已经带有keybinding
。故在 activityBar 和 menuBar 中对 data 进行转化,使得barData => menuData
。activate(extensionCtx){}
拿到extensionCtx
Related Issues
Closed #162