src/vs/workbench/browser/parts/statusbar/statusbarPart.ts/StatusbarViewModel/sort
class StatusbarViewModel:	private sort(): void {
		const mapEntryToIndex = new Map<IStatusbarViewModelEntry, number>();
		this._entries.forEach((entry, index) => mapEntryToIndex.set(entry, index));

		this._entries.sort((entryA, entryB) => {
			if (entryA.alignment === entryB.alignment) {
				if (entryA.priority.primary !== entryB.priority.primary) {
					return entryB.priority.primary - entryA.priority.primary; // higher priority towards the left (primary)
				}

				if (entryA.priority.secondary !== entryB.priority.secondary) {
					return entryB.priority.secondary - entryA.priority.secondary; // higher priority towards the left (secondary)
				}

				// otherwise maintain stable order (both values known to be in map)
				return mapEntryToIndex.get(entryA)! - mapEntryToIndex.get(entryB)!;
			}

			if (entryA.alignment === StatusbarAlignment.LEFT) {
				return -1;
			}

			if (entryB.alignment === StatusbarAlignment.LEFT) {
				return 1;
			}

			return 0;
		});
	}