Link Search Menu Expand Document

Extensions

=== API

Properties

all

  • return: ReadonlyArray<Extension>

all extensions

Methods

getExtension

  • params: (extensionId: string): Extension<any> | undefined

=== Cook

Import from another extension

export function activate(context: vscode.ExtensionContext) {
    let api = {
        sum(a, b) {
            return a + b;
        },
        mul(a, b) {
            return a * b;
        }
    };
    // 'export' public api-surface
    return api;
}

let mathExt = extensions.getExtension('genius.math');
let importedApi = mathExt.exports;

console.log(importedApi.mul(42, 1));