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