Add "Show All Notifications" command

This commit is contained in:
David Dossett
2022-07-29 10:21:21 -07:00
parent 9a56f0e4e5
commit cbfb2f9edc
2 changed files with 19 additions and 2 deletions

View File

@ -15,7 +15,9 @@
"onCommand:notifications-sample.showWarning",
"onCommand:notifications-sample.showWarningWithActions",
"onCommand:notifications-sample.showError",
"onCommand:notifications-sample.showProgress"
"onCommand:notifications-sample.showProgress",
"onCommand:notifications-sample.showAll"
],
"main": "./out/extension.js",
"contributes": {
@ -49,6 +51,11 @@
"command": "notifications-sample.showProgress",
"title": "Show Progress Notification",
"category": "Notifications Sample"
},
{
"command": "notifications-sample.showAll",
"title": "Show All Notifications",
"category": "Notifications Sample"
}
]
},

View File

@ -64,5 +64,15 @@ export function activate(context: vscode.ExtensionContext) {
});
});
context.subscriptions.push(showInfoNotification, showInfoNotificationAsModal, showWarningNotification, showErrorNotification, showProgressNotification, showWarningNotificationWithActions);
// Show all notifications to show do not disturb behavior
const showAllNotifications = vscode.commands.registerCommand('notifications-sample.showAll', () => {
vscode.commands.executeCommand('notifications-sample.showInfo');
vscode.commands.executeCommand('notifications-sample.showWarning');
vscode.commands.executeCommand('notifications-sample.showWarningWithActions');
vscode.commands.executeCommand('notifications-sample.showError');
vscode.commands.executeCommand('notifications-sample.showProgress');
vscode.commands.executeCommand('notifications-sample.showInfoAsModal');
});
context.subscriptions.push(showInfoNotification, showInfoNotificationAsModal, showWarningNotification, showErrorNotification, showProgressNotification, showWarningNotificationWithActions, showAllNotifications);
}