diff --git a/notifications-sample/package.json b/notifications-sample/package.json index e0960c19..343e73eb 100644 --- a/notifications-sample/package.json +++ b/notifications-sample/package.json @@ -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" } ] }, diff --git a/notifications-sample/src/extension.ts b/notifications-sample/src/extension.ts index 31a427ef..e8e21338 100644 --- a/notifications-sample/src/extension.ts +++ b/notifications-sample/src/extension.ts @@ -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); }