Merge pull request #7788 from DehanLUO/update-activation-events-note

Update Extension Anatomy with activation events note
This commit is contained in:
Nick Trogh 2024-11-18 13:13:48 +01:00 коммит произвёл GitHub
Родитель 25f3df4072 37e4fa5ae3
Коммит ffc1787880
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -14,6 +14,7 @@ In the last topic, you were able to get a basic extension running. How does it w
The `Hello World` extension does 3 things:
- Registers the [`onCommand`](/api/references/activation-events#onCommand) [**Activation Event**](/api/references/activation-events): `onCommand:helloworld.helloWorld`, so the extension becomes activated when user runs the `Hello World` command.
> **Note:** Starting with [VS Code 1.74.0](https://code.visualstudio.com/updates/v1_74#_implicit-activation-events-for-declared-extension-contributions), commands declared in the `commands` section of `package.json` automatically activate the extension when invoked, without requiring an explicit `onCommand` entry in `activationEvents`.
- Uses the [`contributes.commands`](/api/references/contribution-points#contributes.commands) [**Contribution Point**](/api/references/contribution-points) to make the command `Hello World` available in the Command Palette, and bind it to a command ID `helloworld.helloWorld`.
- Uses the [`commands.registerCommand`](/api/references/vscode-api#commands.registerCommand) [**VS Code API**](/api/references/vscode-api) to bind a function to the registered command ID `helloworld.helloWorld`.