src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts/ExtensionEnablementService/getExtensionsToEnableRecursively
class ExtensionEnablementService:	private getExtensionsToEnableRecursively(extensions: IExtension[], allExtensions: ReadonlyArray<IExtension>, enablementState: EnablementState, options: { dependencies: boolean; pack: boolean }, checked: IExtension[] = []): IExtension[] {
		const toCheck = extensions.filter(e => checked.indexOf(e) === -1);
		if (toCheck.length) {
			for (const extension of toCheck) {
				checked.push(extension);
			}
			const extensionsToDisable = allExtensions.filter(i => {
				if (checked.indexOf(i) !== -1) {
					return false;
				}
				if (this.getEnablementState(i) === enablementState) {
					return false;
				}
				return (options.dependencies || options.pack)
					&& extensions.some(extension =>
						(options.dependencies && extension.manifest.extensionDependencies?.some(id => areSameExtensions({ id }, i.identifier)))
						|| (options.pack && extension.manifest.extensionPack?.some(id => areSameExtensions({ id }, i.identifier)))
					);
			});
			if (extensionsToDisable.length) {
				extensionsToDisable.push(...this.getExtensionsToEnableRecursively(extensionsToDisable, allExtensions, enablementState, options, checked));
			}
			return extensionsToDisable;
		}
		return [];
	}