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

    Function toPickItem

    • Builds a type-safe PickItem from a value and its display options. Keeps the value your code cares about separate from the label string the user sees, so callers never need to parse a label back into data.

      Type Parameters

      • T

      Parameters

      • value: T

        The value to return when this item is selected

      • display: PickItemDisplay

        Label, description, icon, and other display options

      Returns PickItem<T>

      A quick pick item carrying value

      const items = [
      toPickItem('feature', { label: 'Feature', description: 'New feature' }),
      toPickItem('fix', { label: 'Bug Fix', description: 'Fix a bug', icon: 'bug' }),
      ];
      const selected = await pickOne(items);
      if (selected) {
      console.log(selected.value); // 'feature' | 'fix', not a label string
      }