@codingame/monaco-vscode-markers-service-override 1.82.4 → 1.82.5-next.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.
@@ -0,0 +1,3 @@
1
+ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
2
+
3
+ export { n as default };
@@ -0,0 +1,11 @@
1
+ function __decorate(decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ }
7
+ function __param(paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ }
10
+
11
+ export { __decorate, __param };
package/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { default } from 'vscode/service-override/markers'
1
+ export { default } from './markers.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- export { default } from 'vscode/service-override/markers'
1
+ export { default } from './markers.js';
package/markers.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { IEditorOverrideServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
2
+
3
+ declare function getServiceOverride(): IEditorOverrideServices;
4
+
5
+ export { getServiceOverride as default };
package/markers.js ADDED
@@ -0,0 +1,7 @@
1
+ import './vscode/src/vs/workbench/contrib/markers/browser/markers.contribution.js';
2
+
3
+ function getServiceOverride() {
4
+ return {};
5
+ }
6
+
7
+ export { getServiceOverride as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-markers-service-override",
3
- "version": "1.82.4",
3
+ "version": "1.82.5-next.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@1.82.4",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@1.82.5-next.0",
22
22
  "monaco-editor": "0.43.0"
23
23
  }
24
24
  }
@@ -0,0 +1,587 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
3
+ import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
4
+ import { Categories } from 'monaco-editor/esm/vs/platform/action/common/actionCommonCategories.js';
5
+ import { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
6
+ import { localize } from 'monaco-editor/esm/vs/nls.js';
7
+ import { Marker, ResourceMarkers, RelatedInformation } from './markersModel.js';
8
+ import { MarkersView } from './markersView.js';
9
+ import { registerAction2, MenuId, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
10
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
11
+ import { Markers, MarkersContextKeys } from 'vscode/vscode/vs/workbench/contrib/markers/common/markers';
12
+ import Messages from './messages.js';
13
+ import { Extensions as Extensions$2 } from 'vscode/vscode/vs/workbench/common/contributions';
14
+ import { IClipboardService } from 'monaco-editor/esm/vs/platform/clipboard/common/clipboardService.js';
15
+ import { Disposable, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
16
+ import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
17
+ import { IMarkerService } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
18
+ import { IViewsService, Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/views';
19
+ import { FocusedViewContext, getVisbileViewContextKey } from 'vscode/vscode/vs/workbench/common/contextkeys';
20
+ import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
21
+ import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
22
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
23
+ import { registerIcon } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
24
+ import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
25
+ import { NumberBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
26
+ import { viewFilterSubmenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewFilter';
27
+
28
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
29
+ id: Markers.MARKER_OPEN_ACTION_ID,
30
+ weight: 200 ,
31
+ when: ( ContextKeyExpr.and(MarkersContextKeys.MarkerFocusContextKey)),
32
+ primary: 3 ,
33
+ mac: {
34
+ primary: 3 ,
35
+ secondary: [2048 | 18 ]
36
+ },
37
+ handler: (accessor, args) => {
38
+ const markersView = accessor.get(IViewsService).getActiveViewWithId(Markers.MARKERS_VIEW_ID);
39
+ markersView.openFileAtElement(markersView.getFocusElement(), false, false, true);
40
+ }
41
+ });
42
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
43
+ id: Markers.MARKER_OPEN_SIDE_ACTION_ID,
44
+ weight: 200 ,
45
+ when: ( ContextKeyExpr.and(MarkersContextKeys.MarkerFocusContextKey)),
46
+ primary: 2048 | 3 ,
47
+ mac: {
48
+ primary: 256 | 3
49
+ },
50
+ handler: (accessor, args) => {
51
+ const markersView = accessor.get(IViewsService).getActiveViewWithId(Markers.MARKERS_VIEW_ID);
52
+ markersView.openFileAtElement(markersView.getFocusElement(), false, true, true);
53
+ }
54
+ });
55
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
56
+ id: Markers.MARKER_SHOW_PANEL_ID,
57
+ weight: 200 ,
58
+ when: undefined,
59
+ primary: undefined,
60
+ handler: async (accessor, args) => {
61
+ await accessor.get(IViewsService).openView(Markers.MARKERS_VIEW_ID);
62
+ }
63
+ });
64
+ KeybindingsRegistry.registerCommandAndKeybindingRule({
65
+ id: Markers.MARKER_SHOW_QUICK_FIX,
66
+ weight: 200 ,
67
+ when: MarkersContextKeys.MarkerFocusContextKey,
68
+ primary: 2048 | 89 ,
69
+ handler: (accessor, args) => {
70
+ const markersView = accessor.get(IViewsService).getActiveViewWithId(Markers.MARKERS_VIEW_ID);
71
+ const focusedElement = markersView.getFocusElement();
72
+ if (focusedElement instanceof Marker) {
73
+ markersView.showQuickFixes(focusedElement);
74
+ }
75
+ }
76
+ });
77
+ ( Registry.as(Extensions.Configuration)).registerConfiguration({
78
+ 'id': 'problems',
79
+ 'order': 101,
80
+ 'title': Messages.PROBLEMS_PANEL_CONFIGURATION_TITLE,
81
+ 'type': 'object',
82
+ 'properties': {
83
+ 'problems.autoReveal': {
84
+ 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_AUTO_REVEAL,
85
+ 'type': 'boolean',
86
+ 'default': true
87
+ },
88
+ 'problems.defaultViewMode': {
89
+ 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_VIEW_MODE,
90
+ 'type': 'string',
91
+ 'default': 'tree',
92
+ 'enum': ['table', 'tree'],
93
+ },
94
+ 'problems.showCurrentInStatus': {
95
+ 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_SHOW_CURRENT_STATUS,
96
+ 'type': 'boolean',
97
+ 'default': false
98
+ },
99
+ 'problems.sortOrder': {
100
+ 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER,
101
+ 'type': 'string',
102
+ 'default': 'severity',
103
+ 'enum': ['severity', 'position'],
104
+ 'enumDescriptions': [
105
+ Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_SEVERITY,
106
+ Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_POSITION,
107
+ ],
108
+ },
109
+ }
110
+ });
111
+ const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, ( localize('markersViewIcon', 'View icon of the markers view.')));
112
+ const VIEW_CONTAINER = ( Registry.as(Extensions$1.ViewContainersRegistry)).registerViewContainer({
113
+ id: Markers.MARKERS_CONTAINER_ID,
114
+ title: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
115
+ icon: markersViewIcon,
116
+ hideIfEmpty: true,
117
+ order: 0,
118
+ ctorDescriptor: ( new SyncDescriptor(
119
+ ViewPaneContainer,
120
+ [Markers.MARKERS_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
121
+ )),
122
+ storageId: Markers.MARKERS_VIEW_STORAGE_ID,
123
+ }, 1 , { doNotRegisterOpenCommand: true });
124
+ ( Registry.as(Extensions$1.ViewsRegistry)).registerViews([{
125
+ id: Markers.MARKERS_VIEW_ID,
126
+ containerIcon: markersViewIcon,
127
+ name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
128
+ canToggleVisibility: false,
129
+ canMoveView: true,
130
+ ctorDescriptor: ( new SyncDescriptor(MarkersView)),
131
+ openCommandActionDescriptor: {
132
+ id: 'workbench.actions.view.problems',
133
+ mnemonicTitle: ( localize({ key: 'miMarker', comment: ['&& denotes a mnemonic'] }, "&&Problems")),
134
+ keybindings: { primary: 2048 | 1024 | 43 },
135
+ order: 0,
136
+ }
137
+ }], VIEW_CONTAINER);
138
+ const workbenchRegistry = ( Registry.as(Extensions$2.Workbench));
139
+ registerAction2(class extends ViewAction {
140
+ constructor() {
141
+ super({
142
+ id: `workbench.actions.table.${Markers.MARKERS_VIEW_ID}.viewAsTree`,
143
+ title: ( localize('viewAsTree', "View as Tree")),
144
+ menu: {
145
+ id: MenuId.ViewTitle,
146
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)), ( MarkersContextKeys.MarkersViewModeContextKey.isEqualTo("table" )))),
147
+ group: 'navigation',
148
+ order: 3
149
+ },
150
+ icon: Codicon.listTree,
151
+ viewId: Markers.MARKERS_VIEW_ID
152
+ });
153
+ }
154
+ async runInView(serviceAccessor, view) {
155
+ view.setViewMode("tree" );
156
+ }
157
+ });
158
+ registerAction2(class extends ViewAction {
159
+ constructor() {
160
+ super({
161
+ id: `workbench.actions.table.${Markers.MARKERS_VIEW_ID}.viewAsTable`,
162
+ title: ( localize('viewAsTable', "View as Table")),
163
+ menu: {
164
+ id: MenuId.ViewTitle,
165
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)), ( MarkersContextKeys.MarkersViewModeContextKey.isEqualTo("tree" )))),
166
+ group: 'navigation',
167
+ order: 3
168
+ },
169
+ icon: Codicon.listFlat,
170
+ viewId: Markers.MARKERS_VIEW_ID
171
+ });
172
+ }
173
+ async runInView(serviceAccessor, view) {
174
+ view.setViewMode("table" );
175
+ }
176
+ });
177
+ registerAction2(class extends ViewAction {
178
+ constructor() {
179
+ super({
180
+ id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleErrors`,
181
+ title: ( localize('toggle errors', "Toggle Errors")),
182
+ category: ( localize('problems', "Problems")),
183
+ toggled: {
184
+ condition: MarkersContextKeys.ShowErrorsFilterContextKey,
185
+ title: ( localize('errors', "Show Errors"))
186
+ },
187
+ menu: {
188
+ id: viewFilterSubmenu,
189
+ group: '1_filter',
190
+ when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
191
+ order: 1
192
+ },
193
+ viewId: Markers.MARKERS_VIEW_ID
194
+ });
195
+ }
196
+ async runInView(serviceAccessor, view) {
197
+ view.filters.showErrors = !view.filters.showErrors;
198
+ }
199
+ });
200
+ registerAction2(class extends ViewAction {
201
+ constructor() {
202
+ super({
203
+ id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleWarnings`,
204
+ title: ( localize('toggle warnings', "Toggle Warnings")),
205
+ category: ( localize('problems', "Problems")),
206
+ toggled: {
207
+ condition: MarkersContextKeys.ShowWarningsFilterContextKey,
208
+ title: ( localize('warnings', "Show Warnings"))
209
+ },
210
+ menu: {
211
+ id: viewFilterSubmenu,
212
+ group: '1_filter',
213
+ when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
214
+ order: 2
215
+ },
216
+ viewId: Markers.MARKERS_VIEW_ID
217
+ });
218
+ }
219
+ async runInView(serviceAccessor, view) {
220
+ view.filters.showWarnings = !view.filters.showWarnings;
221
+ }
222
+ });
223
+ registerAction2(class extends ViewAction {
224
+ constructor() {
225
+ super({
226
+ id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleInfos`,
227
+ title: ( localize('toggle infos', "Toggle Infos")),
228
+ category: ( localize('problems', "Problems")),
229
+ toggled: {
230
+ condition: MarkersContextKeys.ShowInfoFilterContextKey,
231
+ title: ( localize('Infos', "Show Infos"))
232
+ },
233
+ menu: {
234
+ id: viewFilterSubmenu,
235
+ group: '1_filter',
236
+ when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
237
+ order: 3
238
+ },
239
+ viewId: Markers.MARKERS_VIEW_ID
240
+ });
241
+ }
242
+ async runInView(serviceAccessor, view) {
243
+ view.filters.showInfos = !view.filters.showInfos;
244
+ }
245
+ });
246
+ registerAction2(class extends ViewAction {
247
+ constructor() {
248
+ super({
249
+ id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleActiveFile`,
250
+ title: ( localize('toggle active file', "Toggle Active File")),
251
+ category: ( localize('problems', "Problems")),
252
+ toggled: {
253
+ condition: MarkersContextKeys.ShowActiveFileFilterContextKey,
254
+ title: ( localize('Active File', "Show Active File Only"))
255
+ },
256
+ menu: {
257
+ id: viewFilterSubmenu,
258
+ group: '2_filter',
259
+ when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
260
+ order: 1
261
+ },
262
+ viewId: Markers.MARKERS_VIEW_ID
263
+ });
264
+ }
265
+ async runInView(serviceAccessor, view) {
266
+ view.filters.activeFile = !view.filters.activeFile;
267
+ }
268
+ });
269
+ registerAction2(class extends ViewAction {
270
+ constructor() {
271
+ super({
272
+ id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleExcludedFiles`,
273
+ title: ( localize('toggle Excluded Files', "Toggle Excluded Files")),
274
+ category: ( localize('problems', "Problems")),
275
+ toggled: {
276
+ condition: MarkersContextKeys.ShowExcludedFilesFilterContextKey,
277
+ title: ( localize('Excluded Files', "Hide Excluded Files"))
278
+ },
279
+ menu: {
280
+ id: viewFilterSubmenu,
281
+ group: '2_filter',
282
+ when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
283
+ order: 2
284
+ },
285
+ viewId: Markers.MARKERS_VIEW_ID
286
+ });
287
+ }
288
+ async runInView(serviceAccessor, view) {
289
+ view.filters.excludedFiles = !view.filters.excludedFiles;
290
+ }
291
+ });
292
+ registerAction2(class extends Action2 {
293
+ constructor() {
294
+ super({
295
+ id: 'workbench.action.problems.focus',
296
+ title: { value: Messages.MARKERS_PANEL_SHOW_LABEL, original: 'Focus Problems (Errors, Warnings, Infos)' },
297
+ category: Categories.View,
298
+ f1: true,
299
+ });
300
+ }
301
+ async run(accessor) {
302
+ accessor.get(IViewsService).openView(Markers.MARKERS_VIEW_ID, true);
303
+ }
304
+ });
305
+ registerAction2(class extends ViewAction {
306
+ constructor() {
307
+ const when = ( ContextKeyExpr.and(( FocusedViewContext.isEqualTo(Markers.MARKERS_VIEW_ID)), MarkersContextKeys.MarkersTreeVisibilityContextKey, ( MarkersContextKeys.RelatedInformationFocusContextKey.toNegated())));
308
+ super({
309
+ id: Markers.MARKER_COPY_ACTION_ID,
310
+ title: { value: ( localize('copyMarker', "Copy")), original: 'Copy' },
311
+ menu: {
312
+ id: MenuId.ProblemsPanelContext,
313
+ when,
314
+ group: 'navigation'
315
+ },
316
+ keybinding: {
317
+ weight: 200 ,
318
+ primary: 2048 | 33 ,
319
+ when
320
+ },
321
+ viewId: Markers.MARKERS_VIEW_ID
322
+ });
323
+ }
324
+ async runInView(serviceAccessor, markersView) {
325
+ const clipboardService = serviceAccessor.get(IClipboardService);
326
+ const selection = markersView.getFocusedSelectedElements() || markersView.getAllResourceMarkers();
327
+ const markers = [];
328
+ const addMarker = (marker) => {
329
+ if (!markers.includes(marker)) {
330
+ markers.push(marker);
331
+ }
332
+ };
333
+ for (const selected of selection) {
334
+ if (selected instanceof ResourceMarkers) {
335
+ selected.markers.forEach(addMarker);
336
+ }
337
+ else if (selected instanceof Marker) {
338
+ addMarker(selected);
339
+ }
340
+ }
341
+ if (markers.length) {
342
+ await clipboardService.writeText(`[${markers}]`);
343
+ }
344
+ }
345
+ });
346
+ registerAction2(class extends ViewAction {
347
+ constructor() {
348
+ super({
349
+ id: Markers.MARKER_COPY_MESSAGE_ACTION_ID,
350
+ title: { value: ( localize('copyMessage', "Copy Message")), original: 'Copy Message' },
351
+ menu: {
352
+ id: MenuId.ProblemsPanelContext,
353
+ when: MarkersContextKeys.MarkerFocusContextKey,
354
+ group: 'navigation'
355
+ },
356
+ viewId: Markers.MARKERS_VIEW_ID
357
+ });
358
+ }
359
+ async runInView(serviceAccessor, markersView) {
360
+ const clipboardService = serviceAccessor.get(IClipboardService);
361
+ const element = markersView.getFocusElement();
362
+ if (element instanceof Marker) {
363
+ await clipboardService.writeText(element.marker.message);
364
+ }
365
+ }
366
+ });
367
+ registerAction2(class extends ViewAction {
368
+ constructor() {
369
+ super({
370
+ id: Markers.RELATED_INFORMATION_COPY_MESSAGE_ACTION_ID,
371
+ title: { value: ( localize('copyMessage', "Copy Message")), original: 'Copy Message' },
372
+ menu: {
373
+ id: MenuId.ProblemsPanelContext,
374
+ when: MarkersContextKeys.RelatedInformationFocusContextKey,
375
+ group: 'navigation'
376
+ },
377
+ viewId: Markers.MARKERS_VIEW_ID
378
+ });
379
+ }
380
+ async runInView(serviceAccessor, markersView) {
381
+ const clipboardService = serviceAccessor.get(IClipboardService);
382
+ const element = markersView.getFocusElement();
383
+ if (element instanceof RelatedInformation) {
384
+ await clipboardService.writeText(element.raw.message);
385
+ }
386
+ }
387
+ });
388
+ registerAction2(class extends ViewAction {
389
+ constructor() {
390
+ super({
391
+ id: Markers.FOCUS_PROBLEMS_FROM_FILTER,
392
+ title: ( localize('focusProblemsList', "Focus problems view")),
393
+ keybinding: {
394
+ when: MarkersContextKeys.MarkerViewFilterFocusContextKey,
395
+ weight: 200 ,
396
+ primary: 2048 | 18
397
+ },
398
+ viewId: Markers.MARKERS_VIEW_ID
399
+ });
400
+ }
401
+ async runInView(serviceAccessor, markersView) {
402
+ markersView.focus();
403
+ }
404
+ });
405
+ registerAction2(class extends ViewAction {
406
+ constructor() {
407
+ super({
408
+ id: Markers.MARKERS_VIEW_FOCUS_FILTER,
409
+ title: ( localize('focusProblemsFilter', "Focus problems filter")),
410
+ keybinding: {
411
+ when: ( FocusedViewContext.isEqualTo(Markers.MARKERS_VIEW_ID)),
412
+ weight: 200 ,
413
+ primary: 2048 | 36
414
+ },
415
+ viewId: Markers.MARKERS_VIEW_ID
416
+ });
417
+ }
418
+ async runInView(serviceAccessor, markersView) {
419
+ markersView.focusFilter();
420
+ }
421
+ });
422
+ registerAction2(class extends ViewAction {
423
+ constructor() {
424
+ super({
425
+ id: Markers.MARKERS_VIEW_SHOW_MULTILINE_MESSAGE,
426
+ title: { value: ( localize('show multiline', "Show message in multiple lines")), original: 'Problems: Show message in multiple lines' },
427
+ category: ( localize('problems', "Problems")),
428
+ menu: {
429
+ id: MenuId.CommandPalette,
430
+ when: ( ContextKeyExpr.has(getVisbileViewContextKey(Markers.MARKERS_VIEW_ID)))
431
+ },
432
+ viewId: Markers.MARKERS_VIEW_ID
433
+ });
434
+ }
435
+ async runInView(serviceAccessor, markersView) {
436
+ markersView.setMultiline(true);
437
+ }
438
+ });
439
+ registerAction2(class extends ViewAction {
440
+ constructor() {
441
+ super({
442
+ id: Markers.MARKERS_VIEW_SHOW_SINGLELINE_MESSAGE,
443
+ title: { value: ( localize('show singleline', "Show message in single line")), original: 'Problems: Show message in single line' },
444
+ category: ( localize('problems', "Problems")),
445
+ menu: {
446
+ id: MenuId.CommandPalette,
447
+ when: ( ContextKeyExpr.has(getVisbileViewContextKey(Markers.MARKERS_VIEW_ID)))
448
+ },
449
+ viewId: Markers.MARKERS_VIEW_ID
450
+ });
451
+ }
452
+ async runInView(serviceAccessor, markersView) {
453
+ markersView.setMultiline(false);
454
+ }
455
+ });
456
+ registerAction2(class extends ViewAction {
457
+ constructor() {
458
+ super({
459
+ id: Markers.MARKERS_VIEW_CLEAR_FILTER_TEXT,
460
+ title: ( localize('clearFiltersText', "Clear filters text")),
461
+ category: ( localize('problems', "Problems")),
462
+ keybinding: {
463
+ when: MarkersContextKeys.MarkerViewFilterFocusContextKey,
464
+ weight: 200 ,
465
+ primary: 9
466
+ },
467
+ viewId: Markers.MARKERS_VIEW_ID
468
+ });
469
+ }
470
+ async runInView(serviceAccessor, markersView) {
471
+ markersView.clearFilterText();
472
+ }
473
+ });
474
+ registerAction2(class extends ViewAction {
475
+ constructor() {
476
+ super({
477
+ id: `workbench.actions.treeView.${Markers.MARKERS_VIEW_ID}.collapseAll`,
478
+ title: ( localize('collapseAll', "Collapse All")),
479
+ menu: {
480
+ id: MenuId.ViewTitle,
481
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)), ( MarkersContextKeys.MarkersViewModeContextKey.isEqualTo("tree" )))),
482
+ group: 'navigation',
483
+ order: 2,
484
+ },
485
+ icon: Codicon.collapseAll,
486
+ viewId: Markers.MARKERS_VIEW_ID
487
+ });
488
+ }
489
+ async runInView(serviceAccessor, view) {
490
+ return view.collapseAll();
491
+ }
492
+ });
493
+ registerAction2(class extends Action2 {
494
+ constructor() {
495
+ super({
496
+ id: Markers.TOGGLE_MARKERS_VIEW_ACTION_ID,
497
+ title: Messages.MARKERS_PANEL_TOGGLE_LABEL,
498
+ });
499
+ }
500
+ async run(accessor) {
501
+ const viewsService = accessor.get(IViewsService);
502
+ if (viewsService.isViewVisible(Markers.MARKERS_VIEW_ID)) {
503
+ viewsService.closeView(Markers.MARKERS_VIEW_ID);
504
+ }
505
+ else {
506
+ viewsService.openView(Markers.MARKERS_VIEW_ID, true);
507
+ }
508
+ }
509
+ });
510
+ let MarkersStatusBarContributions = class MarkersStatusBarContributions extends Disposable {
511
+ constructor(markerService, statusbarService) {
512
+ super();
513
+ this.markerService = markerService;
514
+ this.statusbarService = statusbarService;
515
+ this.markersStatusItem = this._register(this.statusbarService.addEntry(this.getMarkersItem(), 'status.problems', 0 , 50 ));
516
+ this.markerService.onMarkerChanged(() => this.markersStatusItem.update(this.getMarkersItem()));
517
+ }
518
+ getMarkersItem() {
519
+ const markersStatistics = this.markerService.getStatistics();
520
+ const tooltip = this.getMarkersTooltip(markersStatistics);
521
+ return {
522
+ name: ( localize('status.problems', "Problems")),
523
+ text: this.getMarkersText(markersStatistics),
524
+ ariaLabel: tooltip,
525
+ tooltip,
526
+ command: 'workbench.actions.view.toggleProblems'
527
+ };
528
+ }
529
+ getMarkersTooltip(stats) {
530
+ const errorTitle = (n) => ( localize('totalErrors', "Errors: {0}", n));
531
+ const warningTitle = (n) => ( localize('totalWarnings', "Warnings: {0}", n));
532
+ const infoTitle = (n) => ( localize('totalInfos', "Infos: {0}", n));
533
+ const titles = [];
534
+ if (stats.errors > 0) {
535
+ titles.push(errorTitle(stats.errors));
536
+ }
537
+ if (stats.warnings > 0) {
538
+ titles.push(warningTitle(stats.warnings));
539
+ }
540
+ if (stats.infos > 0) {
541
+ titles.push(infoTitle(stats.infos));
542
+ }
543
+ if (titles.length === 0) {
544
+ return ( localize('noProblems', "No Problems"));
545
+ }
546
+ return titles.join(', ');
547
+ }
548
+ getMarkersText(stats) {
549
+ const problemsText = [];
550
+ problemsText.push('$(error) ' + this.packNumber(stats.errors));
551
+ problemsText.push('$(warning) ' + this.packNumber(stats.warnings));
552
+ if (stats.infos > 0) {
553
+ problemsText.push('$(info) ' + this.packNumber(stats.infos));
554
+ }
555
+ return problemsText.join(' ');
556
+ }
557
+ packNumber(n) {
558
+ const manyProblems = ( localize('manyProblems', "10K+"));
559
+ return n > 9999 ? manyProblems : n > 999 ? ( n.toString()).charAt(0) + 'K' : ( n.toString());
560
+ }
561
+ };
562
+ MarkersStatusBarContributions = ( __decorate([
563
+ ( __param(0, IMarkerService)),
564
+ ( __param(1, IStatusbarService))
565
+ ], MarkersStatusBarContributions));
566
+ workbenchRegistry.registerWorkbenchContribution(MarkersStatusBarContributions, 3 );
567
+ let ActivityUpdater = class ActivityUpdater extends Disposable {
568
+ constructor(activityService, markerService) {
569
+ super();
570
+ this.activityService = activityService;
571
+ this.markerService = markerService;
572
+ this.activity = this._register(( new MutableDisposable()));
573
+ this._register(this.markerService.onMarkerChanged(() => this.updateBadge()));
574
+ this.updateBadge();
575
+ }
576
+ updateBadge() {
577
+ const { errors, warnings, infos } = this.markerService.getStatistics();
578
+ const total = errors + warnings + infos;
579
+ const message = ( localize('totalProblems', 'Total {0} Problems', total));
580
+ this.activity.value = this.activityService.showViewActivity(Markers.MARKERS_VIEW_ID, { badge: ( new NumberBadge(total, () => message)) });
581
+ }
582
+ };
583
+ ActivityUpdater = ( __decorate([
584
+ ( __param(0, IActivityService)),
585
+ ( __param(1, IMarkerService))
586
+ ], ActivityUpdater));
587
+ workbenchRegistry.registerWorkbenchContribution(ActivityUpdater, 3 );