src/vs/base/common/labels.ts/getBaseLabel
export function getBaseLabel(resource: URI | string | undefined): string | undefined {
	if (!resource) {
		return undefined;
	}

	if (typeof resource === 'string') {
		resource = URI.file(resource);
	}

	const base = basename(resource) || (resource.scheme === Schemas.file ? resource.fsPath : resource.path) /* can be empty string if '/' is passed in */;

	// convert c: => C:
	if (isWindows && isRootOrDriveLetter(base)) {
		return normalizeDriveLetter(base);
	}

	return base;
}