@codingame/monaco-vscode-markers-service-override 11.1.2 → 12.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/index.d.ts +2 -1
- package/index.js +9 -1
- package/package.json +20 -7
- package/vscode/src/vs/workbench/contrib/markers/browser/markers.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markers.contribution.js +114 -123
- package/vscode/src/vs/workbench/contrib/markers/browser/markers.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersFileDecorations.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersFileDecorations.js +16 -14
- package/vscode/src/vs/workbench/contrib/markers/browser/markersFilterOptions.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersFilterOptions.js +1 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersModel.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersModel.js +1 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTable.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTable.js +53 -53
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTreeViewer.d.ts +185 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTreeViewer.js +116 -109
- package/vscode/src/vs/workbench/contrib/markers/browser/markersView.d.ts +138 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersView.js +79 -83
- package/vscode/src/vs/workbench/contrib/markers/browser/markersViewActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/markers/browser/markersViewActions.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/markersViewActions.js +3 -2
- package/vscode/src/vs/workbench/contrib/markers/browser/media/markers.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/markers/browser/messages.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/markers/browser/messages.js +50 -49
- package/markers.js +0 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { append, $, clearNode, addDisposableListener, EventType } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
4
|
import { dirname, basename as basename$1 } from 'vscode/vscode/vs/base/common/path';
|
|
4
5
|
import { CountBadge } from 'vscode/vscode/vs/base/browser/ui/countBadge/countBadge';
|
|
@@ -13,6 +14,7 @@ import { ActionBar } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionbar'
|
|
|
13
14
|
import { QuickFixAction, QuickFixActionViewItem } from './markersViewActions.js';
|
|
14
15
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
15
16
|
import { basename, isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
17
|
+
import { TreeVisibility } from 'vscode/vscode/vs/base/browser/ui/tree/tree';
|
|
16
18
|
import { FilterOptions } from './markersFilterOptions.js';
|
|
17
19
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
18
20
|
import { isUndefinedOrNull } from 'vscode/vscode/vs/base/common/types';
|
|
@@ -26,6 +28,7 @@ import { CodeActionTriggerSource, CodeActionKind } from 'vscode/vscode/vs/editor
|
|
|
26
28
|
import { ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
27
29
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
28
30
|
import { SeverityIcon } from 'vscode/vscode/vs/platform/severityIcon/browser/severityIcon';
|
|
31
|
+
import { CodeActionTriggerType } from 'vscode/vscode/vs/editor/common/languages';
|
|
29
32
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
30
33
|
import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
31
34
|
import { ActionViewItem } from 'vscode/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
@@ -34,10 +37,10 @@ import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistr
|
|
|
34
37
|
import { Link } from 'vscode/vscode/vs/platform/opener/browser/link';
|
|
35
38
|
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
36
39
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
37
|
-
import { MarkersContextKeys } from 'vscode/vscode/vs/workbench/contrib/markers/common/markers';
|
|
40
|
+
import { MarkersViewMode, MarkersContextKeys } from '@codingame/monaco-vscode-2448342b-297f-5823-9f41-f18eef0f6ee8-common/vscode/vs/workbench/contrib/markers/common/markers';
|
|
38
41
|
import { unsupportedSchemas } from 'vscode/vscode/vs/platform/markers/common/markerService';
|
|
39
42
|
import { defaultCountBadgeStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
40
|
-
import Severity
|
|
43
|
+
import Severity from 'vscode/vscode/vs/base/common/severity';
|
|
41
44
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
42
45
|
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
43
46
|
|
|
@@ -46,7 +49,7 @@ let MarkersWidgetAccessibilityProvider = class MarkersWidgetAccessibilityProvide
|
|
|
46
49
|
this.labelService = labelService;
|
|
47
50
|
}
|
|
48
51
|
getWidgetAriaLabel() {
|
|
49
|
-
return
|
|
52
|
+
return localize(7086, "Problems View");
|
|
50
53
|
}
|
|
51
54
|
getAriaLabel(element) {
|
|
52
55
|
if (element instanceof ResourceMarkers) {
|
|
@@ -62,9 +65,15 @@ let MarkersWidgetAccessibilityProvider = class MarkersWidgetAccessibilityProvide
|
|
|
62
65
|
return null;
|
|
63
66
|
}
|
|
64
67
|
};
|
|
65
|
-
MarkersWidgetAccessibilityProvider = (
|
|
66
|
-
(
|
|
67
|
-
], MarkersWidgetAccessibilityProvider))
|
|
68
|
+
MarkersWidgetAccessibilityProvider = ( __decorate([
|
|
69
|
+
( __param(0, ILabelService))
|
|
70
|
+
], MarkersWidgetAccessibilityProvider));
|
|
71
|
+
var TemplateId;
|
|
72
|
+
(function (TemplateId) {
|
|
73
|
+
TemplateId["ResourceMarkers"] = "rm";
|
|
74
|
+
TemplateId["Marker"] = "m";
|
|
75
|
+
TemplateId["RelatedInformation"] = "ri";
|
|
76
|
+
})(TemplateId || (TemplateId = {}));
|
|
68
77
|
class VirtualDelegate {
|
|
69
78
|
static { this.LINE_HEIGHT = 22; }
|
|
70
79
|
constructor(markersViewState) {
|
|
@@ -80,29 +89,35 @@ class VirtualDelegate {
|
|
|
80
89
|
}
|
|
81
90
|
getTemplateId(element) {
|
|
82
91
|
if (element instanceof ResourceMarkers) {
|
|
83
|
-
return
|
|
92
|
+
return TemplateId.ResourceMarkers;
|
|
84
93
|
}
|
|
85
94
|
else if (element instanceof Marker) {
|
|
86
|
-
return
|
|
95
|
+
return TemplateId.Marker;
|
|
87
96
|
}
|
|
88
97
|
else {
|
|
89
|
-
return
|
|
98
|
+
return TemplateId.RelatedInformation;
|
|
90
99
|
}
|
|
91
100
|
}
|
|
92
101
|
}
|
|
102
|
+
var FilterDataType;
|
|
103
|
+
(function (FilterDataType) {
|
|
104
|
+
FilterDataType[FilterDataType["ResourceMarkers"] = 0] = "ResourceMarkers";
|
|
105
|
+
FilterDataType[FilterDataType["Marker"] = 1] = "Marker";
|
|
106
|
+
FilterDataType[FilterDataType["RelatedInformation"] = 2] = "RelatedInformation";
|
|
107
|
+
})(FilterDataType || (FilterDataType = {}));
|
|
93
108
|
class ResourceMarkersRenderer {
|
|
94
109
|
constructor(labels, onDidChangeRenderNodeCount) {
|
|
95
110
|
this.labels = labels;
|
|
96
|
-
this.renderedNodes = (
|
|
97
|
-
this.disposables = (
|
|
98
|
-
this.templateId =
|
|
111
|
+
this.renderedNodes = ( new Map());
|
|
112
|
+
this.disposables = ( new DisposableStore());
|
|
113
|
+
this.templateId = TemplateId.ResourceMarkers;
|
|
99
114
|
onDidChangeRenderNodeCount(this.onDidChangeRenderNodeCount, this, this.disposables);
|
|
100
115
|
}
|
|
101
116
|
renderTemplate(container) {
|
|
102
117
|
const resourceLabelContainer = append(container, $('.resource-label-container'));
|
|
103
118
|
const resourceLabel = this.labels.create(resourceLabelContainer, { supportHighlights: true });
|
|
104
119
|
const badgeWrapper = append(container, $('.count-badge-wrapper'));
|
|
105
|
-
const count = (
|
|
120
|
+
const count = ( new CountBadge(badgeWrapper, {}, defaultCountBadgeStyles));
|
|
106
121
|
return { count, resourceLabel };
|
|
107
122
|
}
|
|
108
123
|
renderElement(node, _, templateData) {
|
|
@@ -117,7 +132,7 @@ class ResourceMarkersRenderer {
|
|
|
117
132
|
const nodeRenders = this.renderedNodes.get(node.element) ?? [];
|
|
118
133
|
const nodeRenderIndex = nodeRenders.findIndex(nodeRender => templateData === nodeRender);
|
|
119
134
|
if (nodeRenderIndex < 0) {
|
|
120
|
-
throw (
|
|
135
|
+
throw ( new Error('Disposing unknown resource marker'));
|
|
121
136
|
}
|
|
122
137
|
if (nodeRenders.length === 1) {
|
|
123
138
|
this.renderedNodes.delete(node.element);
|
|
@@ -128,6 +143,7 @@ class ResourceMarkersRenderer {
|
|
|
128
143
|
}
|
|
129
144
|
disposeTemplate(templateData) {
|
|
130
145
|
templateData.resourceLabel.dispose();
|
|
146
|
+
templateData.count.dispose();
|
|
131
147
|
}
|
|
132
148
|
onDidChangeRenderNodeCount(node) {
|
|
133
149
|
const nodeRenders = this.renderedNodes.get(node.element);
|
|
@@ -149,17 +165,17 @@ let MarkerRenderer = class MarkerRenderer {
|
|
|
149
165
|
this.hoverService = hoverService;
|
|
150
166
|
this.instantiationService = instantiationService;
|
|
151
167
|
this.openerService = openerService;
|
|
152
|
-
this.templateId =
|
|
168
|
+
this.templateId = TemplateId.Marker;
|
|
153
169
|
}
|
|
154
170
|
renderTemplate(container) {
|
|
155
171
|
const data = Object.create(null);
|
|
156
|
-
data.markerWidget = (
|
|
172
|
+
data.markerWidget = ( new MarkerWidget(
|
|
157
173
|
container,
|
|
158
174
|
this.markersViewState,
|
|
159
175
|
this.hoverService,
|
|
160
176
|
this.openerService,
|
|
161
177
|
this.instantiationService
|
|
162
|
-
))
|
|
178
|
+
));
|
|
163
179
|
return data;
|
|
164
180
|
}
|
|
165
181
|
renderElement(node, _, templateData) {
|
|
@@ -169,17 +185,14 @@ let MarkerRenderer = class MarkerRenderer {
|
|
|
169
185
|
templateData.markerWidget.dispose();
|
|
170
186
|
}
|
|
171
187
|
};
|
|
172
|
-
MarkerRenderer = (
|
|
173
|
-
(
|
|
174
|
-
(
|
|
175
|
-
(
|
|
176
|
-
], MarkerRenderer))
|
|
177
|
-
const expandedIcon = registerIcon('markers-view-multi-line-expanded', Codicon.chevronUp, ( localize(
|
|
178
|
-
10306,
|
|
179
|
-
'Icon indicating that multiple lines are shown in the markers view.'
|
|
180
|
-
)));
|
|
188
|
+
MarkerRenderer = ( __decorate([
|
|
189
|
+
( __param(1, IHoverService)),
|
|
190
|
+
( __param(2, IInstantiationService)),
|
|
191
|
+
( __param(3, IOpenerService))
|
|
192
|
+
], MarkerRenderer));
|
|
193
|
+
const expandedIcon = registerIcon('markers-view-multi-line-expanded', Codicon.chevronUp, ( localize(7087, 'Icon indicating that multiple lines are shown in the markers view.')));
|
|
181
194
|
const collapsedIcon = registerIcon('markers-view-multi-line-collapsed', Codicon.chevronDown, ( localize(
|
|
182
|
-
|
|
195
|
+
7088,
|
|
183
196
|
'Icon indicating that multiple lines are collapsed in the markers view.'
|
|
184
197
|
)));
|
|
185
198
|
const toggleMultilineAction = 'problems.action.toggleMultiline';
|
|
@@ -203,10 +216,10 @@ class MarkerWidget extends Disposable {
|
|
|
203
216
|
this.markersViewModel = markersViewModel;
|
|
204
217
|
this._hoverService = _hoverService;
|
|
205
218
|
this._openerService = _openerService;
|
|
206
|
-
this.disposables = this._register((
|
|
207
|
-
this.actionBar = this._register((
|
|
219
|
+
this.disposables = this._register(( new DisposableStore()));
|
|
220
|
+
this.actionBar = this._register(( new ActionBar(append(parent, $('.actions')), {
|
|
208
221
|
actionViewItemProvider: (action, options) => action.id === QuickFixAction.ID ? _instantiationService.createInstance(QuickFixActionViewItem, action, options) : undefined
|
|
209
|
-
})))
|
|
222
|
+
})));
|
|
210
223
|
this.iconContainer = append(parent, $(''));
|
|
211
224
|
this.icon = append(this.iconContainer, $(''));
|
|
212
225
|
this.messageAndDetailsContainer = append(parent, $('.marker-message-details-container'));
|
|
@@ -216,7 +229,7 @@ class MarkerWidget extends Disposable {
|
|
|
216
229
|
this.actionBar.clear();
|
|
217
230
|
this.disposables.clear();
|
|
218
231
|
clearNode(this.messageAndDetailsContainer);
|
|
219
|
-
this.iconContainer.className = `marker-icon ${(
|
|
232
|
+
this.iconContainer.className = `marker-icon ${( Severity.toString(MarkerSeverity.toSeverity(element.marker.severity)))}`;
|
|
220
233
|
this.icon.className = `codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(element.marker.severity))}`;
|
|
221
234
|
this.renderQuickfixActionbar(element);
|
|
222
235
|
this.renderMessageAndDetails(element, filterData);
|
|
@@ -243,22 +256,20 @@ class MarkerWidget extends Disposable {
|
|
|
243
256
|
}
|
|
244
257
|
}
|
|
245
258
|
renderMultilineActionbar(marker, parent) {
|
|
246
|
-
const multilineActionbar = this.disposables.add((
|
|
259
|
+
const multilineActionbar = this.disposables.add(( new ActionBar(append(parent, $('.multiline-actions')), {
|
|
247
260
|
actionViewItemProvider: (action, options) => {
|
|
248
261
|
if (action.id === toggleMultilineAction) {
|
|
249
|
-
return (
|
|
250
|
-
(new ToggleMultilineActionViewItem(undefined, action, { ...options, icon: true }))
|
|
251
|
-
);
|
|
262
|
+
return ( new ToggleMultilineActionViewItem(undefined, action, { ...options, icon: true }));
|
|
252
263
|
}
|
|
253
264
|
return undefined;
|
|
254
265
|
}
|
|
255
|
-
})))
|
|
266
|
+
})));
|
|
256
267
|
this.disposables.add(toDisposable(() => multilineActionbar.dispose()));
|
|
257
268
|
const viewModel = this.markersViewModel.getViewModel(marker);
|
|
258
269
|
const multiline = viewModel && viewModel.multiline;
|
|
259
|
-
const action = (
|
|
270
|
+
const action = ( new Action(toggleMultilineAction));
|
|
260
271
|
action.enabled = !!viewModel && marker.lines.length > 1;
|
|
261
|
-
action.tooltip = multiline ? ( localize(
|
|
272
|
+
action.tooltip = multiline ? ( localize(7089, "Show message in single line")) : ( localize(7090, "Show message in multiple lines"));
|
|
262
273
|
action.class = ThemeIcon.asClassName(multiline ? expandedIcon : collapsedIcon);
|
|
263
274
|
action.run = () => { if (viewModel) {
|
|
264
275
|
viewModel.multiline = !viewModel.multiline;
|
|
@@ -275,7 +286,7 @@ class MarkerWidget extends Disposable {
|
|
|
275
286
|
for (let index = 0; index < (multiline ? lines.length : 1); index++) {
|
|
276
287
|
const lineElement = append(this.messageAndDetailsContainer, $('.marker-message-line'));
|
|
277
288
|
const messageElement = append(lineElement, $('.marker-message'));
|
|
278
|
-
const highlightedLabel = this.disposables.add((
|
|
289
|
+
const highlightedLabel = this.disposables.add(( new HighlightedLabel(messageElement)));
|
|
279
290
|
highlightedLabel.set(lines[index].length > 1000 ? `${lines[index].substring(0, 1000)}...` : lines[index], lineMatches[index]);
|
|
280
291
|
if (lines[index] === '') {
|
|
281
292
|
lineElement.style.height = `${VirtualDelegate.LINE_HEIGHT}px`;
|
|
@@ -288,26 +299,26 @@ class MarkerWidget extends Disposable {
|
|
|
288
299
|
renderDetails(marker, filterData, parent) {
|
|
289
300
|
parent.classList.add('details-container');
|
|
290
301
|
if (marker.source || marker.code) {
|
|
291
|
-
const source = this.disposables.add((
|
|
302
|
+
const source = this.disposables.add(( new HighlightedLabel(append(parent, $('.marker-source')))));
|
|
292
303
|
const sourceMatches = filterData && filterData.sourceMatches || [];
|
|
293
304
|
source.set(marker.source, sourceMatches);
|
|
294
305
|
if (marker.code) {
|
|
295
306
|
if (typeof marker.code === 'string') {
|
|
296
|
-
const code = this.disposables.add((
|
|
307
|
+
const code = this.disposables.add(( new HighlightedLabel(append(parent, $('.marker-code')))));
|
|
297
308
|
const codeMatches = filterData && filterData.codeMatches || [];
|
|
298
309
|
code.set(marker.code, codeMatches);
|
|
299
310
|
}
|
|
300
311
|
else {
|
|
301
312
|
const container = $('.marker-code');
|
|
302
|
-
const code = this.disposables.add((
|
|
303
|
-
const link = (
|
|
304
|
-
this.disposables.add((
|
|
313
|
+
const code = this.disposables.add(( new HighlightedLabel(container)));
|
|
314
|
+
const link = ( marker.code.target.toString(true));
|
|
315
|
+
this.disposables.add(( new Link(
|
|
305
316
|
parent,
|
|
306
317
|
{ href: link, label: container, title: link },
|
|
307
318
|
undefined,
|
|
308
319
|
this._hoverService,
|
|
309
320
|
this._openerService
|
|
310
|
-
)))
|
|
321
|
+
)));
|
|
311
322
|
const codeMatches = filterData && filterData.codeMatches || [];
|
|
312
323
|
code.set(marker.code.value, codeMatches);
|
|
313
324
|
}
|
|
@@ -320,18 +331,18 @@ class MarkerWidget extends Disposable {
|
|
|
320
331
|
let RelatedInformationRenderer = class RelatedInformationRenderer {
|
|
321
332
|
constructor(labelService) {
|
|
322
333
|
this.labelService = labelService;
|
|
323
|
-
this.templateId =
|
|
334
|
+
this.templateId = TemplateId.RelatedInformation;
|
|
324
335
|
}
|
|
325
336
|
renderTemplate(container) {
|
|
326
337
|
const data = Object.create(null);
|
|
327
338
|
append(container, $('.actions'));
|
|
328
339
|
append(container, $('.icon'));
|
|
329
|
-
data.resourceLabel = (
|
|
340
|
+
data.resourceLabel = ( new HighlightedLabel(append(container, $('.related-info-resource'))));
|
|
330
341
|
data.lnCol = append(container, $('span.marker-line'));
|
|
331
342
|
const separator = append(container, $('span.related-info-resource-separator'));
|
|
332
343
|
separator.textContent = ':';
|
|
333
344
|
separator.style.paddingRight = '4px';
|
|
334
|
-
data.description = (
|
|
345
|
+
data.description = ( new HighlightedLabel(append(container, $('.marker-description'))));
|
|
335
346
|
return data;
|
|
336
347
|
}
|
|
337
348
|
renderElement(node, _, templateData) {
|
|
@@ -348,9 +359,9 @@ let RelatedInformationRenderer = class RelatedInformationRenderer {
|
|
|
348
359
|
templateData.description.dispose();
|
|
349
360
|
}
|
|
350
361
|
};
|
|
351
|
-
RelatedInformationRenderer = (
|
|
352
|
-
(
|
|
353
|
-
], RelatedInformationRenderer))
|
|
362
|
+
RelatedInformationRenderer = ( __decorate([
|
|
363
|
+
( __param(0, ILabelService))
|
|
364
|
+
], RelatedInformationRenderer));
|
|
354
365
|
class Filter {
|
|
355
366
|
constructor(options) {
|
|
356
367
|
this.options = options;
|
|
@@ -367,7 +378,7 @@ class Filter {
|
|
|
367
378
|
}
|
|
368
379
|
}
|
|
369
380
|
filterResourceMarkers(resourceMarkers) {
|
|
370
|
-
if ((
|
|
381
|
+
if (( unsupportedSchemas.has(resourceMarkers.resource.scheme))) {
|
|
371
382
|
return false;
|
|
372
383
|
}
|
|
373
384
|
if (this.options.excludesMatcher.matches(resourceMarkers.resource)) {
|
|
@@ -379,10 +390,10 @@ class Filter {
|
|
|
379
390
|
if (this.options.textFilter.text && !this.options.textFilter.negate) {
|
|
380
391
|
const uriMatches = FilterOptions._filter(this.options.textFilter.text, basename(resourceMarkers.resource));
|
|
381
392
|
if (uriMatches) {
|
|
382
|
-
return { visibility: true, data: { type:
|
|
393
|
+
return { visibility: true, data: { type: FilterDataType.ResourceMarkers, uriMatches: uriMatches || [] } };
|
|
383
394
|
}
|
|
384
395
|
}
|
|
385
|
-
return
|
|
396
|
+
return TreeVisibility.Recurse;
|
|
386
397
|
}
|
|
387
398
|
filterMarker(marker, parentVisibility) {
|
|
388
399
|
const matchesSeverity = this.options.showErrors && MarkerSeverity.Error === marker.marker.severity ||
|
|
@@ -401,14 +412,14 @@ class Filter {
|
|
|
401
412
|
}
|
|
402
413
|
const sourceMatches = marker.marker.source ? FilterOptions._filter(this.options.textFilter.text, marker.marker.source) : undefined;
|
|
403
414
|
const codeMatches = marker.marker.code ? FilterOptions._filter(this.options.textFilter.text, typeof marker.marker.code === 'string' ? marker.marker.code : marker.marker.code.value) : undefined;
|
|
404
|
-
const matched = sourceMatches || codeMatches || (
|
|
415
|
+
const matched = sourceMatches || codeMatches || ( lineMatches.some(lineMatch => lineMatch.length > 0));
|
|
405
416
|
if (matched && !this.options.textFilter.negate) {
|
|
406
|
-
return { visibility: true, data: { type:
|
|
417
|
+
return { visibility: true, data: { type: FilterDataType.Marker, lineMatches, sourceMatches: sourceMatches || [], codeMatches: codeMatches || [] } };
|
|
407
418
|
}
|
|
408
|
-
if (matched && this.options.textFilter.negate && parentVisibility ===
|
|
419
|
+
if (matched && this.options.textFilter.negate && parentVisibility === TreeVisibility.Recurse) {
|
|
409
420
|
return false;
|
|
410
421
|
}
|
|
411
|
-
if (!matched && this.options.textFilter.negate && parentVisibility ===
|
|
422
|
+
if (!matched && this.options.textFilter.negate && parentVisibility === TreeVisibility.Recurse) {
|
|
412
423
|
return true;
|
|
413
424
|
}
|
|
414
425
|
return parentVisibility;
|
|
@@ -421,12 +432,12 @@ class Filter {
|
|
|
421
432
|
const messageMatches = FilterOptions._messageFilter(this.options.textFilter.text, basename$1(relatedInformation.raw.message));
|
|
422
433
|
const matched = uriMatches || messageMatches;
|
|
423
434
|
if (matched && !this.options.textFilter.negate) {
|
|
424
|
-
return { visibility: true, data: { type:
|
|
435
|
+
return { visibility: true, data: { type: FilterDataType.RelatedInformation, uriMatches: uriMatches || [], messageMatches: messageMatches || [] } };
|
|
425
436
|
}
|
|
426
|
-
if (matched && this.options.textFilter.negate && parentVisibility ===
|
|
437
|
+
if (matched && this.options.textFilter.negate && parentVisibility === TreeVisibility.Recurse) {
|
|
427
438
|
return false;
|
|
428
439
|
}
|
|
429
|
-
if (!matched && this.options.textFilter.negate && parentVisibility ===
|
|
440
|
+
if (!matched && this.options.textFilter.negate && parentVisibility === TreeVisibility.Recurse) {
|
|
430
441
|
return true;
|
|
431
442
|
}
|
|
432
443
|
return parentVisibility;
|
|
@@ -440,7 +451,7 @@ let MarkerViewModel = class MarkerViewModel extends Disposable {
|
|
|
440
451
|
this.instantiationService = instantiationService;
|
|
441
452
|
this.editorService = editorService;
|
|
442
453
|
this.languageFeaturesService = languageFeaturesService;
|
|
443
|
-
this._onDidChange = this._register((
|
|
454
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
444
455
|
this.onDidChange = this._onDidChange.event;
|
|
445
456
|
this.modelPromise = null;
|
|
446
457
|
this.codeActionsPromise = null;
|
|
@@ -487,13 +498,13 @@ let MarkerViewModel = class MarkerViewModel extends Disposable {
|
|
|
487
498
|
if (model) {
|
|
488
499
|
if (!this.codeActionsPromise) {
|
|
489
500
|
this.codeActionsPromise = createCancelablePromise(cancellationToken => {
|
|
490
|
-
return getCodeActions(this.languageFeaturesService.codeActionProvider, model, (
|
|
501
|
+
return getCodeActions(this.languageFeaturesService.codeActionProvider, model, ( new Range(
|
|
491
502
|
this.marker.range.startLineNumber,
|
|
492
503
|
this.marker.range.startColumn,
|
|
493
504
|
this.marker.range.endLineNumber,
|
|
494
505
|
this.marker.range.endColumn
|
|
495
|
-
))
|
|
496
|
-
type:
|
|
506
|
+
)), {
|
|
507
|
+
type: CodeActionTriggerType.Invoke, triggerAction: CodeActionTriggerSource.ProblemsView, filter: { include: CodeActionKind.QuickFix }
|
|
497
508
|
}, Progress.None, cancellationToken).then(actions => {
|
|
498
509
|
return this._register(actions);
|
|
499
510
|
});
|
|
@@ -505,18 +516,16 @@ let MarkerViewModel = class MarkerViewModel extends Disposable {
|
|
|
505
516
|
});
|
|
506
517
|
}
|
|
507
518
|
toActions(codeActions) {
|
|
508
|
-
return (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
()
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
)))))
|
|
519
|
-
);
|
|
519
|
+
return ( codeActions.validActions.map(item => ( new Action(
|
|
520
|
+
item.action.command ? item.action.command.id : item.action.title,
|
|
521
|
+
item.action.title,
|
|
522
|
+
undefined,
|
|
523
|
+
true,
|
|
524
|
+
() => {
|
|
525
|
+
return this.openFileAtMarker(this.marker)
|
|
526
|
+
.then(() => this.instantiationService.invokeFunction(applyCodeAction, item, ApplyCodeActionReason.FromProblemsView));
|
|
527
|
+
}
|
|
528
|
+
))));
|
|
520
529
|
}
|
|
521
530
|
openFileAtMarker(element) {
|
|
522
531
|
const { resource, selection } = { resource: element.resource, selection: element.range };
|
|
@@ -538,15 +547,13 @@ let MarkerViewModel = class MarkerViewModel extends Disposable {
|
|
|
538
547
|
if (waitForModel) {
|
|
539
548
|
if (!this.modelPromise) {
|
|
540
549
|
this.modelPromise = createCancelablePromise(cancellationToken => {
|
|
541
|
-
return (
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}))
|
|
549
|
-
);
|
|
550
|
+
return ( new Promise((c) => {
|
|
551
|
+
this._register(this.modelService.onModelAdded(model => {
|
|
552
|
+
if (isEqual(model.uri, this.marker.resource)) {
|
|
553
|
+
c(model);
|
|
554
|
+
}
|
|
555
|
+
}));
|
|
556
|
+
}));
|
|
550
557
|
});
|
|
551
558
|
}
|
|
552
559
|
return this.modelPromise;
|
|
@@ -554,35 +561,35 @@ let MarkerViewModel = class MarkerViewModel extends Disposable {
|
|
|
554
561
|
return Promise.resolve(null);
|
|
555
562
|
}
|
|
556
563
|
};
|
|
557
|
-
MarkerViewModel = (
|
|
558
|
-
(
|
|
559
|
-
(
|
|
560
|
-
(
|
|
561
|
-
(
|
|
562
|
-
], MarkerViewModel))
|
|
564
|
+
MarkerViewModel = ( __decorate([
|
|
565
|
+
( __param(1, IModelService)),
|
|
566
|
+
( __param(2, IInstantiationService)),
|
|
567
|
+
( __param(3, IEditorService)),
|
|
568
|
+
( __param(4, ILanguageFeaturesService))
|
|
569
|
+
], MarkerViewModel));
|
|
563
570
|
let MarkersViewModel = class MarkersViewModel extends Disposable {
|
|
564
|
-
constructor(multiline = true, viewMode =
|
|
571
|
+
constructor(multiline = true, viewMode = MarkersViewMode.Tree, contextKeyService, instantiationService) {
|
|
565
572
|
super();
|
|
566
573
|
this.contextKeyService = contextKeyService;
|
|
567
574
|
this.instantiationService = instantiationService;
|
|
568
|
-
this._onDidChange = this._register((
|
|
575
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
569
576
|
this.onDidChange = this._onDidChange.event;
|
|
570
|
-
this._onDidChangeViewMode = this._register((
|
|
577
|
+
this._onDidChangeViewMode = this._register(( new Emitter()));
|
|
571
578
|
this.onDidChangeViewMode = this._onDidChangeViewMode.event;
|
|
572
|
-
this.markersViewStates = (
|
|
573
|
-
this.markersPerResource = (
|
|
579
|
+
this.markersViewStates = ( new Map());
|
|
580
|
+
this.markersPerResource = ( new Map());
|
|
574
581
|
this.bulkUpdate = false;
|
|
575
582
|
this.hoveredMarker = null;
|
|
576
|
-
this.hoverDelayer = (
|
|
583
|
+
this.hoverDelayer = ( new Delayer(300));
|
|
577
584
|
this._multiline = true;
|
|
578
|
-
this._viewMode =
|
|
585
|
+
this._viewMode = MarkersViewMode.Tree;
|
|
579
586
|
this._multiline = multiline;
|
|
580
587
|
this._viewMode = viewMode;
|
|
581
588
|
this.viewModeContextKey = MarkersContextKeys.MarkersViewModeContextKey.bindTo(this.contextKeyService);
|
|
582
589
|
this.viewModeContextKey.set(viewMode);
|
|
583
590
|
}
|
|
584
591
|
add(marker) {
|
|
585
|
-
if (!(
|
|
592
|
+
if (!( this.markersViewStates.has(marker.id))) {
|
|
586
593
|
const viewModel = this.instantiationService.createInstance(MarkerViewModel, marker);
|
|
587
594
|
const disposables = [viewModel];
|
|
588
595
|
viewModel.multiline = this.multiline;
|
|
@@ -592,13 +599,13 @@ let MarkersViewModel = class MarkersViewModel extends Disposable {
|
|
|
592
599
|
}
|
|
593
600
|
}, this, disposables);
|
|
594
601
|
this.markersViewStates.set(marker.id, { viewModel, disposables });
|
|
595
|
-
const markers = this.markersPerResource.get((
|
|
602
|
+
const markers = this.markersPerResource.get(( marker.resource.toString())) || [];
|
|
596
603
|
markers.push(marker);
|
|
597
|
-
this.markersPerResource.set((
|
|
604
|
+
this.markersPerResource.set(( marker.resource.toString()), markers);
|
|
598
605
|
}
|
|
599
606
|
}
|
|
600
607
|
remove(resource) {
|
|
601
|
-
const markers = this.markersPerResource.get((
|
|
608
|
+
const markers = this.markersPerResource.get(( resource.toString())) || [];
|
|
602
609
|
for (const marker of markers) {
|
|
603
610
|
const value = this.markersViewStates.get(marker.id);
|
|
604
611
|
if (value) {
|
|
@@ -609,7 +616,7 @@ let MarkersViewModel = class MarkersViewModel extends Disposable {
|
|
|
609
616
|
this.hoveredMarker = null;
|
|
610
617
|
}
|
|
611
618
|
}
|
|
612
|
-
this.markersPerResource.delete((
|
|
619
|
+
this.markersPerResource.delete(( resource.toString()));
|
|
613
620
|
}
|
|
614
621
|
getViewModel(marker) {
|
|
615
622
|
const value = this.markersViewStates.get(marker.id);
|
|
@@ -670,9 +677,9 @@ let MarkersViewModel = class MarkersViewModel extends Disposable {
|
|
|
670
677
|
super.dispose();
|
|
671
678
|
}
|
|
672
679
|
};
|
|
673
|
-
MarkersViewModel = (
|
|
674
|
-
(
|
|
675
|
-
(
|
|
676
|
-
], MarkersViewModel))
|
|
680
|
+
MarkersViewModel = ( __decorate([
|
|
681
|
+
( __param(2, IContextKeyService)),
|
|
682
|
+
( __param(3, IInstantiationService))
|
|
683
|
+
], MarkersViewModel));
|
|
677
684
|
|
|
678
685
|
export { Filter, MarkerRenderer, MarkerViewModel, MarkersViewModel, MarkersWidgetAccessibilityProvider, RelatedInformationRenderer, ResourceMarkersRenderer, VirtualDelegate };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
2
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
3
|
+
import { Marker, ResourceMarkers, MarkerElement, MarkerTableItem } from "./markersModel.js";
|
|
4
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { MarkersFilters } from "./markersViewActions.js";
|
|
6
|
+
import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
|
|
7
|
+
import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
|
|
8
|
+
import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
|
|
9
|
+
import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
10
|
+
import { ITreeContextMenuEvent, ITreeEvent } from "vscode/vscode/vs/base/browser/ui/tree/tree";
|
|
11
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
12
|
+
import { IOpenEvent } from "vscode/vscode/vs/platform/list/browser/listService";
|
|
13
|
+
import { FilterOptions } from "./markersFilterOptions.js";
|
|
14
|
+
import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
|
|
15
|
+
import { IContextMenuService } from "vscode/vscode/vs/platform/contextview/browser/contextView.service";
|
|
16
|
+
import { IKeybindingService } from "vscode/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
17
|
+
import { IMarkerService } from "vscode/vscode/vs/platform/markers/common/markers.service";
|
|
18
|
+
import { IViewPaneOptions, FilterViewPane } from "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane";
|
|
19
|
+
import { IViewDescriptorService } from "vscode/vscode/vs/workbench/common/views.service";
|
|
20
|
+
import { IOpenerService } from "vscode/vscode/vs/platform/opener/common/opener.service";
|
|
21
|
+
import { IUriIdentityService } from "vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
22
|
+
import { IMarkersView } from "./markers.js";
|
|
23
|
+
import { ITableContextMenuEvent, ITableEvent } from "vscode/vscode/vs/base/browser/ui/table/table";
|
|
24
|
+
import { MarkersViewMode } from "@codingame/monaco-vscode-2448342b-297f-5823-9f41-f18eef0f6ee8-common/vscode/vs/workbench/contrib/markers/common/markers";
|
|
25
|
+
import { IHoverService } from "vscode/vscode/vs/platform/hover/browser/hover.service";
|
|
26
|
+
export interface IProblemsWidget {
|
|
27
|
+
get contextKeyService(): IContextKeyService;
|
|
28
|
+
get onContextMenu(): Event<ITreeContextMenuEvent<MarkerElement | null>> | Event<ITableContextMenuEvent<MarkerTableItem>>;
|
|
29
|
+
get onDidChangeFocus(): Event<ITreeEvent<MarkerElement | null>> | Event<ITableEvent<MarkerTableItem>>;
|
|
30
|
+
get onDidChangeSelection(): Event<ITreeEvent<MarkerElement | null>> | Event<ITableEvent<MarkerTableItem>>;
|
|
31
|
+
get onDidOpen(): Event<IOpenEvent<MarkerElement | MarkerTableItem | undefined>>;
|
|
32
|
+
collapseMarkers(): void;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
domFocus(): void;
|
|
35
|
+
filterMarkers(resourceMarkers: ResourceMarkers[], filterOptions: FilterOptions): void;
|
|
36
|
+
getFocus(): (MarkerElement | MarkerTableItem | null)[];
|
|
37
|
+
getHTMLElement(): HTMLElement;
|
|
38
|
+
getRelativeTop(location: MarkerElement | MarkerTableItem | null): number | null;
|
|
39
|
+
getSelection(): (MarkerElement | MarkerTableItem | null)[];
|
|
40
|
+
getVisibleItemCount(): number;
|
|
41
|
+
layout(height: number, width: number): void;
|
|
42
|
+
reset(resourceMarkers: ResourceMarkers[]): void;
|
|
43
|
+
revealMarkers(activeResource: ResourceMarkers | null, focus: boolean, lastSelectedRelativeTop: number): void;
|
|
44
|
+
setAriaLabel(label: string): void;
|
|
45
|
+
setMarkerSelection(selection?: Marker[], focus?: Marker[]): void;
|
|
46
|
+
toggleVisibility(hide: boolean): void;
|
|
47
|
+
update(resourceMarkers: ResourceMarkers[]): void;
|
|
48
|
+
updateMarker(marker: Marker): void;
|
|
49
|
+
}
|
|
50
|
+
export declare class MarkersView extends FilterViewPane implements IMarkersView {
|
|
51
|
+
private readonly editorService;
|
|
52
|
+
private readonly markerService;
|
|
53
|
+
private readonly workspaceContextService;
|
|
54
|
+
private readonly uriIdentityService;
|
|
55
|
+
private lastSelectedRelativeTop;
|
|
56
|
+
private currentActiveResource;
|
|
57
|
+
private readonly rangeHighlightDecorations;
|
|
58
|
+
private readonly markersModel;
|
|
59
|
+
private readonly filter;
|
|
60
|
+
private readonly onVisibleDisposables;
|
|
61
|
+
private widget;
|
|
62
|
+
private readonly widgetDisposables;
|
|
63
|
+
private widgetContainer;
|
|
64
|
+
private widgetIdentityProvider;
|
|
65
|
+
private widgetAccessibilityProvider;
|
|
66
|
+
private messageBoxContainer;
|
|
67
|
+
private ariaLabelElement;
|
|
68
|
+
readonly filters: MarkersFilters;
|
|
69
|
+
private currentHeight;
|
|
70
|
+
private currentWidth;
|
|
71
|
+
private readonly memento;
|
|
72
|
+
private readonly panelState;
|
|
73
|
+
private cachedFilterStats;
|
|
74
|
+
private currentResourceGotAddedToMarkersData;
|
|
75
|
+
private readonly markersViewModel;
|
|
76
|
+
readonly onDidChangeVisibility: Event<boolean>;
|
|
77
|
+
constructor(options: IViewPaneOptions, instantiationService: IInstantiationService, viewDescriptorService: IViewDescriptorService, editorService: IEditorService, configurationService: IConfigurationService, telemetryService: ITelemetryService, markerService: IMarkerService, contextKeyService: IContextKeyService, workspaceContextService: IWorkspaceContextService, contextMenuService: IContextMenuService, uriIdentityService: IUriIdentityService, keybindingService: IKeybindingService, storageService: IStorageService, openerService: IOpenerService, themeService: IThemeService, hoverService: IHoverService);
|
|
78
|
+
render(): void;
|
|
79
|
+
protected renderBody(parent: HTMLElement): void;
|
|
80
|
+
getTitle(): string;
|
|
81
|
+
protected layoutBodyContent(height?: number, width?: number): void;
|
|
82
|
+
focus(): void;
|
|
83
|
+
focusFilter(): void;
|
|
84
|
+
updateBadge(total: number, filtered: number): void;
|
|
85
|
+
checkMoreFilters(): void;
|
|
86
|
+
clearFilterText(): void;
|
|
87
|
+
showQuickFixes(marker: Marker): void;
|
|
88
|
+
openFileAtElement(element: any, preserveFocus: boolean, sideByside: boolean, pinned: boolean): boolean;
|
|
89
|
+
private refreshPanel;
|
|
90
|
+
private onDidChangeViewState;
|
|
91
|
+
private resetWidget;
|
|
92
|
+
private updateFilter;
|
|
93
|
+
private getDefaultViewMode;
|
|
94
|
+
private getFilesExcludeExpressions;
|
|
95
|
+
private getFilesExclude;
|
|
96
|
+
private getResourceMarkers;
|
|
97
|
+
private createMessageBox;
|
|
98
|
+
private createArialLabelElement;
|
|
99
|
+
private createWidget;
|
|
100
|
+
private createTable;
|
|
101
|
+
private createTree;
|
|
102
|
+
collapseAll(): void;
|
|
103
|
+
setMultiline(multiline: boolean): void;
|
|
104
|
+
setViewMode(viewMode: MarkersViewMode): void;
|
|
105
|
+
private onDidChangeMarkersViewVisibility;
|
|
106
|
+
private reInitialize;
|
|
107
|
+
private onDidChangeModel;
|
|
108
|
+
private onDidChangeViewMode;
|
|
109
|
+
private isCurrentResourceGotAddedToMarkersData;
|
|
110
|
+
private onActiveEditorChanged;
|
|
111
|
+
private setCurrentActiveEditor;
|
|
112
|
+
private onSelected;
|
|
113
|
+
private hasNoProblems;
|
|
114
|
+
private renderContent;
|
|
115
|
+
private renderMessage;
|
|
116
|
+
private renderFilterMessageForActiveFile;
|
|
117
|
+
private renderFilteredByFilterMessage;
|
|
118
|
+
private renderNoProblemsMessageForActiveFile;
|
|
119
|
+
private renderNoProblemsMessage;
|
|
120
|
+
private setAriaLabel;
|
|
121
|
+
private clearFilters;
|
|
122
|
+
private autoReveal;
|
|
123
|
+
private getResourceForCurrentActiveResource;
|
|
124
|
+
private updateRangeHighlights;
|
|
125
|
+
private highlightCurrentSelectedMarkerRange;
|
|
126
|
+
private onContextMenu;
|
|
127
|
+
private getMenuActions;
|
|
128
|
+
getFocusElement(): MarkerElement | undefined;
|
|
129
|
+
getFocusedSelectedElements(): MarkerElement[] | null;
|
|
130
|
+
getAllResourceMarkers(): ResourceMarkers[];
|
|
131
|
+
getFilterStats(): {
|
|
132
|
+
total: number;
|
|
133
|
+
filtered: number;
|
|
134
|
+
};
|
|
135
|
+
private toggleVisibility;
|
|
136
|
+
saveState(): void;
|
|
137
|
+
dispose(): void;
|
|
138
|
+
}
|