src/vs/workbench/api/browser/mainThreadMessageService.ts/MainThreadMessageService/_showMessage
class MainThreadMessageService:	private _showMessage(severity: Severity, message: string, commands: { title: string; isCloseAffordance: boolean; handle: number }[], options: MainThreadMessageOptions): Promise<number | undefined> {

		return new Promise<number | undefined>(resolve => {

			const primaryActions: MessageItemAction[] = [];

			class MessageItemAction extends Action {
				constructor(id: string, label: string, handle: number) {
					super(id, label, undefined, true, () => {
						resolve(handle);
						return Promise.resolve();
					});
				}
			}

			class ManageExtensionAction extends Action {
				constructor(id: ExtensionIdentifier, label: string, commandService: ICommandService) {
					super(id.value, label, undefined, true, () => {
						return commandService.executeCommand('_extensions.manage', id.value);
					});
				}
			}

			commands.forEach(command => {
				primaryActions.push(new MessageItemAction('_extension_message_handle_' + command.handle, command.title, command.handle));
			});

			let source: string | { label: string; id: string } | undefined;
			if (options.source) {
				source = {
					label: nls.localize('extensionSource', "{0} (Extension)", options.source.label),
					id: options.source.identifier.value
				};
			}

			if (!source) {
				source = nls.localize('defaultSource', "Extension");
			}

			const secondaryActions: IAction[] = [];
			if (options.source) {
				secondaryActions.push(new ManageExtensionAction(options.source.identifier, nls.localize('manageExtension', "Manage Extension"), this._commandService));
			}

			const messageHandle = this._notificationService.notify({
				severity,
				message,
				actions: { primary: primaryActions, secondary: secondaryActions },
				source
			});

			// if promise has not been resolved yet, now is the time to ensure a return value
			// otherwise if already resolved it means the user clicked one of the buttons
			Event.once(messageHandle.onDidClose)(() => {
				dispose(primaryActions);
				dispose(secondaryActions);
				resolve(undefined);
			});
		});
	}