@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface RegistrationScope

    Owns registrations that must be released synchronously, so that stopping the host closes ingress immediately: no new command invocation or event callback can arrive after dispose() returns.

    Use this for command registrations, event subscriptions, view registrations and watchers. Anything needing async teardown belongs in a ResourceScope.

    const scope = createRegistrationScope('projects');
    scope.own(vscode.commands.registerCommand('sample.refresh', handler));
    scope.dispose(); // command is gone before this returns
    interface RegistrationScope {
        disposed: boolean;
        name: string;
        size: number;
        attach(child: RegistrationScope): void;
        defer(cleanup: () => void): void;
        detachedChild(name: string): RegistrationScope;
        dispose(): void;
        inspect(): ScopeInspection;
        own<T extends Registration>(registration: T): T;
    }
    Index
    disposed: boolean

    Whether dispose() has already run.

    name: string

    Diagnostic name, including the parent path for child scopes.

    size: number

    Number of cleanup entries still held. Framework-owned leak gates read this.

    • Registers a synchronous cleanup callback. It runs in LIFO order with owned registrations, or immediately when the scope is already disposed.

      Parameters

      • cleanup: () => void

      Returns void

    • Disposes every entry in LIFO order.

      A single failure never stops the remaining entries; all failures are collected and thrown together as a ScopeCleanupError. Repeated calls after the first are no-ops.

      Returns void

    • Takes ownership of a registration and returns it unchanged.

      Registering into an already-disposed scope disposes the registration immediately rather than leaking it. An exception from that immediate disposal propagates to the caller.

      A dispose() that returns a promise is rejected: this scope's whole purpose is that teardown has finished by the time it returns. Own such a resource in a ResourceScope instead.

      Type Parameters

      Parameters

      • registration: T

      Returns T