When having details for non modal, show more which shows modal... https://github.com/microsoft/vscode/issues/125750

This commit is contained in:
Johannes Rieken
2021-06-16 15:09:18 +02:00
parent b81e9c4b95
commit fbe6292824
2 changed files with 9 additions and 4 deletions

View File

@@ -35,11 +35,11 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape {
if (options.modal) {
return this._showModalMessage(severity, message, options.detail, commands, options.useCustom);
} else {
return this._showMessage(severity, message, commands, options.extension);
return this._showNotificationMessage(severity, message, options.detail, commands, options.extension);
}
}
private _showMessage(severity: Severity, message: string, commands: { title: string; isCloseAffordance: boolean; handle: number; }[], extension: IExtensionDescription | undefined): Promise<number | undefined> {
private _showNotificationMessage(severity: Severity, message: string, detail: string | undefined, commands: { title: string; isCloseAffordance: boolean; handle: number; }[], extension: IExtensionDescription | undefined): Promise<number | undefined> {
return new Promise<number | undefined>(resolve => {
@@ -66,6 +66,12 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape {
primaryActions.push(new MessageItemAction('_extension_message_handle_' + command.handle, command.title, command.handle));
});
if (detail) {
primaryActions.push(new Action('more', nls.localize('details', "More"), undefined, true, () => {
this._showModalMessage(severity, message, detail, commands, false);
}));
}
let source: string | { label: string, id: string } | undefined;
if (extension) {
source = {