@codingame/monaco-vscode-workspace-trust-service-override 1.83.4 → 1.83.6

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.
@@ -50,12 +50,36 @@ import { basename, dirname } from 'monaco-editor/esm/vs/base/common/resources.js
50
50
  import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
51
51
 
52
52
  var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
53
- const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'shieldIcon', 'Icon for workspace trust ion the banner.'));
54
- const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'checkListIcon', 'Icon for the checkmark in the workspace trust editor.'));
55
- const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'xListIcon', 'Icon for the cross in the workspace trust editor.'));
56
- const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'folderPickerIcon', 'Icon for the pick folder icon in the workspace trust editor.'));
57
- const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'editIcon', 'Icon for the edit folder icon in the workspace trust editor.'));
58
- const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'removeIcon', 'Icon for the remove folder icon in the workspace trust editor.'));
53
+ const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, ( localizeWithPath(
54
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
55
+ 'shieldIcon',
56
+ 'Icon for workspace trust ion the banner.'
57
+ )));
58
+ const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localizeWithPath(
59
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
60
+ 'checkListIcon',
61
+ 'Icon for the checkmark in the workspace trust editor.'
62
+ )));
63
+ const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localizeWithPath(
64
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
65
+ 'xListIcon',
66
+ 'Icon for the cross in the workspace trust editor.'
67
+ )));
68
+ const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localizeWithPath(
69
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
70
+ 'folderPickerIcon',
71
+ 'Icon for the pick folder icon in the workspace trust editor.'
72
+ )));
73
+ const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localizeWithPath(
74
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
75
+ 'editIcon',
76
+ 'Icon for the edit folder icon in the workspace trust editor.'
77
+ )));
78
+ const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localizeWithPath(
79
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
80
+ 'removeIcon',
81
+ 'Icon for the remove folder icon in the workspace trust editor.'
82
+ )));
59
83
  let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
60
84
  constructor(container, instantiationService, workspaceService, workspaceTrustManagementService, uriService, labelService, fileDialogService) {
61
85
  super();
@@ -79,14 +103,22 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
79
103
  const addButtonBarElement = container.appendChild($('.trusted-uris-button-bar'));
80
104
  this.table = this.instantiationService.createInstance(WorkbenchTable, 'WorkspaceTrust', tableElement, ( new TrustedUriTableVirtualDelegate()), [
81
105
  {
82
- label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'hostColumnLabel', "Host"),
106
+ label: ( localizeWithPath(
107
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
108
+ 'hostColumnLabel',
109
+ "Host"
110
+ )),
83
111
  tooltip: '',
84
112
  weight: 1,
85
113
  templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
86
114
  project(row) { return row; }
87
115
  },
88
116
  {
89
- label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'pathColumnLabel', "Path"),
117
+ label: ( localizeWithPath(
118
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
119
+ 'pathColumnLabel',
120
+ "Path"
121
+ )),
90
122
  tooltip: '',
91
123
  weight: 8,
92
124
  templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
@@ -114,11 +146,26 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
114
146
  getAriaLabel: (item) => {
115
147
  const hostLabel = getHostLabel(this.labelService, item);
116
148
  if (hostLabel === undefined || hostLabel.length === 0) {
117
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolderAriaLabel', "{0}, trusted", this.labelService.getUriLabel(item.uri));
149
+ return ( localizeWithPath(
150
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
151
+ 'trustedFolderAriaLabel',
152
+ "{0}, trusted",
153
+ this.labelService.getUriLabel(item.uri)
154
+ ));
118
155
  }
119
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolderWithHostAriaLabel', "{0} on {1}, trusted", this.labelService.getUriLabel(item.uri), hostLabel);
156
+ return ( localizeWithPath(
157
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
158
+ 'trustedFolderWithHostAriaLabel',
159
+ "{0} on {1}, trusted",
160
+ this.labelService.getUriLabel(item.uri),
161
+ hostLabel
162
+ ));
120
163
  },
121
- getWidgetAriaLabel: () => localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFoldersAndWorkspaces', "Trusted Folders & Workspaces")
164
+ getWidgetAriaLabel: () => ( localizeWithPath(
165
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
166
+ 'trustedFoldersAndWorkspaces',
167
+ "Trusted Folders & Workspaces"
168
+ ))
122
169
  }
123
170
  });
124
171
  this._register(this.table.onDidOpen(item => {
@@ -127,16 +174,32 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
127
174
  }
128
175
  }));
129
176
  const buttonBar = this._register(( new ButtonBar(addButtonBarElement)));
130
- const addButton = this._register(buttonBar.addButton({ title: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'addButton', "Add Folder"), ...defaultButtonStyles }));
131
- addButton.label = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'addButton', "Add Folder");
177
+ const addButton = this._register(buttonBar.addButton({ title: ( localizeWithPath(
178
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
179
+ 'addButton',
180
+ "Add Folder"
181
+ )), ...defaultButtonStyles }));
182
+ addButton.label = ( localizeWithPath(
183
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
184
+ 'addButton',
185
+ "Add Folder"
186
+ ));
132
187
  this._register(addButton.onDidClick(async () => {
133
188
  const uri = await this.fileDialogService.showOpenDialog({
134
189
  canSelectFiles: false,
135
190
  canSelectFolders: true,
136
191
  canSelectMany: false,
137
192
  defaultUri: this.currentWorkspaceUri,
138
- openLabel: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustUri', "Trust Folder"),
139
- title: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'selectTrustedUri', "Select Folder To Trust")
193
+ openLabel: ( localizeWithPath(
194
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
195
+ 'trustUri',
196
+ "Trust Folder"
197
+ )),
198
+ title: ( localizeWithPath(
199
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
200
+ 'selectTrustedUri',
201
+ "Select Folder To Trust"
202
+ ))
140
203
  });
141
204
  if (uri) {
142
205
  this.workspaceTrustManagementService.setUrisTrust(uri, true);
@@ -216,8 +279,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
216
279
  const entries = this.trustedUriEntries;
217
280
  this.container.classList.toggle('empty', entries.length === 0);
218
281
  this.descriptionElement.innerText = entries.length ?
219
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFoldersDescription', "You trust the following folders, their subfolders, and workspace files.") :
220
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'noTrustedFoldersDescriptions', "You haven't trusted any folders or workspace files yet.");
282
+ ( localizeWithPath(
283
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
284
+ 'trustedFoldersDescription',
285
+ "You trust the following folders, their subfolders, and workspace files."
286
+ )) :
287
+ ( localizeWithPath(
288
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
289
+ 'noTrustedFoldersDescriptions',
290
+ "You haven't trusted any folders or workspace files yet."
291
+ ));
221
292
  this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
222
293
  this.layout();
223
294
  }
@@ -230,19 +301,35 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
230
301
  if (segments.length === 0 && path.startsWith(posix.sep)) {
231
302
  return {
232
303
  type: 2 ,
233
- content: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'trustAll', comment: ['The {0} will be a host name where repositories are hosted.'] }, "You will trust all repositories on {0}.", getHostLabel(this.labelService, item))
304
+ content: ( localizeWithPath(
305
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
306
+ { key: 'trustAll', comment: ['The {0} will be a host name where repositories are hosted.'] },
307
+ "You will trust all repositories on {0}.",
308
+ getHostLabel(this.labelService, item)
309
+ ))
234
310
  };
235
311
  }
236
312
  if (segments.length === 1) {
237
313
  return {
238
314
  type: 2 ,
239
- content: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'trustOrg', comment: ['The {0} will be an organization or user name.', 'The {1} will be a host name where repositories are hosted.'] }, "You will trust all repositories and forks under '{0}' on {1}.", segments[0], getHostLabel(this.labelService, item))
315
+ content: ( localizeWithPath(
316
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
317
+ { key: 'trustOrg', comment: ['The {0} will be an organization or user name.', 'The {1} will be a host name where repositories are hosted.'] },
318
+ "You will trust all repositories and forks under '{0}' on {1}.",
319
+ segments[0],
320
+ getHostLabel(this.labelService, item)
321
+ ))
240
322
  };
241
323
  }
242
324
  if (segments.length > 2) {
243
325
  return {
244
326
  type: 3 ,
245
- content: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'invalidTrust', "You cannot trust individual folders within a repository.", path)
327
+ content: ( localizeWithPath(
328
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
329
+ 'invalidTrust',
330
+ "You cannot trust individual folders within a repository.",
331
+ path
332
+ ))
246
333
  };
247
334
  }
248
335
  }
@@ -278,8 +365,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
278
365
  canSelectFolders: true,
279
366
  canSelectMany: false,
280
367
  defaultUri: item.uri,
281
- openLabel: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustUri', "Trust Folder"),
282
- title: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'selectTrustedUri', "Select Folder To Trust")
368
+ openLabel: ( localizeWithPath(
369
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
370
+ 'trustUri',
371
+ "Trust Folder"
372
+ )),
373
+ title: ( localizeWithPath(
374
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
375
+ 'selectTrustedUri',
376
+ "Select Folder To Trust"
377
+ ))
283
378
  });
284
379
  if (uri) {
285
380
  this.acceptEdit(item, uri[0]);
@@ -345,7 +440,11 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
345
440
  class: ThemeIcon.asClassName(editIcon),
346
441
  enabled: true,
347
442
  id: 'editTrustedUri',
348
- tooltip: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'editTrustedUri', "Edit Path"),
443
+ tooltip: ( localizeWithPath(
444
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
445
+ 'editTrustedUri',
446
+ "Edit Path"
447
+ )),
349
448
  run: () => {
350
449
  this.table.edit(item, false);
351
450
  }
@@ -356,7 +455,11 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
356
455
  class: ThemeIcon.asClassName(folderPickerIcon),
357
456
  enabled: true,
358
457
  id: 'pickerTrustedUri',
359
- tooltip: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'pickerTrustedUri', "Open File Picker"),
458
+ tooltip: ( localizeWithPath(
459
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
460
+ 'pickerTrustedUri',
461
+ "Open File Picker"
462
+ )),
360
463
  run: () => {
361
464
  this.table.edit(item, true);
362
465
  }
@@ -367,7 +470,11 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
367
470
  class: ThemeIcon.asClassName(removeIcon),
368
471
  enabled: true,
369
472
  id: 'deleteTrustedUri',
370
- tooltip: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'deleteTrustedUri', "Delete Path"),
473
+ tooltip: ( localizeWithPath(
474
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
475
+ 'deleteTrustedUri',
476
+ "Delete Path"
477
+ )),
371
478
  run: async () => {
372
479
  await this.table.delete(item);
373
480
  }
@@ -484,7 +591,11 @@ TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( __decorate([
484
591
  ( __param(1, IContextViewService))
485
592
  ], TrustedUriPathColumnRenderer));
486
593
  function getHostLabel(labelService, item) {
487
- return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'localAuthority', "Local");
594
+ return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localizeWithPath(
595
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
596
+ 'localAuthority',
597
+ "Local"
598
+ ));
488
599
  }
489
600
  let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
490
601
  static { TrustedUriHostColumnRenderer_1 = this; }
@@ -616,18 +727,38 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
616
727
  getHeaderTitleText(trusted) {
617
728
  if (trusted) {
618
729
  if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
619
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedUnsettableWindow', "This window is trusted");
730
+ return ( localizeWithPath(
731
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
732
+ 'trustedUnsettableWindow',
733
+ "This window is trusted"
734
+ ));
620
735
  }
621
736
  switch (this.workspaceService.getWorkbenchState()) {
622
737
  case 1 :
623
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedHeaderWindow', "You trust this window");
738
+ return ( localizeWithPath(
739
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
740
+ 'trustedHeaderWindow',
741
+ "You trust this window"
742
+ ));
624
743
  case 2 :
625
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedHeaderFolder', "You trust this folder");
744
+ return ( localizeWithPath(
745
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
746
+ 'trustedHeaderFolder',
747
+ "You trust this folder"
748
+ ));
626
749
  case 3 :
627
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedHeaderWorkspace', "You trust this workspace");
750
+ return ( localizeWithPath(
751
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
752
+ 'trustedHeaderWorkspace',
753
+ "You trust this workspace"
754
+ ));
628
755
  }
629
756
  }
630
- return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedHeader', "You are in Restricted Mode");
757
+ return ( localizeWithPath(
758
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
759
+ 'untrustedHeader',
760
+ "You are in Restricted Mode"
761
+ ));
631
762
  }
632
763
  getHeaderTitleIconClassNames(trusted) {
633
764
  return ThemeIcon.asClassNameArray(shieldIcon);
@@ -637,21 +768,69 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
637
768
  let subTitle = '';
638
769
  switch (this.workspaceService.getWorkbenchState()) {
639
770
  case 1 : {
640
- title = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWindow', "In a Trusted Window") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspace', "In Restricted Mode");
641
- subTitle = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWindowSubtitle', "You trust the authors of the files in the current window. All features are enabled:") :
642
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWindowSubtitle', "You do not trust the authors of the files in the current window. The following features are disabled:");
771
+ title = trusted ? ( localizeWithPath(
772
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
773
+ 'trustedWindow',
774
+ "In a Trusted Window"
775
+ )) : ( localizeWithPath(
776
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
777
+ 'untrustedWorkspace',
778
+ "In Restricted Mode"
779
+ ));
780
+ subTitle = trusted ? ( localizeWithPath(
781
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
782
+ 'trustedWindowSubtitle',
783
+ "You trust the authors of the files in the current window. All features are enabled:"
784
+ )) :
785
+ ( localizeWithPath(
786
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
787
+ 'untrustedWindowSubtitle',
788
+ "You do not trust the authors of the files in the current window. The following features are disabled:"
789
+ ));
643
790
  break;
644
791
  }
645
792
  case 2 : {
646
- title = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolder', "In a Trusted Folder") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspace', "In Restricted Mode");
647
- subTitle = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolderSubtitle', "You trust the authors of the files in the current folder. All features are enabled:") :
648
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedFolderSubtitle', "You do not trust the authors of the files in the current folder. The following features are disabled:");
793
+ title = trusted ? ( localizeWithPath(
794
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
795
+ 'trustedFolder',
796
+ "In a Trusted Folder"
797
+ )) : ( localizeWithPath(
798
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
799
+ 'untrustedWorkspace',
800
+ "In Restricted Mode"
801
+ ));
802
+ subTitle = trusted ? ( localizeWithPath(
803
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
804
+ 'trustedFolderSubtitle',
805
+ "You trust the authors of the files in the current folder. All features are enabled:"
806
+ )) :
807
+ ( localizeWithPath(
808
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
809
+ 'untrustedFolderSubtitle',
810
+ "You do not trust the authors of the files in the current folder. The following features are disabled:"
811
+ ));
649
812
  break;
650
813
  }
651
814
  case 3 : {
652
- title = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWorkspace', "In a Trusted Workspace") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspace', "In Restricted Mode");
653
- subTitle = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWorkspaceSubtitle', "You trust the authors of the files in the current workspace. All features are enabled:") :
654
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspaceSubtitle', "You do not trust the authors of the files in the current workspace. The following features are disabled:");
815
+ title = trusted ? ( localizeWithPath(
816
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
817
+ 'trustedWorkspace',
818
+ "In a Trusted Workspace"
819
+ )) : ( localizeWithPath(
820
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
821
+ 'untrustedWorkspace',
822
+ "In Restricted Mode"
823
+ ));
824
+ subTitle = trusted ? ( localizeWithPath(
825
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
826
+ 'trustedWorkspaceSubtitle',
827
+ "You trust the authors of the files in the current workspace. All features are enabled:"
828
+ )) :
829
+ ( localizeWithPath(
830
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
831
+ 'untrustedWorkspaceSubtitle',
832
+ "You do not trust the authors of the files in the current workspace. The following features are disabled:"
833
+ ));
655
834
  break;
656
835
  }
657
836
  }
@@ -672,10 +851,24 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
672
851
  this.headerDescription.innerText = '';
673
852
  const headerDescriptionText = append(this.headerDescription, $('div'));
674
853
  headerDescriptionText.innerText = isWorkspaceTrusted ?
675
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedDescription', "All features are enabled because trust has been granted to the workspace.") :
676
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedDescription', "{0} is in a restricted mode intended for safe code browsing.", this.productService.nameShort);
854
+ ( localizeWithPath(
855
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
856
+ 'trustedDescription',
857
+ "All features are enabled because trust has been granted to the workspace."
858
+ )) :
859
+ ( localizeWithPath(
860
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
861
+ 'untrustedDescription',
862
+ "{0} is in a restricted mode intended for safe code browsing.",
863
+ this.productService.nameShort
864
+ ));
677
865
  const headerDescriptionActions = append(this.headerDescription, $('div'));
678
- const headerDescriptionActionsText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'workspaceTrustEditorHeaderActions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).", `command:workbench.trust.configure`);
866
+ const headerDescriptionActionsText = ( localizeWithPath(
867
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
868
+ { key: 'workspaceTrustEditorHeaderActions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
869
+ "[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
870
+ `command:workbench.trust.configure`
871
+ ));
679
872
  for (const node of parseLinkedText(headerDescriptionActionsText).nodes) {
680
873
  if (typeof node === 'string') {
681
874
  append(headerDescriptionActions, document.createTextNode(node));
@@ -685,7 +878,11 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
685
878
  }
686
879
  }
687
880
  this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
688
- this.rootElement.setAttribute('aria-label', `${localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'root element label', "Manage Workspace Trust")}: ${this.headerContainer.innerText}`);
881
+ this.rootElement.setAttribute('aria-label', `${( localizeWithPath(
882
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
883
+ 'root element label',
884
+ "Manage Workspace Trust"
885
+ ))}: ${this.headerContainer.innerText}`);
689
886
  const restrictedSettings = this.configurationService.restrictedSettings;
690
887
  const configurationRegistry = ( Registry.as(Extensions.Configuration));
691
888
  const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
@@ -750,7 +947,11 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
750
947
  createConfigurationElement(parent) {
751
948
  this.configurationContainer = append(parent, $('.workspace-trust-settings', { tabIndex: '0' }));
752
949
  const configurationTitle = append(this.configurationContainer, $('.workspace-trusted-folders-title'));
753
- configurationTitle.innerText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFoldersAndWorkspaces', "Trusted Folders & Workspaces");
950
+ configurationTitle.innerText = ( localizeWithPath(
951
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
952
+ 'trustedFoldersAndWorkspaces',
953
+ "Trusted Folders & Workspaces"
954
+ ));
754
955
  this.workspaceTrustedUrisTable = this._register(this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer));
755
956
  }
756
957
  createAffectedFeaturesElement(parent) {
@@ -765,30 +966,96 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
765
966
  this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
766
967
  const trustedContainerItems = this.workspaceService.getWorkbenchState() === 1 ?
767
968
  [
768
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedTasks', "Tasks are allowed to run"),
769
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedDebugging', "Debugging is enabled"),
770
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedExtensions', "All enabled extensions are activated")
969
+ ( localizeWithPath(
970
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
971
+ 'trustedTasks',
972
+ "Tasks are allowed to run"
973
+ )),
974
+ ( localizeWithPath(
975
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
976
+ 'trustedDebugging',
977
+ "Debugging is enabled"
978
+ )),
979
+ ( localizeWithPath(
980
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
981
+ 'trustedExtensions',
982
+ "All enabled extensions are activated"
983
+ ))
771
984
  ] :
772
985
  [
773
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedTasks', "Tasks are allowed to run"),
774
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedDebugging', "Debugging is enabled"),
775
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedSettings', "All workspace settings are applied"),
776
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedExtensions', "All enabled extensions are activated")
986
+ ( localizeWithPath(
987
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
988
+ 'trustedTasks',
989
+ "Tasks are allowed to run"
990
+ )),
991
+ ( localizeWithPath(
992
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
993
+ 'trustedDebugging',
994
+ "Debugging is enabled"
995
+ )),
996
+ ( localizeWithPath(
997
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
998
+ 'trustedSettings',
999
+ "All workspace settings are applied"
1000
+ )),
1001
+ ( localizeWithPath(
1002
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1003
+ 'trustedExtensions',
1004
+ "All enabled extensions are activated"
1005
+ ))
777
1006
  ];
778
1007
  this.renderLimitationsListElement(this.trustedContainer, trustedContainerItems, ThemeIcon.asClassNameArray(checkListIcon));
779
1008
  const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
780
1009
  this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
781
1010
  const untrustedContainerItems = this.workspaceService.getWorkbenchState() === 1 ?
782
1011
  [
783
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedTasks', "Tasks are not allowed to run"),
784
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedDebugging', "Debugging is disabled"),
785
- fixBadLocalizedLinks(localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[{0} extensions]({1}) are disabled or have limited functionality", numExtensions, `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`))
1012
+ ( localizeWithPath(
1013
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1014
+ 'untrustedTasks',
1015
+ "Tasks are not allowed to run"
1016
+ )),
1017
+ ( localizeWithPath(
1018
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1019
+ 'untrustedDebugging',
1020
+ "Debugging is disabled"
1021
+ )),
1022
+ fixBadLocalizedLinks(( localizeWithPath(
1023
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1024
+ { key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
1025
+ "[{0} extensions]({1}) are disabled or have limited functionality",
1026
+ numExtensions,
1027
+ `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
1028
+ )))
786
1029
  ] :
787
1030
  [
788
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedTasks', "Tasks are not allowed to run"),
789
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedDebugging', "Debugging is disabled"),
790
- fixBadLocalizedLinks(numSettings ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'untrustedSettings', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[{0} workspace settings]({1}) are not applied", numSettings, 'command:settings.filterUntrusted') : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'no untrustedSettings', "Workspace settings requiring trust are not applied")),
791
- fixBadLocalizedLinks(localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[{0} extensions]({1}) are disabled or have limited functionality", numExtensions, `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`))
1031
+ ( localizeWithPath(
1032
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1033
+ 'untrustedTasks',
1034
+ "Tasks are not allowed to run"
1035
+ )),
1036
+ ( localizeWithPath(
1037
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1038
+ 'untrustedDebugging',
1039
+ "Debugging is disabled"
1040
+ )),
1041
+ fixBadLocalizedLinks(numSettings ? ( localizeWithPath(
1042
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1043
+ { key: 'untrustedSettings', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
1044
+ "[{0} workspace settings]({1}) are not applied",
1045
+ numSettings,
1046
+ 'command:settings.filterUntrusted'
1047
+ )) : ( localizeWithPath(
1048
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1049
+ 'no untrustedSettings',
1050
+ "Workspace settings requiring trust are not applied"
1051
+ ))),
1052
+ fixBadLocalizedLinks(( localizeWithPath(
1053
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1054
+ { key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
1055
+ "[{0} extensions]({1}) are disabled or have limited functionality",
1056
+ numExtensions,
1057
+ `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
1058
+ )))
792
1059
  ];
793
1060
  this.renderLimitationsListElement(this.untrustedContainer, untrustedContainerItems, ThemeIcon.asClassNameArray(xListIcon));
794
1061
  if (this.workspaceTrustManagementService.isWorkspaceTrusted()) {
@@ -814,7 +1081,12 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
814
1081
  button.label = action.label;
815
1082
  button.enabled = enabled !== undefined ? enabled : action.enabled;
816
1083
  button.description = keybinding.getLabel();
817
- button.element.ariaLabel = action.label + ', ' + localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'keyboardShortcut', "Keyboard Shortcut: {0}", keybinding.getAriaLabel());
1084
+ button.element.ariaLabel = action.label + ', ' + ( localizeWithPath(
1085
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1086
+ 'keyboardShortcut',
1087
+ "Keyboard Shortcut: {0}",
1088
+ keybinding.getAriaLabel()
1089
+ ));
818
1090
  this.rerenderDisposables.add(button.onDidClick(e => {
819
1091
  if (e) {
820
1092
  EventHelper.stop(e, true);
@@ -824,45 +1096,44 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
824
1096
  }
825
1097
  }
826
1098
  addTrustButtonToElement(parent) {
827
- const trustAction = ( new Action(
828
- 'workspace.trust.button.action.grant',
829
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustButton', "Trust"),
830
- undefined,
831
- true,
832
- async () => {
833
- await this.workspaceTrustManagementService.setWorkspaceTrust(true);
834
- }
835
- ));
1099
+ const trustAction = ( new Action('workspace.trust.button.action.grant', ( localizeWithPath(
1100
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1101
+ 'trustButton',
1102
+ "Trust"
1103
+ )), undefined, true, async () => {
1104
+ await this.workspaceTrustManagementService.setWorkspaceTrust(true);
1105
+ }));
836
1106
  const trustActions = [{ action: trustAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0] }];
837
1107
  if (this.workspaceTrustManagementService.canSetParentFolderTrust()) {
838
1108
  const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceService.getWorkspace());
839
1109
  const name = basename(dirname(workspaceIdentifier.uri));
840
1110
  const trustMessageElement = append(parent, $('.trust-message-box'));
841
- trustMessageElement.innerText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustMessage', "Trust the authors of all files in the current folder or its parent '{0}'.", name);
842
- const trustParentAction = ( new Action(
843
- 'workspace.trust.button.action.grantParent',
844
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustParentButton', "Trust Parent"),
845
- undefined,
846
- true,
847
- async () => {
848
- await this.workspaceTrustManagementService.setParentFolderTrust(true);
849
- }
1111
+ trustMessageElement.innerText = ( localizeWithPath(
1112
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1113
+ 'trustMessage',
1114
+ "Trust the authors of all files in the current folder or its parent '{0}'.",
1115
+ name
850
1116
  ));
1117
+ const trustParentAction = ( new Action('workspace.trust.button.action.grantParent', ( localizeWithPath(
1118
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1119
+ 'trustParentButton',
1120
+ "Trust Parent"
1121
+ )), undefined, true, async () => {
1122
+ await this.workspaceTrustManagementService.setParentFolderTrust(true);
1123
+ }));
851
1124
  trustActions.push({ action: trustParentAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Shift+Enter' : 'Ctrl+Shift+Enter')[0] });
852
1125
  }
853
1126
  this.createButtonRow(parent, trustActions);
854
1127
  }
855
1128
  addDontTrustButtonToElement(parent) {
856
1129
  this.createButtonRow(parent, [{
857
- action: ( new Action(
858
- 'workspace.trust.button.action.deny',
859
- localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'dontTrustButton', "Don't Trust"),
860
- undefined,
861
- true,
862
- async () => {
863
- await this.workspaceTrustManagementService.setWorkspaceTrust(false);
864
- }
865
- )),
1130
+ action: ( new Action('workspace.trust.button.action.deny', ( localizeWithPath(
1131
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1132
+ 'dontTrustButton',
1133
+ "Don't Trust"
1134
+ )), undefined, true, async () => {
1135
+ await this.workspaceTrustManagementService.setWorkspaceTrust(false);
1136
+ })),
866
1137
  keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0]
867
1138
  }]);
868
1139
  }
@@ -872,10 +1143,22 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
872
1143
  }
873
1144
  const textElement = append(parent, $('.workspace-trust-untrusted-description'));
874
1145
  if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
875
- textElement.innerText = this.workspaceService.getWorkbenchState() === 3 ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspaceReason', "This workspace is trusted via the bolded entries in the trusted folders below.") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedFolderReason', "This folder is trusted via the bolded entries in the the trusted folders below.");
1146
+ textElement.innerText = this.workspaceService.getWorkbenchState() === 3 ? ( localizeWithPath(
1147
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1148
+ 'untrustedWorkspaceReason',
1149
+ "This workspace is trusted via the bolded entries in the trusted folders below."
1150
+ )) : ( localizeWithPath(
1151
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1152
+ 'untrustedFolderReason',
1153
+ "This folder is trusted via the bolded entries in the the trusted folders below."
1154
+ ));
876
1155
  }
877
1156
  else {
878
- textElement.innerText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedForcedReason', "This window is trusted by nature of the workspace that is opened.");
1157
+ textElement.innerText = ( localizeWithPath(
1158
+ 'vs/workbench/contrib/workspace/browser/workspaceTrustEditor',
1159
+ 'trustedForcedReason',
1160
+ "This window is trusted by nature of the workspace that is opened."
1161
+ ));
879
1162
  }
880
1163
  }
881
1164
  renderLimitationsHeaderElement(parent, headerText, subtitleText) {