mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Add "Show All Notifications" command
This commit is contained in:
@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user