@codingame/monaco-vscode-markers-service-override 25.1.2 → 26.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.
@@ -20,8 +20,8 @@ let MarkerChatContextPick = class MarkerChatContextPick {
20
20
  this._markerService = _markerService;
21
21
  this._labelService = _labelService;
22
22
  this._editorService = _editorService;
23
- this.type = 'pickerPick';
24
- this.label = ( localize(8649, 'Problems...'));
23
+ this.type = "pickerPick";
24
+ this.label = ( localize(8956, "Problems..."));
25
25
  this.icon = Codicon.error;
26
26
  this.ordinal = -100;
27
27
  }
@@ -30,14 +30,16 @@ let MarkerChatContextPick = class MarkerChatContextPick {
30
30
  }
31
31
  asPicker() {
32
32
  return {
33
- placeholder: ( localize(8650, 'Select a problem to attach')),
33
+ placeholder: ( localize(8957, "Select a problem to attach")),
34
34
  picks: picksWithPromiseFn(async (query, token) => {
35
35
  return this.getPicksForQuery(query);
36
36
  })
37
37
  };
38
38
  }
39
39
  getPicksForQuery(query) {
40
- const markers = this._markerService.read({ severities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info });
40
+ const markers = this._markerService.read({
41
+ severities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info
42
+ });
41
43
  const grouped = groupBy(markers, (a, b) => extUri.compare(a.resource, b.resource));
42
44
  const activeEditorUri = EditorResourceAccessor.getCanonicalUri(this._editorService.activeEditor);
43
45
  const sortedGroups = grouped.sort((groupA, groupB) => {
@@ -60,18 +62,23 @@ let MarkerChatContextPick = class MarkerChatContextPick {
60
62
  for (const group of sortedGroups) {
61
63
  const resource = group[0].resource;
62
64
  const isActiveFile = activeEditorUri && extUri.isEqual(resource, activeEditorUri);
63
- const fileLabel = this._labelService.getUriLabel(resource, { relative: true });
65
+ const fileLabel = this._labelService.getUriLabel(resource, {
66
+ relative: true
67
+ });
64
68
  const separatorLabel = isActiveFile ? `${fileLabel} (current file)` : fileLabel;
65
- items.push({ type: 'separator', label: separatorLabel });
69
+ items.push({
70
+ type: "separator",
71
+ label: separatorLabel
72
+ });
66
73
  for (const marker of group) {
67
74
  severities.add(marker.severity);
68
75
  items.push({
69
76
  label: marker.message,
70
77
  description: ( localize(
71
- 8651,
78
+ 8958,
72
79
  "[Ln {0}, Col {1}]",
73
- '' + marker.startLineNumber,
74
- '' + marker.startColumn
80
+ "" + marker.startLineNumber,
81
+ "" + marker.startColumn
75
82
  )),
76
83
  asAttachment() {
77
84
  return IDiagnosticVariableEntryFilterData.toEntry(IDiagnosticVariableEntryFilterData.fromMarker(marker));
@@ -80,31 +87,28 @@ let MarkerChatContextPick = class MarkerChatContextPick {
80
87
  }
81
88
  }
82
89
  items.unshift({
83
- label: ( localize(8652, 'All Problems')),
90
+ label: ( localize(8959, "All Problems")),
84
91
  asAttachment() {
85
92
  return IDiagnosticVariableEntryFilterData.toEntry({
86
93
  filterSeverity: MarkerSeverity.Info
87
94
  });
88
- },
95
+ }
89
96
  });
90
97
  return items;
91
98
  }
92
99
  };
93
- MarkerChatContextPick = ( __decorate([
94
- ( __param(0, IMarkerService)),
95
- ( __param(1, ILabelService)),
96
- ( __param(2, IEditorService))
97
- ], MarkerChatContextPick));
100
+ MarkerChatContextPick = ( __decorate([( __param(0, IMarkerService)), ( __param(1, ILabelService)), ( __param(2, IEditorService))], MarkerChatContextPick));
98
101
  let MarkerChatContextContribution = class MarkerChatContextContribution extends Disposable {
99
- static { this.ID = 'workbench.contrib.chat.markerChatContextContribution'; }
102
+ static {
103
+ this.ID = "workbench.contrib.chat.markerChatContextContribution";
104
+ }
100
105
  constructor(contextPickService, instantiationService) {
101
106
  super();
102
- this._store.add(contextPickService.registerChatContextItem(instantiationService.createInstance(MarkerChatContextPick)));
107
+ this._store.add(
108
+ contextPickService.registerChatContextItem(instantiationService.createInstance(MarkerChatContextPick))
109
+ );
103
110
  }
104
111
  };
105
- MarkerChatContextContribution = ( __decorate([
106
- ( __param(0, IChatContextPickService)),
107
- ( __param(1, IInstantiationService))
108
- ], MarkerChatContextContribution));
112
+ MarkerChatContextContribution = ( __decorate([( __param(0, IChatContextPickService)), ( __param(1, IInstantiationService))], MarkerChatContextContribution));
109
113
 
110
114
  export { MarkerChatContextContribution };
@@ -25,7 +25,7 @@ import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench
25
25
  class MarkersDecorationsProvider {
26
26
  constructor(_markerService) {
27
27
  this._markerService = _markerService;
28
- this.label = ( localize(8653, "Problems"));
28
+ this.label = ( localize(8960, "Problems"));
29
29
  this.onDidChange = _markerService.onMarkerChanged;
30
30
  }
31
31
  provideDecorations(resource) {
@@ -45,9 +45,9 @@ class MarkersDecorationsProvider {
45
45
  return {
46
46
  weight: 100 * first.severity,
47
47
  bubble: true,
48
- tooltip: markers.length === 1 ? ( localize(8654, "1 problem in this file")) : ( localize(8655, "{0} problems in this file", markers.length)),
49
- letter: markers.length < 10 ? ( markers.length.toString()) : '9+',
50
- color: first.severity === MarkerSeverity.Error ? listErrorForeground : listWarningForeground,
48
+ tooltip: markers.length === 1 ? ( localize(8961, "1 problem in this file")) : ( localize(8962, "{0} problems in this file", markers.length)),
49
+ letter: markers.length < 10 ? ( markers.length.toString()) : "9+",
50
+ color: first.severity === MarkerSeverity.Error ? listErrorForeground : listWarningForeground
51
51
  };
52
52
  }
53
53
  }
@@ -56,13 +56,11 @@ let MarkersFileDecorations = class MarkersFileDecorations {
56
56
  this._markerService = _markerService;
57
57
  this._decorationsService = _decorationsService;
58
58
  this._configurationService = _configurationService;
59
- this._disposables = [
60
- this._configurationService.onDidChangeConfiguration(e => {
61
- if (e.affectsConfiguration('problems.visibility')) {
62
- this._updateEnablement();
63
- }
64
- }),
65
- ];
59
+ this._disposables = [this._configurationService.onDidChangeConfiguration(e => {
60
+ if (e.affectsConfiguration("problems.visibility")) {
61
+ this._updateEnablement();
62
+ }
63
+ })];
66
64
  this._updateEnablement();
67
65
  }
68
66
  dispose() {
@@ -70,11 +68,11 @@ let MarkersFileDecorations = class MarkersFileDecorations {
70
68
  dispose(this._disposables);
71
69
  }
72
70
  _updateEnablement() {
73
- const problem = this._configurationService.getValue('problems.visibility');
71
+ const problem = this._configurationService.getValue("problems.visibility");
74
72
  if (problem === undefined) {
75
73
  return;
76
74
  }
77
- const value = this._configurationService.getValue('problems');
75
+ const value = this._configurationService.getValue("problems");
78
76
  const shouldEnable = (problem && value.decorations.enabled);
79
77
  if (shouldEnable === this._enabled) {
80
78
  if (!problem || !value.decorations.enabled) {
@@ -87,32 +85,26 @@ let MarkersFileDecorations = class MarkersFileDecorations {
87
85
  if (this._enabled) {
88
86
  const provider = ( new MarkersDecorationsProvider(this._markerService));
89
87
  this._provider = this._decorationsService.registerDecorationsProvider(provider);
90
- }
91
- else if (this._provider) {
88
+ } else if (this._provider) {
92
89
  this._provider.dispose();
93
90
  }
94
91
  }
95
92
  };
96
- MarkersFileDecorations = ( __decorate([
97
- ( __param(0, IMarkerService)),
98
- ( __param(1, IDecorationsService)),
99
- ( __param(2, IConfigurationService))
100
- ], MarkersFileDecorations));
93
+ MarkersFileDecorations = ( __decorate([( __param(0, IMarkerService)), ( __param(1, IDecorationsService)), ( __param(2, IConfigurationService))], MarkersFileDecorations));
101
94
  ( Registry.as(Extensions.Configuration)).registerConfiguration({
102
- 'id': 'problems',
103
- 'order': 101,
104
- 'type': 'object',
105
- 'properties': {
106
- 'problems.decorations.enabled': {
107
- 'markdownDescription': ( localize(
108
- 8656,
95
+ "id": "problems",
96
+ "order": 101,
97
+ "type": "object",
98
+ "properties": {
99
+ "problems.decorations.enabled": {
100
+ "markdownDescription": ( localize(
101
+ 8963,
109
102
  "Show Errors & Warnings on files and folder. Overwritten by {0} when it is off.",
110
- '`#problems.visibility#`'
103
+ "`#problems.visibility#`"
111
104
  )),
112
- 'type': 'boolean',
113
- 'default': true
105
+ "type": "boolean",
106
+ "default": true
114
107
  }
115
108
  }
116
109
  });
117
- ( Registry.as(Extensions$1.Workbench))
118
- .registerWorkbenchContribution(MarkersFileDecorations, LifecyclePhase.Restored);
110
+ ( Registry.as(Extensions$1.Workbench)).registerWorkbenchContribution(MarkersFileDecorations, LifecyclePhase.Restored);
@@ -11,7 +11,10 @@ class ResourceGlobMatcher {
11
11
  this.globalExpression = parse(globalExpression);
12
12
  this.expressionsByRoot = TernarySearchTree.forUris(uri => uriIdentityService.extUri.ignorePathCasing(uri));
13
13
  for (const expression of rootExpressions) {
14
- this.expressionsByRoot.set(expression.root, { root: expression.root, expression: parse(expression.expression) });
14
+ this.expressionsByRoot.set(expression.root, {
15
+ root: expression.root,
16
+ expression: parse(expression.expression)
17
+ });
15
18
  }
16
19
  }
17
20
  matches(resource) {
@@ -26,10 +29,23 @@ class ResourceGlobMatcher {
26
29
  }
27
30
  }
28
31
  class FilterOptions {
29
- static { this._filter = matchesFuzzy2; }
30
- static { this._messageFilter = matchesFuzzy; }
31
- static EMPTY(uriIdentityService) { return ( new FilterOptions('', [], false, false, false, uriIdentityService)); }
32
- constructor(filter, filesExclude, showWarnings, showErrors, showInfos, uriIdentityService) {
32
+ static {
33
+ this._filter = matchesFuzzy2;
34
+ }
35
+ static {
36
+ this._messageFilter = matchesFuzzy;
37
+ }
38
+ static EMPTY(uriIdentityService) {
39
+ return ( new FilterOptions("", [], false, false, false, uriIdentityService));
40
+ }
41
+ constructor(
42
+ filter,
43
+ filesExclude,
44
+ showWarnings,
45
+ showErrors,
46
+ showInfos,
47
+ uriIdentityService
48
+ ) {
33
49
  this.filter = filter;
34
50
  this.showWarnings = false;
35
51
  this.showErrors = false;
@@ -40,10 +56,12 @@ class FilterOptions {
40
56
  this.showInfos = showInfos;
41
57
  const filesExcludeByRoot = Array.isArray(filesExclude) ? filesExclude : [];
42
58
  const excludesExpression = Array.isArray(filesExclude) ? getEmptyExpression() : filesExclude;
43
- for (const { expression } of filesExcludeByRoot) {
59
+ for (const {
60
+ expression
61
+ } of filesExcludeByRoot) {
44
62
  for (const pattern of ( Object.keys(expression))) {
45
- if (!pattern.endsWith('/**')) {
46
- expression[`${rtrim(pattern, '/')}/**`] = expression[pattern];
63
+ if (!pattern.endsWith("/**")) {
64
+ expression[`${rtrim(pattern, "/")}/**`] = expression[pattern];
47
65
  }
48
66
  }
49
67
  }
@@ -53,32 +71,33 @@ class FilterOptions {
53
71
  while ((sourceMatch = SOURCE_FILTER_REGEX.exec(filter)) !== null) {
54
72
  const negate = !!sourceMatch[1];
55
73
  let source = sourceMatch[2];
56
- if (source.startsWith('"') && source.endsWith('"')) {
74
+ if (source.startsWith("\"") && source.endsWith("\"")) {
57
75
  source = source.slice(1, -1);
58
76
  }
59
77
  if (negate) {
60
78
  excludeSourceFilters.push(source.toLowerCase());
61
- }
62
- else {
79
+ } else {
63
80
  includeSourceFilters.push(source.toLowerCase());
64
81
  }
65
82
  filter = (filter.substring(0, sourceMatch.index) + filter.substring(sourceMatch.index + sourceMatch[0].length)).trim();
66
83
  }
67
84
  this.includeSourceFilters = includeSourceFilters;
68
85
  this.excludeSourceFilters = excludeSourceFilters;
69
- const negate = filter.startsWith('!');
70
- this.textFilter = { text: (negate ? ltrim(filter, '!') : filter).trim(), negate };
86
+ const negate = filter.startsWith("!");
87
+ this.textFilter = {
88
+ text: (negate ? ltrim(filter, "!") : filter).trim(),
89
+ negate
90
+ };
71
91
  const includeExpression = getEmptyExpression();
72
92
  if (filter) {
73
- const filters = ( splitGlobAware(filter, ',').map(s => s.trim())).filter(s => !!s.length);
93
+ const filters = ( splitGlobAware(filter, ",").map(s => s.trim())).filter(s => !!s.length);
74
94
  for (const f of filters) {
75
- if (f.startsWith('!')) {
76
- const filterText = ltrim(f, '!');
95
+ if (f.startsWith("!")) {
96
+ const filterText = ltrim(f, "!");
77
97
  if (filterText) {
78
98
  this.setPattern(excludesExpression, filterText);
79
99
  }
80
- }
81
- else {
100
+ } else {
82
101
  this.setPattern(includeExpression, f);
83
102
  }
84
103
  }
@@ -100,8 +119,8 @@ class FilterOptions {
100
119
  return true;
101
120
  }
102
121
  setPattern(expression, pattern) {
103
- if (pattern[0] === '.') {
104
- pattern = '*' + pattern;
122
+ if (pattern[0] === ".") {
123
+ pattern = "*" + pattern;
105
124
  }
106
125
  expression[`**/${pattern}/**`] = true;
107
126
  expression[`**/${pattern}`] = true;
@@ -62,14 +62,16 @@ class ResourceMarkers {
62
62
  return this._total;
63
63
  }
64
64
  static _compareMarkers(a, b) {
65
- return MarkerSeverity.compare(a.marker.severity, b.marker.severity)
66
- || extUri.compare(a.resource, b.resource)
67
- || Range.compareRangesUsingStarts(a.marker, b.marker);
65
+ return MarkerSeverity.compare(a.marker.severity, b.marker.severity) || extUri.compare(a.resource, b.resource) || Range.compareRangesUsingStarts(a.marker, b.marker);
68
66
  }
69
67
  }
70
68
  class Marker {
71
- get resource() { return this.marker.resource; }
72
- get range() { return this.marker; }
69
+ get resource() {
70
+ return this.marker.resource;
71
+ }
72
+ get range() {
73
+ return this.marker;
74
+ }
73
75
  get lines() {
74
76
  if (!this._lines) {
75
77
  this._lines = splitLines(this.marker.message);
@@ -85,8 +87,11 @@ class Marker {
85
87
  return JSON.stringify({
86
88
  ...this.marker,
87
89
  resource: this.marker.resource.path,
88
- relatedInformation: this.relatedInformation.length ? ( this.relatedInformation.map(r => ({ ...r.raw, resource: r.raw.resource.path }))) : undefined
89
- }, null, '\t');
90
+ relatedInformation: this.relatedInformation.length ? ( this.relatedInformation.map(r => ({
91
+ ...r.raw,
92
+ resource: r.raw.resource.path
93
+ }))) : undefined
94
+ }, null, "\t");
90
95
  }
91
96
  }
92
97
  class MarkerTableItem extends Marker {
@@ -126,7 +131,11 @@ class MarkersModel {
126
131
  }
127
132
  this.resourcesByUri.clear();
128
133
  this._total = 0;
129
- this._onDidChange.fire({ removed, added: ( new Set()), updated: ( new Set()) });
134
+ this._onDidChange.fire({
135
+ removed,
136
+ added: ( new Set()),
137
+ updated: ( new Set())
138
+ });
130
139
  }
131
140
  get total() {
132
141
  return this._total;
@@ -135,7 +144,11 @@ class MarkersModel {
135
144
  return this.resourcesByUri.get(extUri.getComparisonKey(resource, true)) ?? null;
136
145
  }
137
146
  setResourceMarkers(resourcesMarkers) {
138
- const change = { added: ( new Set()), removed: ( new Set()), updated: ( new Set()) };
147
+ const change = {
148
+ added: ( new Set()),
149
+ removed: ( new Set()),
150
+ updated: ( new Set())
151
+ };
139
152
  for (const [resource, rawMarkers] of resourcesMarkers) {
140
153
  if (( unsupportedSchemas.has(resource.scheme))) {
141
154
  continue;
@@ -145,15 +158,16 @@ class MarkersModel {
145
158
  if (isNonEmptyArray(rawMarkers)) {
146
159
  if (!resourceMarkers) {
147
160
  const resourceMarkersId = this.id(( resource.toString()));
148
- resourceMarkers = ( new ResourceMarkers(resourceMarkersId, resource.with({ fragment: null })));
161
+ resourceMarkers = ( new ResourceMarkers(resourceMarkersId, resource.with({
162
+ fragment: null
163
+ })));
149
164
  this.resourcesByUri.set(key, resourceMarkers);
150
165
  change.added.add(resourceMarkers);
151
- }
152
- else {
166
+ } else {
153
167
  change.updated.add(resourceMarkers);
154
168
  }
155
169
  const markersCountByKey = ( new Map());
156
- const markers = ( rawMarkers.map((rawMarker) => {
170
+ const markers = ( rawMarkers.map(rawMarker => {
157
171
  const key = IMarkerData.makeKey(rawMarker);
158
172
  const index = markersCountByKey.get(key) || 0;
159
173
  markersCountByKey.set(key, index + 1);
@@ -167,16 +181,14 @@ class MarkersModel {
167
181
  this._total -= resourceMarkers.total;
168
182
  resourceMarkers.set(resource, markers);
169
183
  this._total += resourceMarkers.total;
170
- }
171
- else if (resourceMarkers) {
184
+ } else if (resourceMarkers) {
172
185
  this._total -= resourceMarkers.total;
173
186
  resourceMarkers.delete(resource);
174
187
  this._total += resourceMarkers.total;
175
188
  if (resourceMarkers.total === 0) {
176
189
  this.resourcesByUri.delete(key);
177
190
  change.removed.add(resourceMarkers);
178
- }
179
- else {
191
+ } else {
180
192
  change.updated.add(resourceMarkers);
181
193
  }
182
194
  }