vscode-docs
vscode-docs copied to clipboard
Document all commands that support passing arguments
This page has a list of commands: https://code.visualstudio.com/api/references/commands
All of them can be executed from extension with vscode.commands.executeCommand
, but some of them can be used from keybindings.json
file with "args", like vscode.setEditorLayout
or editorScroll
. The list is not complete, though.
I think this page should contain all commands that accept arguments.
2 notes:
-
keybindings.json
: not possible to run some commands likevscode.openFolder
- extension api: For specific commands api would be a preferable choice
For instance, there is a command that supports accepting args
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "npm run build\r"
},
"when": "terminalFocus"
},
And it's pretty useful for users, but if you are an extension author - then the api Terminal.sendText()
is most likely what you need.
Commands to add:
-
workbench.action.tasks.runTask
-
workbench.action.terminal.sendSequence
-
workbench.action.terminal.newWithCwd
-
workbench.action.openGlobalKeybindings
-
workbench.action.openSettings
-
workbench.action.quickOpen
-
editor.action.codeAction
-
editor.action.refactor
-
editor.action.sourceAction
-
editor.action.insertSnippet
-
type
-
workbench.action.findInFiles
-
search.action.openNewEditor
-
vscode.commands.executeCommand('workbench.action.openWalkthrough', 'jakearl.md-to-html#exampleProject', true)
-
revealFileInOS
<= maybe only extension api -
workbench.extensions.command.installFromVSIX
<= (only extension api)
This is not a complete list, only those known to me.
Related to #683
My terminal is suddenly not opening to the current project (zsh / mac). I keep reading about newWithCwd
. But there is no keybinding with the when
equal to workbench.action.terminal.newWithCwd
and i dont know how to add one. any help is appriciated.
https://stackoverflow.com/questions/55668151/how-to-change-the-terminal-to-the-current-directory-in-visual-studio-code-hot