@codingame/monaco-vscode-bulk-edit-service-override 8.0.3 → 9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-bulk-edit-service-override",
3
- "version": "8.0.3",
3
+ "version": "9.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@8.0.3"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@9.0.0"
30
30
  }
31
31
  }
@@ -68,24 +68,24 @@ let BulkEdit = class BulkEdit {
68
68
  }
69
69
  }
70
70
  if (this._edits.length === 0) {
71
- return ( localize(2089, "Made no edits"));
71
+ return ( localize(1620, "Made no edits"));
72
72
  }
73
73
  else if (otherResources.size === 0) {
74
74
  if (textEditCount > 1 && textEditResources.size > 1) {
75
75
  return ( localize(
76
- 2090,
76
+ 1621,
77
77
  "Made {0} text edits in {1} files",
78
78
  textEditCount,
79
79
  textEditResources.size
80
80
  ));
81
81
  }
82
82
  else {
83
- return ( localize(2091, "Made {0} text edits in one file", textEditCount));
83
+ return ( localize(1622, "Made {0} text edits in one file", textEditCount));
84
84
  }
85
85
  }
86
86
  else {
87
87
  return ( localize(
88
- 2092,
88
+ 1623,
89
89
  "Made {0} text edits in {1} files, also created or deleted {2} files",
90
90
  textEditCount,
91
91
  textEditResources.size,
@@ -134,12 +134,12 @@ let BulkEdit = class BulkEdit {
134
134
  }
135
135
  async _performFileEdits(edits, undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress) {
136
136
  this._logService.debug('_performFileEdits', JSON.stringify(edits));
137
- const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localize(2093, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress, this._token, edits);
137
+ const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localize(1624, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress, this._token, edits);
138
138
  return await model.apply();
139
139
  }
140
140
  async _performTextEdits(edits, undoRedoGroup, undoRedoSource, progress) {
141
141
  this._logService.debug('_performTextEdits', JSON.stringify(edits));
142
- const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localize(2093, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', this._editor, undoRedoGroup, undoRedoSource, progress, this._token, edits);
142
+ const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localize(1624, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', this._editor, undoRedoGroup, undoRedoSource, progress, this._token, edits);
143
143
  return await model.apply();
144
144
  }
145
145
  async _performCellEdits(edits, undoRedoGroup, undoRedoSource, progress) {
@@ -177,7 +177,7 @@ let BulkEditService = class BulkEditService {
177
177
  async apply(editsIn, options) {
178
178
  let edits = liftEdits(Array.isArray(editsIn) ? editsIn : editsIn.edits);
179
179
  if (edits.length === 0) {
180
- return { ariaSummary: ( localize(2094, "Made no edits")), isApplied: false };
180
+ return { ariaSummary: ( localize(1625, "Made no edits")), isApplied: false };
181
181
  }
182
182
  if (this._previewHandler && (options?.showPreview || ( (edits.some(value => value.metadata?.needsConfirmation))))) {
183
183
  edits = await this._previewHandler(edits, options);
@@ -248,25 +248,25 @@ let BulkEditService = class BulkEditService {
248
248
  let primaryButton;
249
249
  switch (reason) {
250
250
  case ShutdownReason.CLOSE:
251
- message = ( localize(2095, "Are you sure you want to close the window?"));
252
- primaryButton = ( localize(2096, "&&Close Window"));
251
+ message = ( localize(1626, "Are you sure you want to close the window?"));
252
+ primaryButton = ( localize(1627, "&&Close Window"));
253
253
  break;
254
254
  case ShutdownReason.LOAD:
255
- message = ( localize(2097, "Are you sure you want to change the workspace?"));
256
- primaryButton = ( localize(2098, "Change &&Workspace"));
255
+ message = ( localize(1628, "Are you sure you want to change the workspace?"));
256
+ primaryButton = ( localize(1629, "Change &&Workspace"));
257
257
  break;
258
258
  case ShutdownReason.RELOAD:
259
- message = ( localize(2099, "Are you sure you want to reload the window?"));
260
- primaryButton = ( localize(2100, "&&Reload Window"));
259
+ message = ( localize(1630, "Are you sure you want to reload the window?"));
260
+ primaryButton = ( localize(1631, "&&Reload Window"));
261
261
  break;
262
262
  default:
263
- message = ( localize(2101, "Are you sure you want to quit?"));
264
- primaryButton = ( localize(2102, "&&Quit"));
263
+ message = ( localize(1632, "Are you sure you want to quit?"));
264
+ primaryButton = ( localize(1633, "&&Quit"));
265
265
  break;
266
266
  }
267
267
  const result = await this._dialogService.confirm({
268
268
  message,
269
- detail: ( localize(2103, "'{0}' is in progress.", label || ( localize(2104, "File operation")))),
269
+ detail: ( localize(1634, "'{0}' is in progress.", label || ( localize(1635, "File operation")))),
270
270
  primaryButton
271
271
  });
272
272
  return !result.confirmed;
@@ -287,7 +287,7 @@ const autoSaveSetting = 'files.refactoring.autoSave';
287
287
  properties: {
288
288
  [autoSaveSetting]: {
289
289
  description: ( localize(
290
- 2105,
290
+ 1636,
291
291
  "Controls if files that were part of a refactoring are saved automatically"
292
292
  )),
293
293
  default: true,
@@ -96,12 +96,12 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
96
96
  if (view.hasInput()) {
97
97
  const { confirmed } = await this._dialogService.confirm({
98
98
  type: Severity$1.Info,
99
- message: ( localize(2106, "Another refactoring is being previewed.")),
99
+ message: ( localize(1637, "Another refactoring is being previewed.")),
100
100
  detail: ( localize(
101
- 2107,
101
+ 1638,
102
102
  "Press 'Continue' to discard the previous refactoring and continue with the current refactoring."
103
103
  )),
104
- primaryButton: ( localize(2108, "&&Continue"))
104
+ primaryButton: ( localize(1639, "&&Continue"))
105
105
  });
106
106
  if (!confirmed) {
107
107
  return [];
@@ -142,8 +142,8 @@ registerAction2(class ApplyAction extends Action2 {
142
142
  constructor() {
143
143
  super({
144
144
  id: 'refactorPreview.apply',
145
- title: ( localize2(2109, "Apply Refactoring")),
146
- category: ( localize2(2110, "Refactor Preview")),
145
+ title: ( localize2(1640, "Apply Refactoring")),
146
+ category: ( localize2(1641, "Refactor Preview")),
147
147
  icon: Codicon.check,
148
148
  precondition: ( (ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, BulkEditPane.ctxHasCheckedChanges))),
149
149
  menu: [{
@@ -170,8 +170,8 @@ registerAction2(class DiscardAction extends Action2 {
170
170
  constructor() {
171
171
  super({
172
172
  id: 'refactorPreview.discard',
173
- title: ( localize2(2111, "Discard Refactoring")),
174
- category: ( localize2(2110, "Refactor Preview")),
173
+ title: ( localize2(1642, "Discard Refactoring")),
174
+ category: ( localize2(1641, "Refactor Preview")),
175
175
  icon: Codicon.clearAll,
176
176
  precondition: BulkEditPreviewContribution.ctxEnabled,
177
177
  menu: [{
@@ -190,8 +190,8 @@ registerAction2(class ToggleAction extends Action2 {
190
190
  constructor() {
191
191
  super({
192
192
  id: 'refactorPreview.toggleCheckedState',
193
- title: ( localize2(2112, "Toggle Change")),
194
- category: ( localize2(2110, "Refactor Preview")),
193
+ title: ( localize2(1643, "Toggle Change")),
194
+ category: ( localize2(1641, "Refactor Preview")),
195
195
  precondition: BulkEditPreviewContribution.ctxEnabled,
196
196
  keybinding: {
197
197
  weight: KeybindingWeight.WorkbenchContrib,
@@ -214,8 +214,8 @@ registerAction2(class GroupByFile extends Action2 {
214
214
  constructor() {
215
215
  super({
216
216
  id: 'refactorPreview.groupByFile',
217
- title: ( localize2(2113, "Group Changes By File")),
218
- category: ( localize2(2110, "Refactor Preview")),
217
+ title: ( localize2(1644, "Group Changes By File")),
218
+ category: ( localize2(1641, "Refactor Preview")),
219
219
  icon: Codicon.ungroupByRefType,
220
220
  precondition: ( (ContextKeyExpr.and(
221
221
  BulkEditPane.ctxHasCategories,
@@ -243,8 +243,8 @@ registerAction2(class GroupByType extends Action2 {
243
243
  constructor() {
244
244
  super({
245
245
  id: 'refactorPreview.groupByType',
246
- title: ( localize2(2114, "Group Changes By Type")),
247
- category: ( localize2(2110, "Refactor Preview")),
246
+ title: ( localize2(1645, "Group Changes By Type")),
247
+ category: ( localize2(1641, "Refactor Preview")),
248
248
  icon: Codicon.groupByRefType,
249
249
  precondition: ( (ContextKeyExpr.and(
250
250
  BulkEditPane.ctxHasCategories,
@@ -269,8 +269,8 @@ registerAction2(class ToggleGrouping extends Action2 {
269
269
  constructor() {
270
270
  super({
271
271
  id: 'refactorPreview.toggleGrouping',
272
- title: ( localize2(2114, "Group Changes By Type")),
273
- category: ( localize2(2110, "Refactor Preview")),
272
+ title: ( localize2(1645, "Group Changes By Type")),
273
+ category: ( localize2(1641, "Refactor Preview")),
274
274
  icon: Codicon.listTree,
275
275
  toggled: ( (BulkEditPane.ctxGroupByFile.negate())),
276
276
  precondition: ( (ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPreviewContribution.ctxEnabled))),
@@ -287,10 +287,10 @@ registerAction2(class ToggleGrouping extends Action2 {
287
287
  }
288
288
  });
289
289
  registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution, WorkbenchPhase.BlockRestore);
290
- const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(2115, 'View icon of the refactor preview view.')));
290
+ const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(1646, 'View icon of the refactor preview view.')));
291
291
  const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
292
292
  id: BulkEditPane.ID,
293
- title: ( localize2(2116, "Refactor Preview")),
293
+ title: ( localize2(1647, "Refactor Preview")),
294
294
  hideIfEmpty: true,
295
295
  ctorDescriptor: ( (new SyncDescriptor(
296
296
  ViewPaneContainer,
@@ -301,7 +301,7 @@ const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerVi
301
301
  }, ViewContainerLocation.Panel);
302
302
  ( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
303
303
  id: BulkEditPane.ID,
304
- name: ( localize2(2116, "Refactor Preview")),
304
+ name: ( localize2(1647, "Refactor Preview")),
305
305
  when: BulkEditPreviewContribution.ctxEnabled,
306
306
  ctorDescriptor: ( (new SyncDescriptor(BulkEditPane))),
307
307
  containerIcon: refactorPreviewViewIcon,
@@ -138,15 +138,15 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
138
138
  const buttonBar = ( (new ButtonBar(buttonsContainer)));
139
139
  this._disposables.add(buttonBar);
140
140
  const btnConfirm = buttonBar.addButton({ supportIcons: true, ...defaultButtonStyles });
141
- btnConfirm.label = ( localize(5286, 'Apply'));
141
+ btnConfirm.label = ( localize(5234, 'Apply'));
142
142
  btnConfirm.onDidClick(() => this.accept(), this, this._disposables);
143
143
  const btnCancel = buttonBar.addButton({ ...defaultButtonStyles, secondary: true });
144
- btnCancel.label = ( localize(5287, 'Discard'));
144
+ btnCancel.label = ( localize(5235, 'Discard'));
145
145
  btnCancel.onDidClick(() => this.discard(), this, this._disposables);
146
146
  this._message = document.createElement('span');
147
147
  this._message.className = 'message';
148
148
  this._message.innerText = ( localize(
149
- 5288,
149
+ 5236,
150
150
  "Invoke a code action, like rename, to see a preview of its changes here."
151
151
  ));
152
152
  parent.appendChild(this._message);
@@ -221,14 +221,14 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
221
221
  let message;
222
222
  if (conflicts.length === 1) {
223
223
  message = ( localize(
224
- 5289,
224
+ 5237,
225
225
  "Cannot apply refactoring because '{0}' has changed in the meantime.",
226
226
  this._labelService.getUriLabel(conflicts[0], { relative: true })
227
227
  ));
228
228
  }
229
229
  else {
230
230
  message = ( localize(
231
- 5290,
231
+ 5238,
232
232
  "Cannot apply refactoring because {0} other files have changed in the meantime.",
233
233
  conflicts.length
234
234
  ));
@@ -102,7 +102,7 @@ class BulkFileOperation {
102
102
  }
103
103
  class BulkCategory {
104
104
  static { this._defaultMetadata = ( (Object.freeze({
105
- label: ( localize(9969, "Other")),
105
+ label: ( localize(9995, "Other")),
106
106
  icon: Codicon.symbolFile,
107
107
  needsConfirmation: false
108
108
  }))); }
@@ -16,12 +16,10 @@ import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeServi
16
16
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
17
17
  import { compare } from 'vscode/vscode/vs/base/common/strings';
18
18
  import { URI } from 'vscode/vscode/vs/base/common/uri';
19
- import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo.service';
20
19
  import { ResourceFileEdit } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
21
- import { ILanguageConfigurationService } from 'vscode/vscode/vs/editor/common/languages/languageConfigurationRegistry';
22
- import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
23
20
  import { PLAINTEXT_LANGUAGE_ID } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
24
21
  import { SnippetParser } from 'vscode/vscode/vs/editor/contrib/snippet/browser/snippetParser';
22
+ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
25
23
 
26
24
  var CategoryElementRenderer_1, FileElementRenderer_1, TextEditElementRenderer_1;
27
25
  class CategoryElement {
@@ -152,11 +150,9 @@ class TextEditElement {
152
150
  }
153
151
  }
154
152
  let BulkEditDataSource = class BulkEditDataSource {
155
- constructor(_textModelService, _undoRedoService, _languageService, _languageConfigurationService) {
153
+ constructor(_textModelService, _instantiationService) {
156
154
  this._textModelService = _textModelService;
157
- this._undoRedoService = _undoRedoService;
158
- this._languageService = _languageService;
159
- this._languageConfigurationService = _languageConfigurationService;
155
+ this._instantiationService = _instantiationService;
160
156
  this.groupByFile = true;
161
157
  }
162
158
  hasChildren(element) {
@@ -186,15 +182,7 @@ let BulkEditDataSource = class BulkEditDataSource {
186
182
  textModelDisposable = ref;
187
183
  }
188
184
  catch {
189
- textModel = ( (new TextModel(
190
- '',
191
- PLAINTEXT_LANGUAGE_ID,
192
- TextModel.DEFAULT_CREATION_OPTIONS,
193
- null,
194
- this._undoRedoService,
195
- this._languageService,
196
- this._languageConfigurationService
197
- )));
185
+ textModel = this._instantiationService.createInstance(TextModel, '', PLAINTEXT_LANGUAGE_ID, TextModel.DEFAULT_CREATION_OPTIONS, null);
198
186
  textModelDisposable = textModel;
199
187
  }
200
188
  const result = ( (element.edit.textEdits.map((edit, idx) => {
@@ -231,9 +219,7 @@ let BulkEditDataSource = class BulkEditDataSource {
231
219
  };
232
220
  BulkEditDataSource = ( (__decorate([
233
221
  ( (__param(0, ITextModelService))),
234
- ( (__param(1, IUndoRedoService))),
235
- ( (__param(2, ILanguageService))),
236
- ( (__param(3, ILanguageConfigurationService)))
222
+ ( (__param(1, IInstantiationService)))
237
223
  ], BulkEditDataSource)));
238
224
  class BulkEditSorter {
239
225
  compare(a, b) {
@@ -254,7 +240,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
254
240
  this._labelService = _labelService;
255
241
  }
256
242
  getWidgetAriaLabel() {
257
- return ( localize(9970, "Bulk Edit"));
243
+ return ( localize(9996, "Bulk Edit"));
258
244
  }
259
245
  getRole(_element) {
260
246
  return 'checkbox';
@@ -264,7 +250,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
264
250
  if (element.edit.textEdits.length > 0) {
265
251
  if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
266
252
  return ( localize(
267
- 9971,
253
+ 9997,
268
254
  "Renaming {0} to {1}, also making text edits",
269
255
  this._labelService.getUriLabel(element.edit.uri, { relative: true }),
270
256
  this._labelService.getUriLabel(element.edit.newUri, { relative: true })
@@ -272,21 +258,21 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
272
258
  }
273
259
  else if (element.edit.type & BulkFileOperationType.Create) {
274
260
  return ( localize(
275
- 9972,
261
+ 9998,
276
262
  "Creating {0}, also making text edits",
277
263
  this._labelService.getUriLabel(element.edit.uri, { relative: true })
278
264
  ));
279
265
  }
280
266
  else if (element.edit.type & BulkFileOperationType.Delete) {
281
267
  return ( localize(
282
- 9973,
268
+ 9999,
283
269
  "Deleting {0}, also making text edits",
284
270
  this._labelService.getUriLabel(element.edit.uri, { relative: true })
285
271
  ));
286
272
  }
287
273
  else {
288
274
  return ( localize(
289
- 9974,
275
+ 10000,
290
276
  "{0}, making text edits",
291
277
  this._labelService.getUriLabel(element.edit.uri, { relative: true })
292
278
  ));
@@ -295,7 +281,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
295
281
  else {
296
282
  if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
297
283
  return ( localize(
298
- 9975,
284
+ 10001,
299
285
  "Renaming {0} to {1}",
300
286
  this._labelService.getUriLabel(element.edit.uri, { relative: true }),
301
287
  this._labelService.getUriLabel(element.edit.newUri, { relative: true })
@@ -303,14 +289,14 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
303
289
  }
304
290
  else if (element.edit.type & BulkFileOperationType.Create) {
305
291
  return ( localize(
306
- 9976,
292
+ 10002,
307
293
  "Creating {0}",
308
294
  this._labelService.getUriLabel(element.edit.uri, { relative: true })
309
295
  ));
310
296
  }
311
297
  else if (element.edit.type & BulkFileOperationType.Delete) {
312
298
  return ( localize(
313
- 9977,
299
+ 10003,
314
300
  "Deleting {0}",
315
301
  this._labelService.getUriLabel(element.edit.uri, { relative: true })
316
302
  ));
@@ -320,7 +306,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
320
306
  if (element instanceof TextEditElement) {
321
307
  if (element.selecting.length > 0 && element.inserting.length > 0) {
322
308
  return ( localize(
323
- 9978,
309
+ 10004,
324
310
  "line {0}, replacing {1} with {2}",
325
311
  element.edit.textEdit.textEdit.range.startLineNumber,
326
312
  element.selecting,
@@ -329,7 +315,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
329
315
  }
330
316
  else if (element.selecting.length > 0 && element.inserting.length === 0) {
331
317
  return ( localize(
332
- 9979,
318
+ 10005,
333
319
  "line {0}, removing {1}",
334
320
  element.edit.textEdit.textEdit.range.startLineNumber,
335
321
  element.selecting
@@ -337,7 +323,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
337
323
  }
338
324
  else if (element.selecting.length === 0 && element.inserting.length > 0) {
339
325
  return ( localize(
340
- 9980,
326
+ 10006,
341
327
  "line {0}, inserting {1}",
342
328
  element.edit.textEdit.textEdit.range.startLineNumber,
343
329
  element.selecting
@@ -445,7 +431,7 @@ let FileElementTemplate = class FileElementTemplate {
445
431
  this._label.setResource({
446
432
  resource: element.edit.uri,
447
433
  name: ( localize(
448
- 9981,
434
+ 10007,
449
435
  "{0} → {1}",
450
436
  this._labelService.getUriLabel(element.edit.uri, { relative: true }),
451
437
  this._labelService.getUriLabel(element.edit.newUri, { relative: true })
@@ -453,7 +439,7 @@ let FileElementTemplate = class FileElementTemplate {
453
439
  }, {
454
440
  fileDecorations: { colors: true, badges: false }
455
441
  });
456
- this._details.innerText = ( localize(9982, "(renaming)"));
442
+ this._details.innerText = ( localize(10008, "(renaming)"));
457
443
  }
458
444
  else {
459
445
  const options = {
@@ -463,10 +449,10 @@ let FileElementTemplate = class FileElementTemplate {
463
449
  extraClasses: []
464
450
  };
465
451
  if (element.edit.type & BulkFileOperationType.Create) {
466
- this._details.innerText = ( localize(9983, "(creating)"));
452
+ this._details.innerText = ( localize(10009, "(creating)"));
467
453
  }
468
454
  else if (element.edit.type & BulkFileOperationType.Delete) {
469
- this._details.innerText = ( localize(9984, "(deleting)"));
455
+ this._details.innerText = ( localize(10010, "(deleting)"));
470
456
  options.extraClasses.push('delete');
471
457
  }
472
458
  else {
@@ -545,7 +531,7 @@ let TextEditElementTemplate = class TextEditElementTemplate {
545
531
  let title;
546
532
  const { metadata } = element.edit.textEdit;
547
533
  if (metadata && metadata.description) {
548
- title = ( localize(9985, "{0} - {1}", metadata.label, metadata.description));
534
+ title = ( localize(10011, "{0} - {1}", metadata.label, metadata.description));
549
535
  }
550
536
  else if (metadata) {
551
537
  title = metadata.label;