src/vs/workbench/services/label/common/labelService.ts/LabelService/doGetUriLabel
class LabelService:	private doGetUriLabel(resource: URI, formatting?: ResourceLabelFormatting, options: { relative?: boolean; noPrefix?: boolean; endWithSeparator?: boolean } = {}): string {
		if (!formatting) {
			return getPathLabel(resource.path, { userHome: this.pathService.resolvedUserHome }, options.relative ? this.contextService : undefined);
		}

		let label: string | undefined;
		const baseResource = this.contextService?.getWorkspaceFolder(resource);

		if (options.relative && baseResource) {
			const baseResourceLabel = this.formatUri(baseResource.uri, formatting, options.noPrefix);
			let relativeLabel = this.formatUri(resource, formatting, options.noPrefix);

			let overlap = 0;
			while (relativeLabel[overlap] && relativeLabel[overlap] === baseResourceLabel[overlap]) { overlap++; }
			if (!relativeLabel[overlap] || relativeLabel[overlap] === formatting.separator) {
				relativeLabel = relativeLabel.substring(1 + overlap);
			} else if (overlap === baseResourceLabel.length && baseResource.uri.path === '/') {
				relativeLabel = relativeLabel.substring(overlap);
			}

			const hasMultipleRoots = this.contextService.getWorkspace().folders.length > 1;
			if (hasMultipleRoots && !options.noPrefix) {
				const rootName = baseResource?.name ?? basenameOrAuthority(baseResource.uri);
				relativeLabel = relativeLabel ? (rootName + ' • ' + relativeLabel) : rootName; // always show root basename if there are multiple
			}

			label = relativeLabel;
		} else {
			label = this.formatUri(resource, formatting, options.noPrefix);
		}

		return options.endWithSeparator ? this.appendSeparatorIfMissing(label, formatting) : label;
	}