An object that maintains subscriptions to resources that should be freed when the extension is deactivated.
When an extension is deactivated, first its exported deactivate
function is called (if one exists).
The deactivate
function may be async, in which case deactivation blocks on it finishing. Next,
regardless of whether the deactivate
function finished successfully or rejected with an error, all
unsubscribables passed to {@link ExtensionContext#subscriptions#add} are unsubscribed from.
(An extension is deactivated when the user disables it, or after an arbitrary time period if its activationEvents no longer evaluate to true.)
Mark a resource's teardown function to be called when the extension is deactivated.
Generated using TypeDoc
The extension context is passed to the extension's activate function and contains utilities for the extension lifecycle.
Sourcegraph 3.0. Use
export function activate(ctx?: ExtensionContext) { ... }
for prior versions (to ensure your code handles the pre-3.0-preview case whenctx
is undefined).