Skip to content

Extension

Represents a vscode extension.

command(name=None, title=None, category=None, keybind=None, when=None)

A decorator for registering commands. Args: name: The internal name of the command. title: The title of the command. This is shown in the command palette. category: The category that this command belongs to. Default categories set by Extensions will be overriden if this is not None. False should be passed in order to override a default category. keybind: The keybind for this command. when: A condition for when keybinds should be functional.

event(func)

A decorator for registering event handlers.

register_command(func, name=None, title=None, category=None, keybind=None, when=None)

Register a command. This is usually not called, instead the command() shortcut decorators should be used instead. Args: func: The function to register as a command. name: The internal name of the command. title: The title of the command. This is shown in the command palette. category: The category that this command belongs to. Default categories set by Extensions will be overriden if this is not None. False should be passed in order to override a default category. keybind: The keybind for this command. when: A condition for when keybinds should be functional.

register_keybind(command)

A method called internally to register a keybind.

set_default_category(category)

Set a default category for new commands. Args: category: The name of the default category.