Skip to main content

Interface: IExtensionsApi

Defined in: Extensions/ExtensionApiTypes.ts:734

The narrow surface (no events, no streaming) is intentional. If two extensions need a tighter coupling, they can both depend on a third extension that owns the shared state.

Properties

onDidActivate

onDidActivate: IEventApi<{ extensionId: string; }>

Defined in: Extensions/ExtensionApiTypes.ts:757


onDidDeactivate

onDidDeactivate: IEventApi<{ extensionId: string; }>

Defined in: Extensions/ExtensionApiTypes.ts:758

Methods

call()

call<T>(extensionId, method, args?): Promise<T>

Defined in: Extensions/ExtensionApiTypes.ts:745

Call a method another extension has exported via contributes.apiExports. Requires extensions:call permission. The host validates the call against the callee's manifest — undeclared methods reject with ApiExportNotFoundError.

Calls are mediated by the host (worker A → host → worker B) so neither extension can crash the other. Arguments and return values must be JSON-serializable.

Type Parameters

T

T = unknown

Parameters

extensionId

string

method

string

args?

unknown[]

Returns

Promise<T>


isActive()

isActive(extensionId): Promise<boolean>

Defined in: Extensions/ExtensionApiTypes.ts:752

True if an extension is installed and active.

Parameters

extensionId

string

Returns

Promise<boolean>


listProviders()

listProviders(): Promise<ExtensionProviderInfo[]>

Defined in: Extensions/ExtensionApiTypes.ts:755

List extensions that export at least one API method.

Returns

Promise<ExtensionProviderInfo[]>