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

Extensions: appending command to key binding #16402

Closed
apazureck opened this issue Dec 2, 2016 · 2 comments
Closed

Extensions: appending command to key binding #16402

apazureck opened this issue Dec 2, 2016 · 2 comments
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@apazureck
Copy link

VSCode Version 1.7

Hello,

I cannot find any documentation on that topic:

I would like to append a command to a key binding. Using the keybindings contribution of my extension seems to override the default command binding. I would like to implement a go to definition command (f12), which should be fired after the original at best (or if it fails).

"keybindings": [ {
        "command": "ui5ts.GoToDefinition",
        "key": "f12",
        "when": "editorTextFocus"
}, ... ]

Is the default behavior to override the key binding when adding a keybindings contribution? I read they are executed from "bottom to top", so I guess my command is executed first. Is the rest not fired, if my "when" is called first?

See also:
http://stackoverflow.com/questions/40927851/appending-a-command-to-a-already-existing-keybinding

@chrmarti
Copy link
Contributor

chrmarti commented Dec 2, 2016

You could register a DefinitionProvider to do that. (See vscode.d.ts or https://code.visualstudio.com/Docs/extensionAPI/vscode-api.)

@chrmarti chrmarti closed this as completed Dec 2, 2016
@chrmarti chrmarti added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Dec 2, 2016
@apazureck
Copy link
Author

ok, thanks, that really makes more sense.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants