You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/plugin-ext/doc/how-to-add-new-custom-plugin-api.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,6 +260,16 @@ import * as foo from '@bar/foo';
260
260
foo.fooBar.getFoo();
261
261
```
262
262
263
+
## Adding custom plugin activation events
264
+
265
+
When creating a custom plugin API there may also arise a need to trigger the activation of your plugins at a certain point in time.
266
+
The events that trigger the activation of a plugin are simply called `activation events`.
267
+
By default Theia supports a set of built-in activation events that contains the [activation events from VS Code](https://code.visualstudio.com/api/references/activation-events) as well as some additional Theia-specific events.
268
+
Technically, an activation event is nothing more than a unique string fired at a specific point in time.
269
+
To add more flexibility to activations events, Theia allows you to provide additional custom activation events when initializing a plugin host.
270
+
These additional events can be specified by adopters through the `ADDITIONAL_ACTIVATION_EVENTS` environment variable.
271
+
To fire an activation event, you need to call the plugin hosts `$activateByEvent(eventName)` method.
272
+
263
273
## Packaging
264
274
265
275
When bundling our application with the generated `gen-webpack.node.config.js` we need to make sure that our initialization function is bundled as a `commonjs2` library so it can be dynamically loaded.
0 commit comments