@codingame/monaco-vscode-notifications-service-override 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-notifications-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -10,21 +10,22 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
|
|
|
10
10
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
11
11
|
|
|
12
12
|
var NotificationService_1;
|
|
13
|
+
const _moduleId = "vs/workbench/services/notification/common/notificationService";
|
|
13
14
|
let NotificationService = class NotificationService extends Disposable {
|
|
14
15
|
static { NotificationService_1 = this; }
|
|
15
16
|
constructor(storageService) {
|
|
16
17
|
super();
|
|
17
18
|
this.storageService = storageService;
|
|
18
|
-
this.model = this._register(( new NotificationsModel()));
|
|
19
|
-
this._onDidAddNotification = this._register(( new Emitter()));
|
|
19
|
+
this.model = this._register(( (new NotificationsModel())));
|
|
20
|
+
this._onDidAddNotification = this._register(( (new Emitter())));
|
|
20
21
|
this.onDidAddNotification = this._onDidAddNotification.event;
|
|
21
|
-
this._onDidRemoveNotification = this._register(( new Emitter()));
|
|
22
|
+
this._onDidRemoveNotification = this._register(( (new Emitter())));
|
|
22
23
|
this.onDidRemoveNotification = this._onDidRemoveNotification.event;
|
|
23
|
-
this._onDidChangeFilter = this._register(( new Emitter()));
|
|
24
|
+
this._onDidChangeFilter = this._register(( (new Emitter())));
|
|
24
25
|
this.onDidChangeFilter = this._onDidChangeFilter.event;
|
|
25
26
|
this.globalFilterEnabled = this.storageService.getBoolean(NotificationService_1.GLOBAL_FILTER_SETTINGS_KEY, -1 , false);
|
|
26
27
|
this.mapSourceToFilter = (() => {
|
|
27
|
-
const map = ( new Map());
|
|
28
|
+
const map = ( (new Map()));
|
|
28
29
|
for (const sourceFilter of this.storageService.getObject(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY, -1 , [])) {
|
|
29
30
|
map.set(sourceFilter.id, sourceFilter);
|
|
30
31
|
}
|
|
@@ -47,7 +48,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
47
48
|
};
|
|
48
49
|
if (e.kind === 0 ) {
|
|
49
50
|
if (isNotificationSource(source)) {
|
|
50
|
-
if (!( this.mapSourceToFilter.has(source.id))) {
|
|
51
|
+
if (!( (this.mapSourceToFilter.has(source.id)))) {
|
|
51
52
|
this.setFilter({ ...source, filter: NotificationsFilter.OFF });
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
@@ -103,15 +104,17 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
saveSourceFilters() {
|
|
106
|
-
this.storageService.store(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY, JSON.stringify([...( this.mapSourceToFilter.values())]), -1 , 1 );
|
|
107
|
+
this.storageService.store(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY, JSON.stringify([...( (this.mapSourceToFilter.values()))]), -1 , 1 );
|
|
107
108
|
}
|
|
108
109
|
getFilters() {
|
|
109
|
-
return [...( this.mapSourceToFilter.values())];
|
|
110
|
+
return [...( (this.mapSourceToFilter.values()))];
|
|
110
111
|
}
|
|
111
112
|
updateFilters() {
|
|
112
113
|
this.model.setFilter({
|
|
113
114
|
global: this.globalFilterEnabled ? NotificationsFilter.ERROR : NotificationsFilter.OFF,
|
|
114
|
-
sources: ( new Map(
|
|
115
|
+
sources: ( (new Map(
|
|
116
|
+
([...( (this.mapSourceToFilter.values()))].map(source => [source.id, source.filter]))
|
|
117
|
+
)))
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
120
|
removeFilter(sourceId) {
|
|
@@ -148,21 +151,19 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
148
151
|
this.model.addNotification({ severity: Severity$1.Error, message });
|
|
149
152
|
}
|
|
150
153
|
notify(notification) {
|
|
151
|
-
const toDispose = ( new DisposableStore());
|
|
154
|
+
const toDispose = ( (new DisposableStore()));
|
|
152
155
|
if (notification.neverShowAgain) {
|
|
153
156
|
const scope = this.toStorageScope(notification.neverShowAgain);
|
|
154
157
|
const id = notification.neverShowAgain.id;
|
|
155
158
|
if (this.storageService.getBoolean(id, scope)) {
|
|
156
|
-
return (
|
|
159
|
+
return (
|
|
160
|
+
(new NoOpNotification())
|
|
161
|
+
);
|
|
157
162
|
}
|
|
158
|
-
const neverShowAgainAction = toDispose.add(( new Action('workbench.notification.neverShowAgain', ( localizeWithPath(
|
|
159
|
-
'vs/workbench/services/notification/common/notificationService',
|
|
160
|
-
'neverShowAgain',
|
|
161
|
-
"Don't Show Again"
|
|
162
|
-
)), undefined, true, async () => {
|
|
163
|
+
const neverShowAgainAction = toDispose.add(( (new Action('workbench.notification.neverShowAgain', ( localizeWithPath(_moduleId, 0, "Don't Show Again")), undefined, true, async () => {
|
|
163
164
|
handle.close();
|
|
164
165
|
this.storageService.store(id, true, scope, 0 );
|
|
165
|
-
})));
|
|
166
|
+
}))));
|
|
166
167
|
const actions = {
|
|
167
168
|
primary: notification.actions?.primary || [],
|
|
168
169
|
secondary: notification.actions?.secondary || []
|
|
@@ -192,19 +193,17 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
prompt(severity, message, choices, options) {
|
|
195
|
-
const toDispose = ( new DisposableStore());
|
|
196
|
+
const toDispose = ( (new DisposableStore()));
|
|
196
197
|
if (options?.neverShowAgain) {
|
|
197
198
|
const scope = this.toStorageScope(options.neverShowAgain);
|
|
198
199
|
const id = options.neverShowAgain.id;
|
|
199
200
|
if (this.storageService.getBoolean(id, scope)) {
|
|
200
|
-
return (
|
|
201
|
+
return (
|
|
202
|
+
(new NoOpNotification())
|
|
203
|
+
);
|
|
201
204
|
}
|
|
202
205
|
const neverShowAgainChoice = {
|
|
203
|
-
label: ( localizeWithPath(
|
|
204
|
-
'vs/workbench/services/notification/common/notificationService',
|
|
205
|
-
'neverShowAgain',
|
|
206
|
-
"Don't Show Again"
|
|
207
|
-
)),
|
|
206
|
+
label: ( localizeWithPath(_moduleId, 0, "Don't Show Again")),
|
|
208
207
|
run: () => this.storageService.store(id, true, scope, 0 ),
|
|
209
208
|
isSecondary: options.neverShowAgain.isSecondary
|
|
210
209
|
};
|
|
@@ -219,7 +218,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
219
218
|
const primaryActions = [];
|
|
220
219
|
const secondaryActions = [];
|
|
221
220
|
choices.forEach((choice, index) => {
|
|
222
|
-
const action = ( new ChoiceAction(`workbench.dialog.choice.${index}`, choice));
|
|
221
|
+
const action = ( (new ChoiceAction(`workbench.dialog.choice.${index}`, choice)));
|
|
223
222
|
if (!choice.isSecondary) {
|
|
224
223
|
primaryActions.push(action);
|
|
225
224
|
}
|
|
@@ -248,8 +247,8 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
248
247
|
return this.model.showStatusMessage(message, options);
|
|
249
248
|
}
|
|
250
249
|
};
|
|
251
|
-
NotificationService = NotificationService_1 = ( __decorate([
|
|
252
|
-
( __param(0, IStorageService))
|
|
253
|
-
], NotificationService));
|
|
250
|
+
NotificationService = NotificationService_1 = ( (__decorate([
|
|
251
|
+
( (__param(0, IStorageService)))
|
|
252
|
+
], NotificationService)));
|
|
254
253
|
|
|
255
254
|
export { NotificationService };
|