src/vs/base/browser/ui/list/listWidget.ts/Trait/splice
class Trait:	splice(start: number, deleteCount: number, elements: boolean[]): void {
		deleteCount = Math.max(0, Math.min(deleteCount, this.length - start));

		const diff = elements.length - deleteCount;
		const end = start + deleteCount;
		const sortedIndexes = [
			...this.sortedIndexes.filter(i => i < start),
			...elements.map((hasTrait, i) => hasTrait ? i + start : -1).filter(i => i !== -1),
			...this.sortedIndexes.filter(i => i >= end).map(i => i + diff)
		];

		const length = this.length + diff;

		if (this.sortedIndexes.length > 0 && sortedIndexes.length === 0 && length > 0) {
			const first = this.sortedIndexes.find(index => index >= start) ?? length - 1;
			sortedIndexes.push(Math.min(first, length - 1));
		}

		this.renderer.splice(start, deleteCount, elements.length);
		this._set(sortedIndexes, sortedIndexes);
		this.length = length;
	}