src/vs/workbench/contrib/debug/browser/variablesView.ts/tryInstallHexEditor
function tryInstallHexEditor(notifications: INotificationService, progressService: IProgressService, extensionService: IExtensionService, commandService: ICommandService) {
	return new Promise<boolean>(resolve => {
		let installing = false;

		const handle = notifications.prompt(
			Severity.Info,
			localize("viewMemory.prompt", "Inspecting binary data requires the Hex Editor extension. Would you like to install it now?"), [
			{
				label: localize("cancel", "Cancel"),
				run: () => resolve(false),
			},
			{
				label: localize("install", "Install"),
				run: async () => {
					installing = true;
					try {
						await progressService.withProgress(
							{
								location: ProgressLocation.Notification,
								title: localize("viewMemory.install.progress", "Installing the Hex Editor..."),
							},
							async () => {
								await commandService.executeCommand('workbench.extensions.installExtension', HEX_EDITOR_EXTENSION_ID);
								// it seems like the extension is not registered immediately on install --
								// wait for it to appear before returning.
								while (!(await extensionService.getExtension(HEX_EDITOR_EXTENSION_ID))) {
									await timeout(30);
								}
							},
						);
						resolve(true);
					} catch (e) {
						notifications.error(e as Error);
						resolve(false);
					}
				}
			},
		],
			{ sticky: true },
		);

		handle.onDidClose(e => {
			if (!installing) {
				resolve(false);
			}
		});
	});
}