Merge pull request #7788 from DehanLUO/update-activation-events-note
Update Extension Anatomy with activation events note
This commit is contained in:
Коммит
ffc1787880
|
@ -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`.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче