src/vs/workbench/browser/parts/statusbar/statusbarPart.ts/StatusbarPart/appendOneStatusbarEntry
class StatusbarPart:	private appendOneStatusbarEntry(itemContainer: HTMLElement, alignment: StatusbarAlignment, priority: IStatusbarEntryPriority): void {
		const entries = this.viewModel.getEntries(alignment);

		if (alignment === StatusbarAlignment.RIGHT) {
			entries.reverse(); // reversing due to flex: row-reverse
		}

		const target = assertIsDefined(alignment === StatusbarAlignment.LEFT ? this.leftItemsContainer : this.rightItemsContainer);

		// find an entry that has lower priority than the new one
		// and then insert the item before that one
		let appended = false;
		for (const entry of entries) {

			// pick a priority that ideally is not the same
			// by falling back to secondary priority
			let existingEntryPriority = entry.priority.primary;
			let newEntryPriority = priority.primary;
			if (existingEntryPriority === newEntryPriority) {
				existingEntryPriority = entry.priority.secondary;
				newEntryPriority = priority.secondary;
			}

			// insert according to priority
			if (
				alignment === StatusbarAlignment.LEFT && existingEntryPriority < newEntryPriority ||
				alignment === StatusbarAlignment.RIGHT && existingEntryPriority > newEntryPriority // reversing due to flex: row-reverse
			) {
				target.insertBefore(itemContainer, entry.container);
				appended = true;
				break;
			}
		}

		// Fallback to just appending otherwise
		if (!appended) {
			target.appendChild(itemContainer);
		}
	}