@codingame/monaco-vscode-notifications-service-override 9.0.2 → 10.0.0
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": "
|
|
3
|
+
"version": "10.0.0",
|
|
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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,12 +2,10 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { isNotificationSource, NotificationsFilter, NoOpNotification, NeverShowAgainScope } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
4
4
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
|
-
import { NotificationsModel,
|
|
5
|
+
import { NotificationsModel, ChoiceAction } from 'vscode/vscode/vs/workbench/common/notifications';
|
|
6
6
|
import { Disposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
7
7
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
8
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
9
8
|
import { Action } from 'vscode/vscode/vs/base/common/actions';
|
|
10
|
-
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
11
9
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
12
10
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
13
11
|
|
|
@@ -24,10 +22,10 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
24
22
|
this.onDidRemoveNotification = this._onDidRemoveNotification.event;
|
|
25
23
|
this._onDidChangeFilter = this._register(( (new Emitter())));
|
|
26
24
|
this.onDidChangeFilter = this._onDidChangeFilter.event;
|
|
27
|
-
this.globalFilterEnabled = this.storageService.getBoolean(NotificationService_1.GLOBAL_FILTER_SETTINGS_KEY,
|
|
25
|
+
this.globalFilterEnabled = this.storageService.getBoolean(NotificationService_1.GLOBAL_FILTER_SETTINGS_KEY, -1 , false);
|
|
28
26
|
this.mapSourceToFilter = (() => {
|
|
29
27
|
const map = ( (new Map()));
|
|
30
|
-
for (const sourceFilter of this.storageService.getObject(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY,
|
|
28
|
+
for (const sourceFilter of this.storageService.getObject(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY, -1 , [])) {
|
|
31
29
|
map.set(sourceFilter.id, sourceFilter);
|
|
32
30
|
}
|
|
33
31
|
return map;
|
|
@@ -38,8 +36,8 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
38
36
|
registerListeners() {
|
|
39
37
|
this._register(this.model.onDidChangeNotification(e => {
|
|
40
38
|
switch (e.kind) {
|
|
41
|
-
case
|
|
42
|
-
case
|
|
39
|
+
case 0 :
|
|
40
|
+
case 3 : {
|
|
43
41
|
const source = typeof e.item.sourceId === 'string' && typeof e.item.source === 'string' ? { id: e.item.sourceId, label: e.item.source } : e.item.source;
|
|
44
42
|
const notification = {
|
|
45
43
|
message: e.item.message.original,
|
|
@@ -47,7 +45,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
47
45
|
source,
|
|
48
46
|
priority: e.item.priority
|
|
49
47
|
};
|
|
50
|
-
if (e.kind ===
|
|
48
|
+
if (e.kind === 0 ) {
|
|
51
49
|
if (isNotificationSource(source)) {
|
|
52
50
|
if (!( (this.mapSourceToFilter.has(source.id)))) {
|
|
53
51
|
this.setFilter({ ...source, filter: NotificationsFilter.OFF });
|
|
@@ -58,7 +56,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
58
56
|
}
|
|
59
57
|
this._onDidAddNotification.fire(notification);
|
|
60
58
|
}
|
|
61
|
-
if (e.kind ===
|
|
59
|
+
if (e.kind === 3 ) {
|
|
62
60
|
this._onDidRemoveNotification.fire(notification);
|
|
63
61
|
}
|
|
64
62
|
break;
|
|
@@ -74,7 +72,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
74
72
|
return;
|
|
75
73
|
}
|
|
76
74
|
this.globalFilterEnabled = filter === NotificationsFilter.ERROR;
|
|
77
|
-
this.storageService.store(NotificationService_1.GLOBAL_FILTER_SETTINGS_KEY, this.globalFilterEnabled,
|
|
75
|
+
this.storageService.store(NotificationService_1.GLOBAL_FILTER_SETTINGS_KEY, this.globalFilterEnabled, -1 , 1 );
|
|
78
76
|
this.updateFilters();
|
|
79
77
|
this._onDidChangeFilter.fire();
|
|
80
78
|
}
|
|
@@ -105,7 +103,7 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
105
|
saveSourceFilters() {
|
|
108
|
-
this.storageService.store(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY, JSON.stringify([...( (this.mapSourceToFilter.values()))]),
|
|
106
|
+
this.storageService.store(NotificationService_1.PER_SOURCE_FILTER_SETTINGS_KEY, JSON.stringify([...( (this.mapSourceToFilter.values()))]), -1 , 1 );
|
|
109
107
|
}
|
|
110
108
|
getFilters() {
|
|
111
109
|
return [...( (this.mapSourceToFilter.values()))];
|
|
@@ -161,9 +159,9 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
161
159
|
(new NoOpNotification())
|
|
162
160
|
);
|
|
163
161
|
}
|
|
164
|
-
const neverShowAgainAction = toDispose.add(( (new Action('workbench.notification.neverShowAgain', ( localize(
|
|
162
|
+
const neverShowAgainAction = toDispose.add(( (new Action('workbench.notification.neverShowAgain', ( localize(3188, "Don't Show Again")), undefined, true, async () => {
|
|
165
163
|
handle.close();
|
|
166
|
-
this.storageService.store(id, true, scope,
|
|
164
|
+
this.storageService.store(id, true, scope, 0 );
|
|
167
165
|
}))));
|
|
168
166
|
const actions = {
|
|
169
167
|
primary: notification.actions?.primary || [],
|
|
@@ -184,13 +182,13 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
184
182
|
toStorageScope(options) {
|
|
185
183
|
switch (options.scope) {
|
|
186
184
|
case NeverShowAgainScope.APPLICATION:
|
|
187
|
-
return
|
|
185
|
+
return -1 ;
|
|
188
186
|
case NeverShowAgainScope.PROFILE:
|
|
189
|
-
return
|
|
187
|
+
return 0 ;
|
|
190
188
|
case NeverShowAgainScope.WORKSPACE:
|
|
191
|
-
return
|
|
189
|
+
return 1 ;
|
|
192
190
|
default:
|
|
193
|
-
return
|
|
191
|
+
return -1 ;
|
|
194
192
|
}
|
|
195
193
|
}
|
|
196
194
|
prompt(severity, message, choices, options) {
|
|
@@ -204,8 +202,8 @@ let NotificationService = class NotificationService extends Disposable {
|
|
|
204
202
|
);
|
|
205
203
|
}
|
|
206
204
|
const neverShowAgainChoice = {
|
|
207
|
-
label: ( localize(
|
|
208
|
-
run: () => this.storageService.store(id, true, scope,
|
|
205
|
+
label: ( localize(3188, "Don't Show Again")),
|
|
206
|
+
run: () => this.storageService.store(id, true, scope, 0 ),
|
|
209
207
|
isSecondary: options.neverShowAgain.isSecondary
|
|
210
208
|
};
|
|
211
209
|
if (!options.neverShowAgain.isSecondary) {
|