src/vs/platform/extensionManagement/common/extensionsScannerService.ts/AbstractExtensionsScannerService/dedupExtensions
class AbstractExtensionsScannerService:	private dedupExtensions(extensions: IRelaxedScannedExtension[], targetPlatform: TargetPlatform, pickLatest: boolean): IRelaxedScannedExtension[] {
		const result = new Map<string, IRelaxedScannedExtension>();
		for (const extension of extensions) {
			const extensionKey = ExtensionIdentifier.toKey(extension.identifier.id);
			const existing = result.get(extensionKey);
			if (existing) {
				if (existing.isValid && !extension.isValid) {
					continue;
				}
				if (existing.isValid === extension.isValid) {
					if (pickLatest && semver.gt(existing.manifest.version, extension.manifest.version)) {
						this.logService.debug(`Skipping extension ${extension.location.path} with lower version ${extension.manifest.version}.`);
						continue;
					}
					if (semver.eq(existing.manifest.version, extension.manifest.version) && existing.targetPlatform === targetPlatform) {
						this.logService.debug(`Skipping extension ${extension.location.path} from different target platform ${extension.targetPlatform}`);
						continue;
					}
				}
				if (existing.type === ExtensionType.System) {
					this.logService.debug(`Overwriting system extension ${existing.location.path} with ${extension.location.path}.`);
				} else {
					this.logService.warn(`Overwriting user extension ${existing.location.path} with ${extension.location.path}.`);
				}
			}
			result.set(extensionKey, extension);
		}
		return [...result.values()];
	}