src/vs/base/parts/quickinput/browser/quickInputList.ts/QuickInputList/setElements
class QuickInputList:	setElements(inputElements: Array<QuickPickItem>): void {
		this.elementDisposables = dispose(this.elementDisposables);
		const fireButtonTriggered = (event: IQuickPickItemButtonEvent<IQuickPickItem>) => this.fireButtonTriggered(event);
		const fireSeparatorButtonTriggered = (event: IQuickPickSeparatorButtonEvent) => this.fireSeparatorButtonTriggered(event);
		this.inputElements = inputElements;
		this.elements = inputElements.reduce((result, item, index) => {
			const previous = index && inputElements[index - 1];
			const saneLabel = item.label ? item.label.replace(/\r?\n/g, ' ') : '';
			const saneSortLabel = parseLabelWithIcons(saneLabel).text.trim();

			let saneMeta, saneDescription, saneDetail, labelHighlights, descriptionHighlights, detailHighlights;
			if (item.type !== 'separator') {
				saneMeta = item.meta && item.meta.replace(/\r?\n/g, ' ');
				saneDescription = item.description && item.description.replace(/\r?\n/g, ' ');
				saneDetail = item.detail && item.detail.replace(/\r?\n/g, ' ');
				labelHighlights = item.highlights?.label;
				descriptionHighlights = item.highlights?.description;
				detailHighlights = item.highlights?.detail;
			}
			const saneAriaLabel = item.ariaLabel || [saneLabel, saneDescription, saneDetail]
				.map(s => getCodiconAriaLabel(s))
				.filter(s => !!s)
				.join(', ');

			const hasCheckbox = this.parent.classList.contains('show-checkboxes');

			let separator: IQuickPickSeparator | undefined;
			if (item.type === 'separator') {
				if (!item.buttons) {
					// This separator will be rendered as a part of the list item
					return result;
				}
				separator = item;
			} else if (previous && previous.type === 'separator' && !previous.buttons) {
				separator = previous;
			}

			result.push(new ListElement({
				hasCheckbox,
				index,
				item: item.type !== 'separator' ? item : undefined,
				saneLabel,
				saneSortLabel,
				saneMeta,
				saneAriaLabel,
				saneDescription,
				saneDetail,
				labelHighlights,
				descriptionHighlights,
				detailHighlights,
				checked: false,
				separator,
				fireButtonTriggered,
				fireSeparatorButtonTriggered
			}));
			return result;
		}, [] as ListElement[]);
		this.elementDisposables.push(...this.elements);
		this.elementDisposables.push(...this.elements.map(element => element.onChecked(() => this.fireCheckedEvents())));

		this.elementsToIndexes = this.elements.reduce((map, element, index) => {
			map.set(element.item ?? element.separator!, index);
			return map;
		}, new Map<QuickPickItem, number>());
		this.list.splice(0, this.list.length); // Clear focus and selection first, sending the events when the list is empty.
		this.list.splice(0, this.list.length, this.elements);
		this._onChangedVisibleCount.fire(this.elements.length);
	}