Skip to content
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

Keybinding customization - only shows the keybindings of activated extensions #23356

Closed
egamma opened this issue Mar 28, 2017 · 9 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug keybindings-editor Keybinding editor issues verified Verification succeeded

Comments

@egamma
Copy link
Member

egamma commented Mar 28, 2017

The vscode-tslint extension is contributing key bindings. However, these keybindings are only available for customization in the editor, once the extension is activated and the user has opened a TypeScript file.

The user should be able to customize keybindings independent from whether an extension is activated or not.

@egamma egamma added bug Issue identified by VS Code Team member as probable bug workbench labels Mar 28, 2017
@sandy081 sandy081 added the keybindings VS Code keybinding issues label Mar 28, 2017
@sandy081 sandy081 added this to the March 2017 milestone Mar 28, 2017
@sandy081
Copy link
Member

@jrieken Any idea why the command registry is not having the commands until activation?

@jrieken
Copy link
Member

jrieken commented Mar 30, 2017

@sandy081 The keybinding comes in right on startup (set brk-point here: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts#L482). That binds the identifier of an existing or future command to some key/keycombination.

The command itself, the id->function-thing, comes in when someone called registerCommand, so when becoming active. I don't think you should validate the existing of a function but should just rely on the declarative part.

@sandy081
Copy link
Member

@jrieken Sorry if I am not clear. It's not about keybindings.. its about commands with no keybindings.

When a user open keybindings editor, he does not see those commands without keybindings from an extension which is not active yet. This will confuse the user. Since command are registered descriptively also, is not it possible to get the information from there? I understand that Command registry is a registry of command id -> Function which will not be available until the extension is activated. Do we have some thing like command extension point registry from where we can get descriptive details?

@sandy081
Copy link
Member

Is the MenuRegistry which you mentioned previously will have these details?

@jrieken
Copy link
Member

jrieken commented Mar 30, 2017

Yes, MenuRegistery contains everything an extension defined in the commands section and in the menus section. It is similar to a keybinding as that it registers a user-gesture (selecting a button) to run a command.

@sandy081
Copy link
Member

But there is a catch that this will not give me command description that can tell me that command takes args or not.. Currently I am excluding all commands with args from Keybindings editor.

Also is CommandsRegistry.getCommands() is a sub set of MenuRegistry.getCommands() ?

@jrieken
Copy link
Member

jrieken commented Mar 30, 2017

CommandRegistry holds commands which is a id->Function mapping. MenuRegistry holds menu items/command actions which are ui-description->id mapping. The latter are called commands (ICommandAction) because they invoke commands and I see how that is slight confusing. They have nothing in common, but just join on the id-parts.

command: id -> function // dynamic, involves code

keybinding: key-event-description -> id // declarative
command_action: ui-description -> id // declarative
menu: [command_action, command_action] // declares an arrangement of command_actions

@sandy081
Copy link
Member

Even though MenuRegistry has all registered commands through commands contribution point, it does not tell if these commands take arguments or not. This information is available only after registering to CommandRegistry which happens after extension activation. So, it would be nice if commands contribution point also takes args description.

@jrieken
Copy link
Member

jrieken commented Mar 30, 2017

So, it would be nice if commands contribution point also takes args description.

Then the same applies to the keybindings contribution point

@isidorn isidorn modified the milestones: April 2017, March 2017 Mar 31, 2017
@sandy081 sandy081 modified the milestones: Backlog, April 2017 Apr 25, 2017
@bpasero bpasero removed the workbench label Nov 16, 2017
@sandy081 sandy081 modified the milestones: Backlog, November 2017 Nov 27, 2017
@sandy081 sandy081 added keybindings-editor Keybinding editor issues and removed keybindings VS Code keybinding issues labels Nov 27, 2017
@sandy081 sandy081 modified the milestones: November 2017, December 2017 Dec 4, 2017
@sandy081 sandy081 modified the milestones: January 2018, Backlog Jan 31, 2018
@sandy081 sandy081 modified the milestones: Backlog, September 2018 Sep 14, 2018
@octref octref added the verified Verification succeeded label Sep 26, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug keybindings-editor Keybinding editor issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants