Skip to content

Document all commands that support passing arguments #4298

Open
@usernamehw

Description

@usernamehw

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:

  1. keybindings.json: not possible to run some commands like vscode.openFolder
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions