-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to read keybindings from 'package.json' file of a plugin #3731
Conversation
Note, currently, only Theia's keybinding contexts are supported to pass through the |
private handlePartialKeybindings(keybinding: Keybinding, partialKeybindings: Keybinding[]) { | ||
partialKeybindings.forEach(partial => { | ||
if (keybinding.context === undefined || keybinding.context === partial.context) { | ||
this.logger.warn('Partial keybinding is ignored;', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usage of Template literals ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benoitf thank you, fixed
if (shadow.context === undefined || shadow.context === keybinding.context) { | ||
this.keybindingRegistry.unregisterKeybinding(shadow); | ||
|
||
this.logger.warn('Shadowing keybinding is ignored;', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems the warning message is the same than on line 51 so maybe we can have only one method ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benoitf
thank you for your comment!
There are two cases:
- the Registry contains
ctrl+g v
keybinding and we try to registerctrl+g
, for example. It is “Partial” case.
IftoRegister
keybinding does not have context or its context equalsregistered
keybinding -toRegister
shadowsregistered
- the Registry contains
ctrl+g
keybinding and we try to registerctrl+g v
, for example. It is “Shadow” case.
Ifregistered
keybinding does not have context or its context equalstoRegister
keybinding -registered
shadowstoRegister.
So we have different conditions, different messages (who is shadow) and may be it’s more readable at the moment.
@benoitf WDYT?
@RomanNikitenko I'm just curious, but did you notice if these keybindings are visible from the |
@vince-fugnitto I added video for this PR - could you take a look? |
sorry I hadn't noticed the link :) it's a very nice feature! |
4934835
to
03f9358
Compare
Signed-off-by: Roman Nikitenko <[email protected]>
03f9358
to
585399d
Compare
Add ability to register keybindings from 'package.json' file of a plugin
Example:
Video: https://youtu.be/Tf6TvlWEZ1Y
Signed-off-by: Roman Nikitenko [email protected]