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

how to to run an action #225

Closed
nmanumr opened this issue Oct 7, 2016 · 1 comment
Closed

how to to run an action #225

nmanumr opened this issue Oct 7, 2016 · 1 comment
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@nmanumr
Copy link

nmanumr commented Oct 7, 2016

as monaco have already too many actions provided in actionbar how can i trigger these action and also the actions that are custom defined.
For example we have an action "Add Cursor Above". I want to trigger is pragmatically and also want to disable action bar means nothing will happen if "F1" is pressed.

@nmanumr
Copy link
Author

nmanumr commented Oct 7, 2016

Sorry , I found the answer:

editor.getActions() // returns all actions
editor.getAction([id]) // returns action by id

But one thing more How to get key binding for example we have following data returned from getAction method

_actual : t
_contextKeyService : t
_editor : t
_instantiationService : t
alias : "Toggle Line Comment"
id : "editor.action.commentLine"
label : "Toggle Line Comment"
__proto__ : e

here we have every thing but where is the shortcut key that we define using keybindings while defining an action.

@alexdima alexdima added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Dec 12, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 26, 2020
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