Skip to content

Command

A class that implements the protocol for commands that can be used via the command palette. These should not be created manually, instead they should be created via the decorator or functional interface.

__init__(name, func, ext, title=None, category=None, keybind=None, when=None)

Initialize a command. Args: name: The internal name of the command. func: The function to register as a command. ext: The extension this command is registered in. title: The title of the command. This is shown in the command palette. category: The category that this command belongs to. keybind: The keybind for this command. when: A condition for when keybinds should be functional.

Context

Represents the context in which a command is being invoked under.

This class is not created manually and is instead passed around to commands as the first parameter.

This class is the python equivalent of the vscode module in the JavaScript API i.e. vscode.window becomes context.window and so on.