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

    Function defineStatusBarItem

    • Declares a status bar item as part of the application model.

      The item is created when the application activates — visible immediately, without anything having to inject it first — and disposed when the application stops. Handlers inject the controller under definition.token to update it.

      Parameters

      Returns StatusBarItemDefinition

      export const SyncStatus = defineStatusBarItem({
      id: 'sample.syncStatus',
      text: '$(cloud) Idle',
      command: 'sample.sync',
      });

      module.statusBar.add(SyncStatus);

      module.commands.handle(Sync, {
      inject: { status: SyncStatus.token },
      execute: async (context, _args, { status }) => {
      status.setBusy(true);
      try {
      await doSync(context.signal);
      status.update('$(check) Synced');
      } finally {
      status.setBusy(false);
      }
      },
      });