src/vs/base/parts/quickinput/browser/quickInputList.ts/QuickInputList/setElements
class QuickInputList:	setElements(inputElements: Array<IQuickPickItem | IQuickPickSeparator>): void {
		this.elementDisposables = dispose(this.elementDisposables);
		const fireButtonTriggered = (event: IQuickPickItemButtonEvent<IQuickPickItem>) => this.fireButtonTriggered(event);
		this.inputElements = inputElements;
		this.elements = inputElements.reduce((result, item, index) => {
			if (item.type !== 'separator') {
				const previous = index && inputElements[index - 1];
				const saneLabel = item.label && item.label.replace(/\r?\n/g, ' ');
				const saneMeta = item.meta && item.meta.replace(/\r?\n/g, ' ');
				const saneDescription = item.description && item.description.replace(/\r?\n/g, ' ');
				const saneDetail = item.detail && item.detail.replace(/\r?\n/g, ' ');
				const saneAriaLabel = item.ariaLabel || [saneLabel, saneDescription, saneDetail]
					.map(s => getCodiconAriaLabel(s))
					.filter(s => !!s)
					.join(', ');

				const hasCheckbox = this.parent.classList.contains('show-checkboxes');
				result.push(new ListElement({
					hasCheckbox,
					index,
					item,
					saneLabel,
					saneMeta,
					saneAriaLabel,
					saneDescription,
					saneDetail,
					labelHighlights: item.highlights?.label,
					descriptionHighlights: item.highlights?.description,
					detailHighlights: item.highlights?.detail,
					checked: false,
					separator: previous && previous.type === 'separator' ? previous : undefined,
					fireButtonTriggered
				}));
			}
			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, index);
			return map;
		}, new Map<IQuickPickItem, 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);
	}