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

    Function withPagination

    • Caps a children array at pageSize, appending a "Load more…" placeholder item when there's more data than that.

      Useful when a lazily-loaded node (e.g. a directory with tens of thousands of files) would otherwise force VS Code to serialize an enormous array across the extension host boundary in one call.

      Pass a command and the placeholder is clickable on its own. Without one it's inert, and getChildrenOf has to recognize element.id === LOAD_MORE_ID itself.

      Type Parameters

      Parameters

      • items: T[]

        The full list of children for this level

      • pageSize: number

        Positive maximum number of real items to show before paginating. The helper does not normalize invalid sizes.

      • options: string | PaginationOptions = {}

        Placeholder label, command, and icon. A bare string is accepted in place of the object as shorthand for { label }.

      Returns T[]

      return withPagination(allFiles, 500, {
      label: l10n.t('Load more…'),
      command: { command: 'myext.loadMore', title: l10n.t('Load more…') },
      });