Activation Events - package.json
Extensions are activated lazily in VS Code. As a result you need to provide VS Code with context as to when your extension should be activated. We support the following activation events:
We also provide an overview of the package.json
extension manifest and the minimum required fields.
activationEvents.onLanguage
This activation event is emitted and interested extensions will be activated whenever a file that resolves to a certain language gets opened.
...
"activationEvents": [
"onLanguage:python"
]
...
activationEvents.onCommand
This activation event is emitted and interested extensions will be activated whenever a command is being invoked:
...
"activationEvents": [
"onCommand:extension.sayHello"
]
...
activationEvents.workspaceContains
This activation event is emitted and interested extensions will be activated whenever a folder is opened and the folder contains a top-level file.
...
"activationEvents": [
"workspaceContains:.editorconfig"
]
...
activationEvents.*
This activation event is emitted and interested extensions will be activated whenever VSCode starts up. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case.
...
"activationEvents": [
"*"
]
...
Next Steps
To learn more about VS Code extensibility model, try these topic:
- Extension Manifest File - VS Code package.json extension manifest file reference
- Contribution Points - VS Code contribution points reference
Common Questions
Nothing yet