Skip to content

Commit

Permalink
Add "Show All Notifications" command
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddossett committed Jul 29, 2022
1 parent 9a56f0e commit cbfb2f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 8 additions & 1 deletion notifications-sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
}
]
},
Expand Down
12 changes: 11 additions & 1 deletion notifications-sample/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit cbfb2f9

Please sign in to comment.