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

Exposing command keybindings to extensions #196835

Closed
cognominal opened this issue Oct 27, 2023 · 3 comments
Closed

Exposing command keybindings to extensions #196835

cognominal opened this issue Oct 27, 2023 · 3 comments
Labels
api feature-request Request for new features or functionality keybindings VS Code keybinding issues

Comments

@cognominal
Copy link

When wirting an extension, the API does not expose anyway to access a command keybinding.

I want to create an extension that provide with quickpicks the equivalent of https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdf but instead of hardwiring the display of keybindings, I would like to use to get the keybinding given
a command id like so :

let keybinding = keybindingService.getKeybindingForCommand(commandId);

I asked copilot :
given a command id how to get the associated keybinding

Part of the anwswer :

if you're working in an extension and need to get the keybinding for a command, there's currently no direct way to do this. You could potentially read the keybindings JSON file directly, but this would not account for user-specific keybindings or keybindings set by other extensions.

In the meantime I will have to hardcode the keybindings.
On going work on the extension is here : https://github.com/cognominal/vscode-ext-helper-shortcuts

@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality keybindings VS Code keybinding issues
Projects
None yet
Development

No branches or pull requests

4 participants