Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace for dealing with installed plug-ins. Plug-ins are represented by an plug-in-interface which enables reflection on them.

Plug-in writers can provide APIs to other plug-ins by returning their API public surface from the start-call.

export function start() {
    let api = {
        sum(a, b) {
            return a + b;
        },
        mul(a, b) {
            return a * b;
        }
    };
    // 'export' public api-surface
    return api;
}
let mathExt = plugins.getPlugin('genius.math');
let importedApi = mathExt.exports;

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

Index

Variables

Functions

Variables

Let all

all: Plugin<any>[]

All plug-ins currently known to the system.

Let onDidChange

onDidChange: Event<void>

An event which fires when plugins.all changes. This can happen when extensions are installed, uninstalled, enabled or disabled.

Functions

getPlugin

  • getPlugin(pluginId: string): Plugin<any> | undefined
  • getPlugin<T>(pluginId: string): Plugin<T> | undefined
  • Get an plug-in by its full identifier in the form of: publisher.name.

    Parameters

    • pluginId: string

      An plug-in identifier.

    Returns Plugin<any> | undefined

    An plug-in or undefined.

  • Get an plug-in its full identifier in the form of: publisher.name.

    Type parameters

    • T

    Parameters

    • pluginId: string

      An plug-in identifier.

    Returns Plugin<T> | undefined

    An plug-in or undefined.