@codingame/monaco-vscode-markers-service-override 4.0.0 → 4.1.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.
@@ -1,760 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import './markersFileDecorations.js';
3
- import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
4
- import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
5
- import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
6
- import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
7
- import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
8
- import { Marker, ResourceMarkers, RelatedInformation } from './markersModel.js';
9
- import { MarkersView } from './markersView.js';
10
- import { registerAction2, MenuId, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
11
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
12
- import { Markers, MarkersContextKeys } from 'vscode/vscode/vs/workbench/contrib/markers/common/markers';
13
- import Messages from './messages.js';
14
- import { Extensions as Extensions$2 } from 'vscode/vscode/vs/workbench/common/contributions';
15
- import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService';
16
- import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
17
- import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
18
- import { IMarkerService } from 'vscode/vscode/vs/platform/markers/common/markers';
19
- import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/views';
20
- import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService';
21
- import { FocusedViewContext, getVisbileViewContextKey } from 'vscode/vscode/vs/workbench/common/contextkeys';
22
- import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
23
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
24
- import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
25
- import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
26
- import { ViewAction } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
27
- import { NumberBadge, IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
28
- import { viewFilterSubmenu } from 'vscode/vscode/vs/workbench/browser/parts/views/viewFilter';
29
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
30
- import { problemsConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
31
-
32
- KeybindingsRegistry.registerCommandAndKeybindingRule({
33
- id: Markers.MARKER_OPEN_ACTION_ID,
34
- weight: 200 ,
35
- when: ( ContextKeyExpr.and(MarkersContextKeys.MarkerFocusContextKey)),
36
- primary: 3 ,
37
- mac: {
38
- primary: 3 ,
39
- secondary: [2048 | 18 ]
40
- },
41
- handler: (accessor, args) => {
42
- const markersView = accessor.get(IViewsService).getActiveViewWithId(Markers.MARKERS_VIEW_ID);
43
- markersView.openFileAtElement(markersView.getFocusElement(), false, false, true);
44
- }
45
- });
46
- KeybindingsRegistry.registerCommandAndKeybindingRule({
47
- id: Markers.MARKER_OPEN_SIDE_ACTION_ID,
48
- weight: 200 ,
49
- when: ( ContextKeyExpr.and(MarkersContextKeys.MarkerFocusContextKey)),
50
- primary: 2048 | 3 ,
51
- mac: {
52
- primary: 256 | 3
53
- },
54
- handler: (accessor, args) => {
55
- const markersView = accessor.get(IViewsService).getActiveViewWithId(Markers.MARKERS_VIEW_ID);
56
- markersView.openFileAtElement(markersView.getFocusElement(), false, true, true);
57
- }
58
- });
59
- KeybindingsRegistry.registerCommandAndKeybindingRule({
60
- id: Markers.MARKER_SHOW_PANEL_ID,
61
- weight: 200 ,
62
- when: undefined,
63
- primary: undefined,
64
- handler: async (accessor, args) => {
65
- await accessor.get(IViewsService).openView(Markers.MARKERS_VIEW_ID);
66
- }
67
- });
68
- KeybindingsRegistry.registerCommandAndKeybindingRule({
69
- id: Markers.MARKER_SHOW_QUICK_FIX,
70
- weight: 200 ,
71
- when: MarkersContextKeys.MarkerFocusContextKey,
72
- primary: 2048 | 89 ,
73
- handler: (accessor, args) => {
74
- const markersView = accessor.get(IViewsService).getActiveViewWithId(Markers.MARKERS_VIEW_ID);
75
- const focusedElement = markersView.getFocusElement();
76
- if (focusedElement instanceof Marker) {
77
- markersView.showQuickFixes(focusedElement);
78
- }
79
- }
80
- });
81
- ( Registry.as(Extensions.Configuration)).registerConfiguration({
82
- ...problemsConfigurationNodeBase,
83
- 'properties': {
84
- 'problems.autoReveal': {
85
- 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_AUTO_REVEAL,
86
- 'type': 'boolean',
87
- 'default': true
88
- },
89
- 'problems.defaultViewMode': {
90
- 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_VIEW_MODE,
91
- 'type': 'string',
92
- 'default': 'tree',
93
- 'enum': ['table', 'tree'],
94
- },
95
- 'problems.showCurrentInStatus': {
96
- 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_SHOW_CURRENT_STATUS,
97
- 'type': 'boolean',
98
- 'default': false
99
- },
100
- 'problems.sortOrder': {
101
- 'description': Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER,
102
- 'type': 'string',
103
- 'default': 'severity',
104
- 'enum': ['severity', 'position'],
105
- 'enumDescriptions': [
106
- Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_SEVERITY,
107
- Messages.PROBLEMS_PANEL_CONFIGURATION_COMPARE_ORDER_POSITION,
108
- ],
109
- },
110
- }
111
- });
112
- const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, ( localizeWithPath(
113
- 'vs/workbench/contrib/markers/browser/markers.contribution',
114
- 'markersViewIcon',
115
- 'View icon of the markers view.'
116
- )));
117
- const VIEW_CONTAINER = ( Registry.as(Extensions$1.ViewContainersRegistry)).registerViewContainer({
118
- id: Markers.MARKERS_CONTAINER_ID,
119
- title: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
120
- icon: markersViewIcon,
121
- hideIfEmpty: true,
122
- order: 0,
123
- ctorDescriptor: ( new SyncDescriptor(
124
- ViewPaneContainer,
125
- [Markers.MARKERS_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
126
- )),
127
- storageId: Markers.MARKERS_VIEW_STORAGE_ID,
128
- }, 1 , { doNotRegisterOpenCommand: true });
129
- ( Registry.as(Extensions$1.ViewsRegistry)).registerViews([{
130
- id: Markers.MARKERS_VIEW_ID,
131
- containerIcon: markersViewIcon,
132
- name: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
133
- canToggleVisibility: false,
134
- canMoveView: true,
135
- ctorDescriptor: ( new SyncDescriptor(MarkersView)),
136
- openCommandActionDescriptor: {
137
- id: 'workbench.actions.view.problems',
138
- mnemonicTitle: ( localizeWithPath(
139
- 'vs/workbench/contrib/markers/browser/markers.contribution',
140
- { key: 'miMarker', comment: ['&& denotes a mnemonic'] },
141
- "&&Problems"
142
- )),
143
- keybindings: { primary: 2048 | 1024 | 43 },
144
- order: 0,
145
- }
146
- }], VIEW_CONTAINER);
147
- const workbenchRegistry = ( Registry.as(Extensions$2.Workbench));
148
- registerAction2(class extends ViewAction {
149
- constructor() {
150
- super({
151
- id: `workbench.actions.table.${Markers.MARKERS_VIEW_ID}.viewAsTree`,
152
- title: ( localizeWithPath(
153
- 'vs/workbench/contrib/markers/browser/markers.contribution',
154
- 'viewAsTree',
155
- "View as Tree"
156
- )),
157
- menu: {
158
- id: MenuId.ViewTitle,
159
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)), ( MarkersContextKeys.MarkersViewModeContextKey.isEqualTo("table" )))),
160
- group: 'navigation',
161
- order: 3
162
- },
163
- icon: Codicon.listTree,
164
- viewId: Markers.MARKERS_VIEW_ID
165
- });
166
- }
167
- async runInView(serviceAccessor, view) {
168
- view.setViewMode("tree" );
169
- }
170
- });
171
- registerAction2(class extends ViewAction {
172
- constructor() {
173
- super({
174
- id: `workbench.actions.table.${Markers.MARKERS_VIEW_ID}.viewAsTable`,
175
- title: ( localizeWithPath(
176
- 'vs/workbench/contrib/markers/browser/markers.contribution',
177
- 'viewAsTable',
178
- "View as Table"
179
- )),
180
- menu: {
181
- id: MenuId.ViewTitle,
182
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)), ( MarkersContextKeys.MarkersViewModeContextKey.isEqualTo("tree" )))),
183
- group: 'navigation',
184
- order: 3
185
- },
186
- icon: Codicon.listFlat,
187
- viewId: Markers.MARKERS_VIEW_ID
188
- });
189
- }
190
- async runInView(serviceAccessor, view) {
191
- view.setViewMode("table" );
192
- }
193
- });
194
- registerAction2(class extends ViewAction {
195
- constructor() {
196
- super({
197
- id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleErrors`,
198
- title: ( localizeWithPath(
199
- 'vs/workbench/contrib/markers/browser/markers.contribution',
200
- 'show errors',
201
- "Show Errors"
202
- )),
203
- category: ( localizeWithPath(
204
- 'vs/workbench/contrib/markers/browser/markers.contribution',
205
- 'problems',
206
- "Problems"
207
- )),
208
- toggled: MarkersContextKeys.ShowErrorsFilterContextKey,
209
- menu: {
210
- id: viewFilterSubmenu,
211
- group: '1_filter',
212
- when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
213
- order: 1
214
- },
215
- viewId: Markers.MARKERS_VIEW_ID
216
- });
217
- }
218
- async runInView(serviceAccessor, view) {
219
- view.filters.showErrors = !view.filters.showErrors;
220
- }
221
- });
222
- registerAction2(class extends ViewAction {
223
- constructor() {
224
- super({
225
- id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleWarnings`,
226
- title: ( localizeWithPath(
227
- 'vs/workbench/contrib/markers/browser/markers.contribution',
228
- 'show warnings',
229
- "Show Warnings"
230
- )),
231
- category: ( localizeWithPath(
232
- 'vs/workbench/contrib/markers/browser/markers.contribution',
233
- 'problems',
234
- "Problems"
235
- )),
236
- toggled: MarkersContextKeys.ShowWarningsFilterContextKey,
237
- menu: {
238
- id: viewFilterSubmenu,
239
- group: '1_filter',
240
- when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
241
- order: 2
242
- },
243
- viewId: Markers.MARKERS_VIEW_ID
244
- });
245
- }
246
- async runInView(serviceAccessor, view) {
247
- view.filters.showWarnings = !view.filters.showWarnings;
248
- }
249
- });
250
- registerAction2(class extends ViewAction {
251
- constructor() {
252
- super({
253
- id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleInfos`,
254
- title: ( localizeWithPath(
255
- 'vs/workbench/contrib/markers/browser/markers.contribution',
256
- 'show infos',
257
- "Show Infos"
258
- )),
259
- category: ( localizeWithPath(
260
- 'vs/workbench/contrib/markers/browser/markers.contribution',
261
- 'problems',
262
- "Problems"
263
- )),
264
- toggled: MarkersContextKeys.ShowInfoFilterContextKey,
265
- menu: {
266
- id: viewFilterSubmenu,
267
- group: '1_filter',
268
- when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
269
- order: 3
270
- },
271
- viewId: Markers.MARKERS_VIEW_ID
272
- });
273
- }
274
- async runInView(serviceAccessor, view) {
275
- view.filters.showInfos = !view.filters.showInfos;
276
- }
277
- });
278
- registerAction2(class extends ViewAction {
279
- constructor() {
280
- super({
281
- id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleActiveFile`,
282
- title: ( localizeWithPath(
283
- 'vs/workbench/contrib/markers/browser/markers.contribution',
284
- 'show active file',
285
- "Show Active File Only"
286
- )),
287
- category: ( localizeWithPath(
288
- 'vs/workbench/contrib/markers/browser/markers.contribution',
289
- 'problems',
290
- "Problems"
291
- )),
292
- toggled: MarkersContextKeys.ShowActiveFileFilterContextKey,
293
- menu: {
294
- id: viewFilterSubmenu,
295
- group: '2_filter',
296
- when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
297
- order: 1
298
- },
299
- viewId: Markers.MARKERS_VIEW_ID
300
- });
301
- }
302
- async runInView(serviceAccessor, view) {
303
- view.filters.activeFile = !view.filters.activeFile;
304
- }
305
- });
306
- registerAction2(class extends ViewAction {
307
- constructor() {
308
- super({
309
- id: `workbench.actions.${Markers.MARKERS_VIEW_ID}.toggleExcludedFiles`,
310
- title: ( localizeWithPath(
311
- 'vs/workbench/contrib/markers/browser/markers.contribution',
312
- 'show excluded files',
313
- "Show Excluded Files"
314
- )),
315
- category: ( localizeWithPath(
316
- 'vs/workbench/contrib/markers/browser/markers.contribution',
317
- 'problems',
318
- "Problems"
319
- )),
320
- toggled: ( MarkersContextKeys.ShowExcludedFilesFilterContextKey.negate()),
321
- menu: {
322
- id: viewFilterSubmenu,
323
- group: '2_filter',
324
- when: ( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)),
325
- order: 2
326
- },
327
- viewId: Markers.MARKERS_VIEW_ID
328
- });
329
- }
330
- async runInView(serviceAccessor, view) {
331
- view.filters.excludedFiles = !view.filters.excludedFiles;
332
- }
333
- });
334
- registerAction2(class extends Action2 {
335
- constructor() {
336
- super({
337
- id: 'workbench.action.problems.focus',
338
- title: Messages.MARKERS_PANEL_SHOW_LABEL,
339
- category: Categories.View,
340
- f1: true,
341
- });
342
- }
343
- async run(accessor) {
344
- accessor.get(IViewsService).openView(Markers.MARKERS_VIEW_ID, true);
345
- }
346
- });
347
- registerAction2(class extends ViewAction {
348
- constructor() {
349
- const when = ( ContextKeyExpr.and(( FocusedViewContext.isEqualTo(Markers.MARKERS_VIEW_ID)), MarkersContextKeys.MarkersTreeVisibilityContextKey, ( MarkersContextKeys.RelatedInformationFocusContextKey.toNegated())));
350
- super({
351
- id: Markers.MARKER_COPY_ACTION_ID,
352
- title: ( localize2WithPath(
353
- 'vs/workbench/contrib/markers/browser/markers.contribution',
354
- 'copyMarker',
355
- 'Copy'
356
- )),
357
- menu: {
358
- id: MenuId.ProblemsPanelContext,
359
- when,
360
- group: 'navigation'
361
- },
362
- keybinding: {
363
- weight: 200 ,
364
- primary: 2048 | 33 ,
365
- when
366
- },
367
- viewId: Markers.MARKERS_VIEW_ID
368
- });
369
- }
370
- async runInView(serviceAccessor, markersView) {
371
- const clipboardService = serviceAccessor.get(IClipboardService);
372
- const selection = markersView.getFocusedSelectedElements() || markersView.getAllResourceMarkers();
373
- const markers = [];
374
- const addMarker = (marker) => {
375
- if (!markers.includes(marker)) {
376
- markers.push(marker);
377
- }
378
- };
379
- for (const selected of selection) {
380
- if (selected instanceof ResourceMarkers) {
381
- selected.markers.forEach(addMarker);
382
- }
383
- else if (selected instanceof Marker) {
384
- addMarker(selected);
385
- }
386
- }
387
- if (markers.length) {
388
- await clipboardService.writeText(`[${markers}]`);
389
- }
390
- }
391
- });
392
- registerAction2(class extends ViewAction {
393
- constructor() {
394
- super({
395
- id: Markers.MARKER_COPY_MESSAGE_ACTION_ID,
396
- title: ( localize2WithPath(
397
- 'vs/workbench/contrib/markers/browser/markers.contribution',
398
- 'copyMessage',
399
- 'Copy Message'
400
- )),
401
- menu: {
402
- id: MenuId.ProblemsPanelContext,
403
- when: MarkersContextKeys.MarkerFocusContextKey,
404
- group: 'navigation'
405
- },
406
- viewId: Markers.MARKERS_VIEW_ID
407
- });
408
- }
409
- async runInView(serviceAccessor, markersView) {
410
- const clipboardService = serviceAccessor.get(IClipboardService);
411
- const element = markersView.getFocusElement();
412
- if (element instanceof Marker) {
413
- await clipboardService.writeText(element.marker.message);
414
- }
415
- }
416
- });
417
- registerAction2(class extends ViewAction {
418
- constructor() {
419
- super({
420
- id: Markers.RELATED_INFORMATION_COPY_MESSAGE_ACTION_ID,
421
- title: ( localize2WithPath(
422
- 'vs/workbench/contrib/markers/browser/markers.contribution',
423
- 'copyMessage',
424
- 'Copy Message'
425
- )),
426
- menu: {
427
- id: MenuId.ProblemsPanelContext,
428
- when: MarkersContextKeys.RelatedInformationFocusContextKey,
429
- group: 'navigation'
430
- },
431
- viewId: Markers.MARKERS_VIEW_ID
432
- });
433
- }
434
- async runInView(serviceAccessor, markersView) {
435
- const clipboardService = serviceAccessor.get(IClipboardService);
436
- const element = markersView.getFocusElement();
437
- if (element instanceof RelatedInformation) {
438
- await clipboardService.writeText(element.raw.message);
439
- }
440
- }
441
- });
442
- registerAction2(class extends ViewAction {
443
- constructor() {
444
- super({
445
- id: Markers.FOCUS_PROBLEMS_FROM_FILTER,
446
- title: ( localizeWithPath(
447
- 'vs/workbench/contrib/markers/browser/markers.contribution',
448
- 'focusProblemsList',
449
- "Focus problems view"
450
- )),
451
- keybinding: {
452
- when: MarkersContextKeys.MarkerViewFilterFocusContextKey,
453
- weight: 200 ,
454
- primary: 2048 | 18
455
- },
456
- viewId: Markers.MARKERS_VIEW_ID
457
- });
458
- }
459
- async runInView(serviceAccessor, markersView) {
460
- markersView.focus();
461
- }
462
- });
463
- registerAction2(class extends ViewAction {
464
- constructor() {
465
- super({
466
- id: Markers.MARKERS_VIEW_FOCUS_FILTER,
467
- title: ( localizeWithPath(
468
- 'vs/workbench/contrib/markers/browser/markers.contribution',
469
- 'focusProblemsFilter',
470
- "Focus problems filter"
471
- )),
472
- keybinding: {
473
- when: ( FocusedViewContext.isEqualTo(Markers.MARKERS_VIEW_ID)),
474
- weight: 200 ,
475
- primary: 2048 | 36
476
- },
477
- viewId: Markers.MARKERS_VIEW_ID
478
- });
479
- }
480
- async runInView(serviceAccessor, markersView) {
481
- markersView.focusFilter();
482
- }
483
- });
484
- registerAction2(class extends ViewAction {
485
- constructor() {
486
- super({
487
- id: Markers.MARKERS_VIEW_SHOW_MULTILINE_MESSAGE,
488
- title: ( localize2WithPath(
489
- 'vs/workbench/contrib/markers/browser/markers.contribution',
490
- 'show multiline',
491
- "Show message in multiple lines"
492
- )),
493
- category: ( localizeWithPath(
494
- 'vs/workbench/contrib/markers/browser/markers.contribution',
495
- 'problems',
496
- "Problems"
497
- )),
498
- menu: {
499
- id: MenuId.CommandPalette,
500
- when: ( ContextKeyExpr.has(getVisbileViewContextKey(Markers.MARKERS_VIEW_ID)))
501
- },
502
- viewId: Markers.MARKERS_VIEW_ID
503
- });
504
- }
505
- async runInView(serviceAccessor, markersView) {
506
- markersView.setMultiline(true);
507
- }
508
- });
509
- registerAction2(class extends ViewAction {
510
- constructor() {
511
- super({
512
- id: Markers.MARKERS_VIEW_SHOW_SINGLELINE_MESSAGE,
513
- title: ( localize2WithPath(
514
- 'vs/workbench/contrib/markers/browser/markers.contribution',
515
- 'show singleline',
516
- "Show message in single line"
517
- )),
518
- category: ( localizeWithPath(
519
- 'vs/workbench/contrib/markers/browser/markers.contribution',
520
- 'problems',
521
- "Problems"
522
- )),
523
- menu: {
524
- id: MenuId.CommandPalette,
525
- when: ( ContextKeyExpr.has(getVisbileViewContextKey(Markers.MARKERS_VIEW_ID)))
526
- },
527
- viewId: Markers.MARKERS_VIEW_ID
528
- });
529
- }
530
- async runInView(serviceAccessor, markersView) {
531
- markersView.setMultiline(false);
532
- }
533
- });
534
- registerAction2(class extends ViewAction {
535
- constructor() {
536
- super({
537
- id: Markers.MARKERS_VIEW_CLEAR_FILTER_TEXT,
538
- title: ( localizeWithPath(
539
- 'vs/workbench/contrib/markers/browser/markers.contribution',
540
- 'clearFiltersText',
541
- "Clear filters text"
542
- )),
543
- category: ( localizeWithPath(
544
- 'vs/workbench/contrib/markers/browser/markers.contribution',
545
- 'problems',
546
- "Problems"
547
- )),
548
- keybinding: {
549
- when: MarkersContextKeys.MarkerViewFilterFocusContextKey,
550
- weight: 200 ,
551
- primary: 9
552
- },
553
- viewId: Markers.MARKERS_VIEW_ID
554
- });
555
- }
556
- async runInView(serviceAccessor, markersView) {
557
- markersView.clearFilterText();
558
- }
559
- });
560
- registerAction2(class extends ViewAction {
561
- constructor() {
562
- super({
563
- id: `workbench.actions.treeView.${Markers.MARKERS_VIEW_ID}.collapseAll`,
564
- title: ( localizeWithPath(
565
- 'vs/workbench/contrib/markers/browser/markers.contribution',
566
- 'collapseAll',
567
- "Collapse All"
568
- )),
569
- menu: {
570
- id: MenuId.ViewTitle,
571
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('view', Markers.MARKERS_VIEW_ID)), ( MarkersContextKeys.MarkersViewModeContextKey.isEqualTo("tree" )))),
572
- group: 'navigation',
573
- order: 2,
574
- },
575
- icon: Codicon.collapseAll,
576
- viewId: Markers.MARKERS_VIEW_ID
577
- });
578
- }
579
- async runInView(serviceAccessor, view) {
580
- return view.collapseAll();
581
- }
582
- });
583
- registerAction2(class extends Action2 {
584
- constructor() {
585
- super({
586
- id: Markers.TOGGLE_MARKERS_VIEW_ACTION_ID,
587
- title: Messages.MARKERS_PANEL_TOGGLE_LABEL,
588
- });
589
- }
590
- async run(accessor) {
591
- const viewsService = accessor.get(IViewsService);
592
- if (viewsService.isViewVisible(Markers.MARKERS_VIEW_ID)) {
593
- viewsService.closeView(Markers.MARKERS_VIEW_ID);
594
- }
595
- else {
596
- viewsService.openView(Markers.MARKERS_VIEW_ID, true);
597
- }
598
- }
599
- });
600
- let MarkersStatusBarContributions = class MarkersStatusBarContributions extends Disposable {
601
- constructor(markerService, statusbarService, configurationService) {
602
- super();
603
- this.markerService = markerService;
604
- this.statusbarService = statusbarService;
605
- this.configurationService = configurationService;
606
- this.markersStatusItem = this._register(this.statusbarService.addEntry(this.getMarkersItem(), 'status.problems', 0 , 50 ));
607
- const addStatusBarEntry = () => {
608
- this.markersStatusItemOff = this.statusbarService.addEntry(this.getMarkersItemTurnedOff(), 'status.problemsVisibility', 0 , 49);
609
- };
610
- let config = this.configurationService.getValue('problems.visibility');
611
- if (!config) {
612
- addStatusBarEntry();
613
- }
614
- this._register(this.markerService.onMarkerChanged(() => {
615
- this.markersStatusItem.update(this.getMarkersItem());
616
- }));
617
- this._register(this.configurationService.onDidChangeConfiguration(e => {
618
- if (e.affectsConfiguration('problems.visibility')) {
619
- this.markersStatusItem.update(this.getMarkersItem());
620
- config = this.configurationService.getValue('problems.visibility');
621
- if (!config && !this.markersStatusItemOff) {
622
- addStatusBarEntry();
623
- }
624
- else if (config && this.markersStatusItemOff) {
625
- this.markersStatusItemOff.dispose();
626
- this.markersStatusItemOff = undefined;
627
- }
628
- }
629
- }));
630
- }
631
- getMarkersItem() {
632
- const markersStatistics = this.markerService.getStatistics();
633
- const tooltip = this.getMarkersTooltip(markersStatistics);
634
- return {
635
- name: ( localizeWithPath(
636
- 'vs/workbench/contrib/markers/browser/markers.contribution',
637
- 'status.problems',
638
- "Problems"
639
- )),
640
- text: this.getMarkersText(markersStatistics),
641
- ariaLabel: tooltip,
642
- tooltip,
643
- command: 'workbench.actions.view.toggleProblems'
644
- };
645
- }
646
- getMarkersItemTurnedOff() {
647
- this.statusbarService.updateEntryVisibility('status.problemsVisibility', true);
648
- const openSettingsCommand = 'workbench.action.openSettings';
649
- const configureSettingsLabel = '@id:problems.visibility';
650
- const tooltip = ( localizeWithPath(
651
- 'vs/workbench/contrib/markers/browser/markers.contribution',
652
- 'status.problemsVisibilityOff',
653
- "Problems are turned off. Click to open settings."
654
- ));
655
- return {
656
- name: ( localizeWithPath(
657
- 'vs/workbench/contrib/markers/browser/markers.contribution',
658
- 'status.problemsVisibility',
659
- "Problems Visibility"
660
- )),
661
- text: '$(whole-word)',
662
- ariaLabel: tooltip,
663
- tooltip,
664
- kind: 'warning',
665
- command: { title: openSettingsCommand, arguments: [configureSettingsLabel], id: openSettingsCommand }
666
- };
667
- }
668
- getMarkersTooltip(stats) {
669
- const errorTitle = (n) => ( localizeWithPath(
670
- 'vs/workbench/contrib/markers/browser/markers.contribution',
671
- 'totalErrors',
672
- "Errors: {0}",
673
- n
674
- ));
675
- const warningTitle = (n) => ( localizeWithPath(
676
- 'vs/workbench/contrib/markers/browser/markers.contribution',
677
- 'totalWarnings',
678
- "Warnings: {0}",
679
- n
680
- ));
681
- const infoTitle = (n) => ( localizeWithPath(
682
- 'vs/workbench/contrib/markers/browser/markers.contribution',
683
- 'totalInfos',
684
- "Infos: {0}",
685
- n
686
- ));
687
- const titles = [];
688
- if (stats.errors > 0) {
689
- titles.push(errorTitle(stats.errors));
690
- }
691
- if (stats.warnings > 0) {
692
- titles.push(warningTitle(stats.warnings));
693
- }
694
- if (stats.infos > 0) {
695
- titles.push(infoTitle(stats.infos));
696
- }
697
- if (titles.length === 0) {
698
- return ( localizeWithPath(
699
- 'vs/workbench/contrib/markers/browser/markers.contribution',
700
- 'noProblems',
701
- "No Problems"
702
- ));
703
- }
704
- return titles.join(', ');
705
- }
706
- getMarkersText(stats) {
707
- const problemsText = [];
708
- problemsText.push('$(error) ' + this.packNumber(stats.errors));
709
- problemsText.push('$(warning) ' + this.packNumber(stats.warnings));
710
- if (stats.infos > 0) {
711
- problemsText.push('$(info) ' + this.packNumber(stats.infos));
712
- }
713
- return problemsText.join(' ');
714
- }
715
- packNumber(n) {
716
- const manyProblems = ( localizeWithPath(
717
- 'vs/workbench/contrib/markers/browser/markers.contribution',
718
- 'manyProblems',
719
- "10K+"
720
- ));
721
- return n > 9999 ? manyProblems : n > 999 ? ( n.toString()).charAt(0) + 'K' : ( n.toString());
722
- }
723
- };
724
- MarkersStatusBarContributions = ( __decorate([
725
- ( __param(0, IMarkerService)),
726
- ( __param(1, IStatusbarService)),
727
- ( __param(2, IConfigurationService))
728
- ], MarkersStatusBarContributions));
729
- workbenchRegistry.registerWorkbenchContribution(MarkersStatusBarContributions, 3 );
730
- let ActivityUpdater = class ActivityUpdater extends Disposable {
731
- constructor(activityService, markerService) {
732
- super();
733
- this.activityService = activityService;
734
- this.markerService = markerService;
735
- this.activity = this._register(( new MutableDisposable()));
736
- this._register(this.markerService.onMarkerChanged(() => this.updateBadge()));
737
- this.updateBadge();
738
- }
739
- updateBadge() {
740
- const { errors, warnings, infos } = this.markerService.getStatistics();
741
- const total = errors + warnings + infos;
742
- if (total > 0) {
743
- const message = ( localizeWithPath(
744
- 'vs/workbench/contrib/markers/browser/markers.contribution',
745
- 'totalProblems',
746
- 'Total {0} Problems',
747
- total
748
- ));
749
- this.activity.value = this.activityService.showViewActivity(Markers.MARKERS_VIEW_ID, { badge: ( new NumberBadge(total, () => message)) });
750
- }
751
- else {
752
- this.activity.value = undefined;
753
- }
754
- }
755
- };
756
- ActivityUpdater = ( __decorate([
757
- ( __param(0, IActivityService)),
758
- ( __param(1, IMarkerService))
759
- ], ActivityUpdater));
760
- workbenchRegistry.registerWorkbenchContribution(ActivityUpdater, 3 );