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

    Interface StatusBarService

    Short-lived status bar messages.

    Distinct from defineStatusBarItem, which declares an item the extension owns and keeps updating — a sync indicator, a line count. This is for the other case: "Copied.", "History cleared." — text that appears, says one thing, and goes away. Flashing that through a declared item would clobber whatever the item was showing, and declaring an item per message would leave the caller disposing it on a timer.

    module.commands.handle(Copy, {
    inject: { status: StatusBar },
    execute: async (_context, _args, { status }) => {
    await copy();
    status.flash('$(clippy) Copied');
    },
    });
    interface StatusBarService {
        flash(text: string, durationMs?: number): { dispose(): void };
    }
    Index
    • Shows text for a while, then removes it.

      A second flash replaces the first rather than queueing behind it: the newer message is the current truth, and a queue would show stale text. Early-dismiss handles are guarded by displayed text; when two consecutive flashes use identical text, treat the earlier handle as superseded rather than disposing it.

      Parameters

      • text: string

        What to show. Supports $(icon) syntax.

      • OptionaldurationMs: number

        How long to show it. Defaults to 3000 ms.

      Returns { dispose(): void }

      A handle that ends the message early. Idempotent.