@codingame/monaco-vscode-workspace-trust-service-override 4.5.1 → 5.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.
@@ -9,7 +9,6 @@ import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs
9
9
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
10
10
  import 'vscode/vscode/vs/platform/notification/common/notification';
11
11
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
12
- import { workspaceTrustToString } from '../../../../platform/workspace/common/workspaceTrust.js';
13
12
  import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
14
13
  import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
15
14
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
@@ -49,6 +48,7 @@ import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/commo
49
48
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
50
49
  import Severity$1 from 'vscode/vscode/vs/base/common/severity';
51
50
 
51
+ const _moduleId = "vs/workbench/contrib/workspace/browser/workspace.contribution";
52
52
  const BANNER_RESTRICTED_MODE = 'workbench.banner.restrictedMode';
53
53
  const STARTUP_PROMPT_SHOWN_KEY = 'workspace.trust.startupPrompt.shown';
54
54
  const BANNER_RESTRICTED_MODE_DISMISSED_KEY = 'workbench.banner.restrictedMode.dismissed';
@@ -62,12 +62,12 @@ let WorkspaceTrustContextKeys = class WorkspaceTrustContextKeys extends Disposab
62
62
  this._register(workspaceTrustManagementService.onDidChangeTrust(trusted => this._ctxWorkspaceTrustState.set(trusted)));
63
63
  }
64
64
  };
65
- WorkspaceTrustContextKeys = ( __decorate([
66
- ( __param(0, IContextKeyService)),
67
- ( __param(1, IWorkspaceTrustEnablementService)),
68
- ( __param(2, IWorkspaceTrustManagementService))
69
- ], WorkspaceTrustContextKeys));
70
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustContextKeys, 3 );
65
+ WorkspaceTrustContextKeys = ( (__decorate([
66
+ ( (__param(0, IContextKeyService))),
67
+ ( (__param(1, IWorkspaceTrustEnablementService))),
68
+ ( (__param(2, IWorkspaceTrustManagementService)))
69
+ ], WorkspaceTrustContextKeys)));
70
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkspaceTrustContextKeys, 3 );
71
71
  let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Disposable {
72
72
  static { this.ID = 'workbench.contrib.workspaceTrustRequestHandler'; }
73
73
  constructor(dialogService, commandService, workspaceContextService, workspaceTrustManagementService, workspaceTrustRequestService) {
@@ -88,49 +88,33 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
88
88
  const markdownDetails = [
89
89
  this.workspaceContextService.getWorkbenchState() !== 1 ?
90
90
  ( localizeWithPath(
91
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
92
- 'openLooseFileWorkspaceDetails',
91
+ _moduleId,
92
+ 0,
93
93
  "You are trying to open untrusted files in a workspace which is trusted."
94
94
  )) :
95
95
  ( localizeWithPath(
96
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
97
- 'openLooseFileWindowDetails',
96
+ _moduleId,
97
+ 1,
98
98
  "You are trying to open untrusted files in a window which is trusted."
99
99
  )),
100
100
  ( localizeWithPath(
101
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
102
- 'openLooseFileLearnMore',
101
+ _moduleId,
102
+ 2,
103
103
  "If you don't want to open untrusted files, we recommend to open them in Restricted Mode in a new window as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
104
104
  ))
105
105
  ];
106
106
  await this.dialogService.prompt({
107
107
  type: Severity$1.Info,
108
108
  message: this.workspaceContextService.getWorkbenchState() !== 1 ?
109
- ( localizeWithPath(
110
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
111
- 'openLooseFileWorkspaceMesssage',
112
- "Do you want to allow untrusted files in this workspace?"
113
- )) :
114
- ( localizeWithPath(
115
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
116
- 'openLooseFileWindowMesssage',
117
- "Do you want to allow untrusted files in this window?"
118
- )),
109
+ ( localizeWithPath(_moduleId, 3, "Do you want to allow untrusted files in this workspace?")) :
110
+ ( localizeWithPath(_moduleId, 4, "Do you want to allow untrusted files in this window?")),
119
111
  buttons: [
120
112
  {
121
- label: ( localizeWithPath(
122
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
123
- { key: 'open', comment: ['&& denotes a mnemonic'] },
124
- "&&Open"
125
- )),
113
+ label: ( localizeWithPath(_moduleId, 5, "&&Open")),
126
114
  run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(1 , !!checkboxChecked)
127
115
  },
128
116
  {
129
- label: ( localizeWithPath(
130
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
131
- { key: 'newWindow', comment: ['&& denotes a mnemonic'] },
132
- "Open in &&Restricted Mode"
133
- )),
117
+ label: ( localizeWithPath(_moduleId, 6, "Open in &&Restricted Mode")),
134
118
  run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(2 , !!checkboxChecked)
135
119
  }
136
120
  ],
@@ -138,60 +122,32 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
138
122
  run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(3 )
139
123
  },
140
124
  checkbox: {
141
- label: ( localizeWithPath(
142
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
143
- 'openLooseFileWorkspaceCheckbox',
144
- "Remember my decision for all workspaces"
145
- )),
125
+ label: ( localizeWithPath(_moduleId, 7, "Remember my decision for all workspaces")),
146
126
  checked: false
147
127
  },
148
128
  custom: {
149
129
  icon: Codicon.shield,
150
- markdownDetails: ( markdownDetails.map(md => { return { markdown: ( new MarkdownString(md)) }; }))
130
+ markdownDetails: ( (markdownDetails.map(md => { return { markdown: ( (new MarkdownString(md))) }; })))
151
131
  }
152
132
  });
153
133
  }));
154
134
  this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
155
135
  await this.workspaceTrustManagementService.workspaceResolved;
156
136
  const message = this.useWorkspaceLanguage ?
157
- ( localizeWithPath(
158
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
159
- 'workspaceTrust',
160
- "Do you trust the authors of the files in this workspace?"
161
- )) :
162
- ( localizeWithPath(
163
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
164
- 'folderTrust',
165
- "Do you trust the authors of the files in this folder?"
166
- ));
137
+ ( localizeWithPath(_moduleId, 8, "Do you trust the authors of the files in this workspace?")) :
138
+ ( localizeWithPath(_moduleId, 9, "Do you trust the authors of the files in this folder?"));
167
139
  const defaultDetails = ( localizeWithPath(
168
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
169
- 'immediateTrustRequestMessage',
140
+ _moduleId,
141
+ 10,
170
142
  "A feature you are trying to use may be a security risk if you do not trust the source of the files or folders you currently have open."
171
143
  ));
172
144
  const details = requestOptions?.message ?? defaultDetails;
173
145
  const buttons = requestOptions?.buttons ?? [
174
- { label: this.useWorkspaceLanguage ? ( localizeWithPath(
175
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
176
- { key: 'grantWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] },
177
- "&&Trust Workspace & Continue"
178
- )) : ( localizeWithPath(
179
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
180
- { key: 'grantFolderTrustButton', comment: ['&& denotes a mnemonic'] },
181
- "&&Trust Folder & Continue"
182
- )), type: 'ContinueWithTrust' },
183
- { label: ( localizeWithPath(
184
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
185
- { key: 'manageWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] },
186
- "&&Manage"
187
- )), type: 'Manage' }
146
+ { label: this.useWorkspaceLanguage ? ( localizeWithPath(_moduleId, 11, "&&Trust Workspace & Continue")) : ( localizeWithPath(_moduleId, 12, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
147
+ { label: ( localizeWithPath(_moduleId, 13, "&&Manage")), type: 'Manage' }
188
148
  ];
189
- if (!( buttons.some(b => b.type === 'Cancel'))) {
190
- buttons.push({ label: ( localizeWithPath(
191
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
192
- 'cancelWorkspaceTrustButton',
193
- "Cancel"
194
- )), type: 'Cancel' });
149
+ if (!( (buttons.some(b => b.type === 'Cancel')))) {
150
+ buttons.push({ label: ( localizeWithPath(_moduleId, 14, "Cancel")), type: 'Cancel' });
195
151
  }
196
152
  const { result } = await this.dialogService.prompt({
197
153
  type: Severity$1.Info,
@@ -199,20 +155,20 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
199
155
  custom: {
200
156
  icon: Codicon.shield,
201
157
  markdownDetails: [
202
- { markdown: ( new MarkdownString(details)) },
203
- { markdown: ( new MarkdownString(( localizeWithPath(
204
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
205
- 'immediateTrustRequestLearnMore',
158
+ { markdown: ( (new MarkdownString(details))) },
159
+ { markdown: ( (new MarkdownString(( localizeWithPath(
160
+ _moduleId,
161
+ 15,
206
162
  "If you don't trust the authors of these files, we do not recommend continuing as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
207
- )))) }
163
+ ))))) }
208
164
  ]
209
165
  },
210
- buttons: ( buttons.filter(b => b.type !== 'Cancel').map(button => {
166
+ buttons: ( (buttons.filter(b => b.type !== 'Cancel').map(button => {
211
167
  return {
212
168
  label: button.label,
213
169
  run: () => button.type
214
170
  };
215
- })),
171
+ }))),
216
172
  cancelButton: (() => {
217
173
  const cancelButton = buttons.find(b => b.type === 'Cancel');
218
174
  if (!cancelButton) {
@@ -242,13 +198,13 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
242
198
  }));
243
199
  }
244
200
  };
245
- WorkspaceTrustRequestHandler = ( __decorate([
246
- ( __param(0, IDialogService)),
247
- ( __param(1, ICommandService)),
248
- ( __param(2, IWorkspaceContextService)),
249
- ( __param(3, IWorkspaceTrustManagementService)),
250
- ( __param(4, IWorkspaceTrustRequestService))
251
- ], WorkspaceTrustRequestHandler));
201
+ WorkspaceTrustRequestHandler = ( (__decorate([
202
+ ( (__param(0, IDialogService))),
203
+ ( (__param(1, ICommandService))),
204
+ ( (__param(2, IWorkspaceContextService))),
205
+ ( (__param(3, IWorkspaceTrustManagementService))),
206
+ ( (__param(4, IWorkspaceTrustRequestService)))
207
+ ], WorkspaceTrustRequestHandler)));
252
208
  let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
253
209
  constructor(dialogService, workspaceContextService, workspaceTrustEnablementService, workspaceTrustManagementService, configurationService, statusbarService, storageService, workspaceTrustRequestService, bannerService, labelService, hostService, productService, remoteAgentService, environmentService, fileService) {
254
210
  super();
@@ -268,7 +224,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
268
224
  this.environmentService = environmentService;
269
225
  this.fileService = fileService;
270
226
  this.entryId = `status.workspaceTrust`;
271
- this.statusbarEntryAccessor = this._register(( new MutableDisposable()));
227
+ this.statusbarEntryAccessor = this._register(( (new MutableDisposable())));
272
228
  (async () => {
273
229
  await this.workspaceTrustManagementService.workspaceTrustInitialized;
274
230
  if (this.workspaceTrustEnablementService.isWorkspaceTrustEnabled()) {
@@ -299,28 +255,20 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
299
255
  const addWorkspaceFolder = async (e) => {
300
256
  const trusted = this.workspaceTrustManagementService.isWorkspaceTrusted();
301
257
  if (trusted && (e.changes.added.length || e.changes.changed.length)) {
302
- const addedFoldersTrustInfo = await Promise.all(( e.changes.added.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder.uri))));
303
- if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
258
+ const addedFoldersTrustInfo = await Promise.all(( (e.changes.added.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder.uri)))));
259
+ if (!( (addedFoldersTrustInfo.map(info => info.trusted))).every(trusted => trusted)) {
304
260
  const { confirmed } = await this.dialogService.confirm({
305
261
  type: Severity$1.Info,
306
- message: ( localizeWithPath(
307
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
308
- 'addWorkspaceFolderMessage',
309
- "Do you trust the authors of the files in this folder?"
310
- )),
262
+ message: ( localizeWithPath(_moduleId, 16, "Do you trust the authors of the files in this folder?")),
311
263
  detail: ( localizeWithPath(
312
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
313
- 'addWorkspaceFolderDetail',
264
+ _moduleId,
265
+ 17,
314
266
  "You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
315
267
  )),
316
- cancelButton: ( localizeWithPath(
317
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
318
- 'no',
319
- 'No'
320
- )),
268
+ cancelButton: ( localizeWithPath(_moduleId, 18, 'No')),
321
269
  custom: { icon: Codicon.shield }
322
270
  });
323
- await this.workspaceTrustManagementService.setUrisTrust(( addedFoldersTrustInfo.map(i => i.uri)), confirmed);
271
+ await this.workspaceTrustManagementService.setUrisTrust(( (addedFoldersTrustInfo.map(i => i.uri))), confirmed);
324
272
  }
325
273
  }
326
274
  };
@@ -345,16 +293,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
345
293
  console.warn('AI generated workspace trust dialog contents not available.');
346
294
  }
347
295
  const title = titleString ?? (this.useWorkspaceLanguage ?
348
- ( localizeWithPath(
349
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
350
- 'workspaceTrust',
351
- "Do you trust the authors of the files in this workspace?"
352
- )) :
353
- ( localizeWithPath(
354
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
355
- 'folderTrust',
356
- "Do you trust the authors of the files in this folder?"
357
- )));
296
+ ( localizeWithPath(_moduleId, 8, "Do you trust the authors of the files in this workspace?")) :
297
+ ( localizeWithPath(_moduleId, 9, "Do you trust the authors of the files in this folder?")));
358
298
  let checkboxText;
359
299
  const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
360
300
  const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
@@ -362,53 +302,29 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
362
302
  if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
363
303
  const name = basename(dirname(workspaceIdentifier.uri));
364
304
  checkboxText = ( localizeWithPath(
365
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
366
- 'checkboxString',
305
+ _moduleId,
306
+ 19,
367
307
  "Trust the authors of all files in the parent folder '{0}'",
368
308
  name
369
309
  ));
370
310
  }
371
- this.doShowModal(title, { label: trustOption ?? ( localizeWithPath(
372
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
373
- { key: 'trustOption', comment: ['&& denotes a mnemonic'] },
374
- "&&Yes, I trust the authors"
375
- )), sublabel: isSingleFolderWorkspace ? ( localizeWithPath(
376
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
377
- 'trustFolderOptionDescription',
378
- "Trust folder and enable all features"
379
- )) : ( localizeWithPath(
380
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
381
- 'trustWorkspaceOptionDescription',
382
- "Trust workspace and enable all features"
383
- )) }, { label: dontTrustOption ?? ( localizeWithPath(
384
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
385
- { key: 'dontTrustOption', comment: ['&& denotes a mnemonic'] },
386
- "&&No, I don't trust the authors"
387
- )), sublabel: isSingleFolderWorkspace ? ( localizeWithPath(
388
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
389
- 'dontTrustFolderOptionDescription',
390
- "Browse folder in restricted mode"
391
- )) : ( localizeWithPath(
392
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
393
- 'dontTrustWorkspaceOptionDescription',
394
- "Browse workspace in restricted mode"
395
- )) }, [
311
+ this.doShowModal(title, { label: trustOption ?? ( localizeWithPath(_moduleId, 20, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localizeWithPath(_moduleId, 21, "Trust folder and enable all features")) : ( localizeWithPath(_moduleId, 22, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localizeWithPath(_moduleId, 23, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localizeWithPath(_moduleId, 24, "Browse folder in restricted mode")) : ( localizeWithPath(_moduleId, 25, "Browse workspace in restricted mode")) }, [
396
312
  !isSingleFolderWorkspace ?
397
313
  ( localizeWithPath(
398
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
399
- 'workspaceStartupTrustDetails',
314
+ _moduleId,
315
+ 26,
400
316
  "{0} provides features that may automatically execute files in this workspace.",
401
317
  this.productService.nameShort
402
318
  )) :
403
319
  ( localizeWithPath(
404
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
405
- 'folderStartupTrustDetails',
320
+ _moduleId,
321
+ 27,
406
322
  "{0} provides features that may automatically execute files in this folder.",
407
323
  this.productService.nameShort
408
324
  )),
409
325
  learnMoreString ?? ( localizeWithPath(
410
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
411
- 'startupTrustRequestLearnMore',
326
+ _moduleId,
327
+ 28,
412
328
  "If you don't trust the authors of these files, we recommend to continue in restricted mode as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
413
329
  )),
414
330
  !isEmptyWindow ?
@@ -462,7 +378,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
462
378
  ],
463
379
  disableCloseAction: true,
464
380
  icon: Codicon.shield,
465
- markdownDetails: ( markdownStrings.map(md => { return { markdown: ( new MarkdownString(md)) }; }))
381
+ markdownDetails: ( (markdownStrings.map(md => { return { markdown: ( (new MarkdownString(md))) }; })))
466
382
  }
467
383
  });
468
384
  this.storageService.store(STARTUP_PROMPT_SHOWN_KEY, true, 1 , 1 );
@@ -505,8 +421,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
505
421
  if (result) {
506
422
  try {
507
423
  const content = await this.fileService.readFile(aiGeneratedWorkspaces);
508
- const workspaces = JSON.parse(( content.value.toString()));
509
- if (workspaces.indexOf(( this.workspaceContextService.getWorkspace().folders[0].uri.toString())) > -1) {
424
+ const workspaces = JSON.parse(( (content.value.toString())));
425
+ if (workspaces.indexOf(( (this.workspaceContextService.getWorkspace().folders[0].uri.toString()))) > -1) {
510
426
  return true;
511
427
  }
512
428
  }
@@ -526,19 +442,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
526
442
  }
527
443
  const actions = [
528
444
  {
529
- label: ( localizeWithPath(
530
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
531
- 'restrictedModeBannerManage',
532
- "Manage"
533
- )),
445
+ label: ( localizeWithPath(_moduleId, 29, "Manage")),
534
446
  href: 'command:' + MANAGE_TRUST_COMMAND_ID
535
447
  },
536
448
  {
537
- label: ( localizeWithPath(
538
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
539
- 'restrictedModeBannerLearnMore',
540
- "Learn More"
541
- )),
449
+ label: ( localizeWithPath(_moduleId, 30, "Learn More")),
542
450
  href: 'https://aka.ms/vscode-workspace-trust'
543
451
  }
544
452
  ];
@@ -559,20 +467,20 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
559
467
  switch (this.workspaceContextService.getWorkbenchState()) {
560
468
  case 1 :
561
469
  return ( localizeWithPath(
562
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
563
- 'restrictedModeBannerAriaLabelWindow',
470
+ _moduleId,
471
+ 31,
564
472
  "Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
565
473
  ));
566
474
  case 2 :
567
475
  return ( localizeWithPath(
568
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
569
- 'restrictedModeBannerAriaLabelFolder',
476
+ _moduleId,
477
+ 32,
570
478
  "Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
571
479
  ));
572
480
  case 3 :
573
481
  return ( localizeWithPath(
574
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
575
- 'restrictedModeBannerAriaLabelWorkspace',
482
+ _moduleId,
483
+ 33,
576
484
  "Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
577
485
  ));
578
486
  }
@@ -581,20 +489,20 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
581
489
  switch (this.workspaceContextService.getWorkbenchState()) {
582
490
  case 1 :
583
491
  return ( localizeWithPath(
584
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
585
- 'restrictedModeBannerMessageWindow',
492
+ _moduleId,
493
+ 34,
586
494
  "Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
587
495
  ));
588
496
  case 2 :
589
497
  return ( localizeWithPath(
590
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
591
- 'restrictedModeBannerMessageFolder',
498
+ _moduleId,
499
+ 35,
592
500
  "Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
593
501
  ));
594
502
  case 3 :
595
503
  return ( localizeWithPath(
596
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
597
- 'restrictedModeBannerMessageWorkspace',
504
+ _moduleId,
505
+ 36,
598
506
  "Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
599
507
  ));
600
508
  }
@@ -606,26 +514,20 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
606
514
  }
607
515
  return result;
608
516
  }
609
- getStatusbarEntry(trusted) {
610
- const text = workspaceTrustToString(trusted);
517
+ getRestrictedModeStatusbarEntry() {
611
518
  let ariaLabel = '';
612
519
  let toolTip;
613
520
  switch (this.workspaceContextService.getWorkbenchState()) {
614
521
  case 1 : {
615
- ariaLabel = trusted ? ( localizeWithPath(
616
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
617
- 'status.ariaTrustedWindow',
618
- "This window is trusted."
619
- )) :
620
- ( localizeWithPath(
621
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
622
- 'status.ariaUntrustedWindow',
623
- "Restricted Mode: Some features are disabled because this window is not trusted."
624
- ));
625
- toolTip = trusted ? ariaLabel : {
522
+ ariaLabel = ( localizeWithPath(
523
+ _moduleId,
524
+ 37,
525
+ "Restricted Mode: Some features are disabled because this window is not trusted."
526
+ ));
527
+ toolTip = {
626
528
  value: ( localizeWithPath(
627
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
628
- { key: 'status.tooltipUntrustedWindow2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `window is not trusted`. Do not change brackets and parentheses or {n}'] },
529
+ _moduleId,
530
+ 38,
629
531
  "Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
630
532
  `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
631
533
  `command:${MANAGE_TRUST_COMMAND_ID}`
@@ -636,20 +538,15 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
636
538
  break;
637
539
  }
638
540
  case 2 : {
639
- ariaLabel = trusted ? ( localizeWithPath(
640
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
641
- 'status.ariaTrustedFolder',
642
- "This folder is trusted."
643
- )) :
644
- ( localizeWithPath(
645
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
646
- 'status.ariaUntrustedFolder',
647
- "Restricted Mode: Some features are disabled because this folder is not trusted."
648
- ));
649
- toolTip = trusted ? ariaLabel : {
541
+ ariaLabel = ( localizeWithPath(
542
+ _moduleId,
543
+ 39,
544
+ "Restricted Mode: Some features are disabled because this folder is not trusted."
545
+ ));
546
+ toolTip = {
650
547
  value: ( localizeWithPath(
651
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
652
- { key: 'status.tooltipUntrustedFolder2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `folder is not trusted`. Do not change brackets and parentheses or {n}'] },
548
+ _moduleId,
549
+ 40,
653
550
  "Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
654
551
  `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
655
552
  `command:${MANAGE_TRUST_COMMAND_ID}`
@@ -660,20 +557,15 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
660
557
  break;
661
558
  }
662
559
  case 3 : {
663
- ariaLabel = trusted ? ( localizeWithPath(
664
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
665
- 'status.ariaTrustedWorkspace',
666
- "This workspace is trusted."
667
- )) :
668
- ( localizeWithPath(
669
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
670
- 'status.ariaUntrustedWorkspace',
671
- "Restricted Mode: Some features are disabled because this workspace is not trusted."
672
- ));
673
- toolTip = trusted ? ariaLabel : {
560
+ ariaLabel = ( localizeWithPath(
561
+ _moduleId,
562
+ 41,
563
+ "Restricted Mode: Some features are disabled because this workspace is not trusted."
564
+ ));
565
+ toolTip = {
674
566
  value: ( localizeWithPath(
675
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
676
- { key: 'status.tooltipUntrustedWorkspace2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `workspace is not trusted`. Do not change brackets and parentheses or {n}'] },
567
+ _moduleId,
568
+ 42,
677
569
  "Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
678
570
  `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
679
571
  `command:${MANAGE_TRUST_COMMAND_ID}`
@@ -685,12 +577,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
685
577
  }
686
578
  }
687
579
  return {
688
- name: ( localizeWithPath(
689
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
690
- 'status.WorkspaceTrust',
691
- "Workspace Trust"
692
- )),
693
- text: trusted ? `$(shield)` : `$(shield) ${text}`,
580
+ name: ( localizeWithPath(_moduleId, 43, "Workspace Trust")),
581
+ text: `$(shield) ${( localizeWithPath(_moduleId, 44, "Restricted Mode"))}`,
694
582
  ariaLabel: ariaLabel,
695
583
  tooltip: toolTip,
696
584
  command: MANAGE_TRUST_COMMAND_ID,
@@ -703,30 +591,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
703
591
  return;
704
592
  }
705
593
  if (!trusted && !this.statusbarEntryAccessor.value) {
706
- const entry = this.getStatusbarEntry(trusted);
594
+ const entry = this.getRestrictedModeStatusbarEntry();
707
595
  this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, 0 , 0.99 * Number.MAX_VALUE );
708
596
  }
709
597
  }
710
598
  };
711
- WorkspaceTrustUXHandler = ( __decorate([
712
- ( __param(0, IDialogService)),
713
- ( __param(1, IWorkspaceContextService)),
714
- ( __param(2, IWorkspaceTrustEnablementService)),
715
- ( __param(3, IWorkspaceTrustManagementService)),
716
- ( __param(4, IConfigurationService)),
717
- ( __param(5, IStatusbarService)),
718
- ( __param(6, IStorageService)),
719
- ( __param(7, IWorkspaceTrustRequestService)),
720
- ( __param(8, IBannerService)),
721
- ( __param(9, ILabelService)),
722
- ( __param(10, IHostService)),
723
- ( __param(11, IProductService)),
724
- ( __param(12, IRemoteAgentService)),
725
- ( __param(13, IEnvironmentService)),
726
- ( __param(14, IFileService))
727
- ], WorkspaceTrustUXHandler));
599
+ WorkspaceTrustUXHandler = ( (__decorate([
600
+ ( (__param(0, IDialogService))),
601
+ ( (__param(1, IWorkspaceContextService))),
602
+ ( (__param(2, IWorkspaceTrustEnablementService))),
603
+ ( (__param(3, IWorkspaceTrustManagementService))),
604
+ ( (__param(4, IConfigurationService))),
605
+ ( (__param(5, IStatusbarService))),
606
+ ( (__param(6, IStorageService))),
607
+ ( (__param(7, IWorkspaceTrustRequestService))),
608
+ ( (__param(8, IBannerService))),
609
+ ( (__param(9, ILabelService))),
610
+ ( (__param(10, IHostService))),
611
+ ( (__param(11, IProductService))),
612
+ ( (__param(12, IRemoteAgentService))),
613
+ ( (__param(13, IEnvironmentService))),
614
+ ( (__param(14, IFileService)))
615
+ ], WorkspaceTrustUXHandler)));
728
616
  registerWorkbenchContribution2(WorkspaceTrustRequestHandler.ID, WorkspaceTrustRequestHandler, 2 );
729
- ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustUXHandler, 3 );
617
+ ( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkspaceTrustUXHandler, 3 );
730
618
  class WorkspaceTrustEditorInputSerializer {
731
619
  canSerialize(editorInput) {
732
620
  return true;
@@ -738,31 +626,22 @@ class WorkspaceTrustEditorInputSerializer {
738
626
  return instantiationService.createInstance(WorkspaceTrustEditorInput);
739
627
  }
740
628
  }
741
- ( Registry.as(EditorExtensions.EditorFactory))
629
+ ( (Registry.as(EditorExtensions.EditorFactory)))
742
630
  .registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
743
- ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localizeWithPath(
744
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
745
- 'workspaceTrustEditor',
746
- "Workspace Trust Editor"
747
- ))), [
748
- ( new SyncDescriptor(WorkspaceTrustEditorInput))
631
+ ( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localizeWithPath(_moduleId, 45, "Workspace Trust Editor"))), [
632
+ ( (new SyncDescriptor(WorkspaceTrustEditorInput)))
749
633
  ]);
750
634
  const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
751
- const WORKSPACES_CATEGORY = ( localize2WithPath(
752
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
753
- 'workspacesCategory',
754
- 'Workspaces'
755
- ));
635
+ const WORKSPACES_CATEGORY = ( localize2WithPath(_moduleId, 46, 'Workspaces'));
756
636
  registerAction2(class extends Action2 {
757
637
  constructor() {
758
638
  super({
759
639
  id: CONFIGURE_TRUST_COMMAND_ID,
760
- title: ( localize2WithPath(
761
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
762
- 'configureWorkspaceTrustSettings',
763
- "Configure Workspace Trust Settings"
764
- )),
765
- precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
640
+ title: ( localize2WithPath(_moduleId, 47, "Configure Workspace Trust Settings")),
641
+ precondition: ( (ContextKeyExpr.and(
642
+ WorkspaceTrustContext.IsEnabled,
643
+ (ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
644
+ ))),
766
645
  category: WORKSPACES_CATEGORY,
767
646
  f1: true
768
647
  });
@@ -775,12 +654,11 @@ registerAction2(class extends Action2 {
775
654
  constructor() {
776
655
  super({
777
656
  id: MANAGE_TRUST_COMMAND_ID,
778
- title: ( localize2WithPath(
779
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
780
- 'manageWorkspaceTrust',
781
- "Manage Workspace Trust"
782
- )),
783
- precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
657
+ title: ( localize2WithPath(_moduleId, 48, "Manage Workspace Trust")),
658
+ precondition: ( (ContextKeyExpr.and(
659
+ WorkspaceTrustContext.IsEnabled,
660
+ (ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
661
+ ))),
784
662
  category: WORKSPACES_CATEGORY,
785
663
  f1: true,
786
664
  });
@@ -793,7 +671,7 @@ registerAction2(class extends Action2 {
793
671
  return;
794
672
  }
795
673
  });
796
- ( Registry.as(Extensions$1.Configuration))
674
+ ( (Registry.as(Extensions$1.Configuration)))
797
675
  .registerConfiguration({
798
676
  ...securityConfigurationNodeBase,
799
677
  properties: {
@@ -801,8 +679,8 @@ registerAction2(class extends Action2 {
801
679
  type: 'boolean',
802
680
  default: true,
803
681
  description: ( localizeWithPath(
804
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
805
- 'workspace.trust.description',
682
+ _moduleId,
683
+ 49,
806
684
  "Controls whether or not Workspace Trust is enabled within VS Code."
807
685
  )),
808
686
  tags: [WORKSPACE_TRUST_SETTING_TAG],
@@ -812,8 +690,8 @@ registerAction2(class extends Action2 {
812
690
  type: 'string',
813
691
  default: 'once',
814
692
  description: ( localizeWithPath(
815
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
816
- 'workspace.trust.startupPrompt.description',
693
+ _moduleId,
694
+ 50,
817
695
  "Controls when the startup prompt to trust a workspace is shown."
818
696
  )),
819
697
  tags: [WORKSPACE_TRUST_SETTING_TAG],
@@ -821,18 +699,18 @@ registerAction2(class extends Action2 {
821
699
  enum: ['always', 'once', 'never'],
822
700
  enumDescriptions: [
823
701
  ( localizeWithPath(
824
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
825
- 'workspace.trust.startupPrompt.always',
702
+ _moduleId,
703
+ 51,
826
704
  "Ask for trust every time an untrusted workspace is opened."
827
705
  )),
828
706
  ( localizeWithPath(
829
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
830
- 'workspace.trust.startupPrompt.once',
707
+ _moduleId,
708
+ 52,
831
709
  "Ask for trust the first time an untrusted workspace is opened."
832
710
  )),
833
711
  ( localizeWithPath(
834
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
835
- 'workspace.trust.startupPrompt.never',
712
+ _moduleId,
713
+ 53,
836
714
  "Do not ask for trust when an untrusted workspace is opened."
837
715
  )),
838
716
  ]
@@ -840,28 +718,24 @@ registerAction2(class extends Action2 {
840
718
  [WORKSPACE_TRUST_BANNER]: {
841
719
  type: 'string',
842
720
  default: 'untilDismissed',
843
- description: ( localizeWithPath(
844
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
845
- 'workspace.trust.banner.description',
846
- "Controls when the restricted mode banner is shown."
847
- )),
721
+ description: ( localizeWithPath(_moduleId, 54, "Controls when the restricted mode banner is shown.")),
848
722
  tags: [WORKSPACE_TRUST_SETTING_TAG],
849
723
  scope: 1 ,
850
724
  enum: ['always', 'untilDismissed', 'never'],
851
725
  enumDescriptions: [
852
726
  ( localizeWithPath(
853
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
854
- 'workspace.trust.banner.always',
727
+ _moduleId,
728
+ 55,
855
729
  "Show the banner every time an untrusted workspace is open."
856
730
  )),
857
731
  ( localizeWithPath(
858
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
859
- 'workspace.trust.banner.untilDismissed',
732
+ _moduleId,
733
+ 56,
860
734
  "Show the banner when an untrusted workspace is opened until dismissed."
861
735
  )),
862
736
  ( localizeWithPath(
863
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
864
- 'workspace.trust.banner.never',
737
+ _moduleId,
738
+ 57,
865
739
  "Do not show the banner when an untrusted workspace is open."
866
740
  )),
867
741
  ]
@@ -870,8 +744,8 @@ registerAction2(class extends Action2 {
870
744
  type: 'string',
871
745
  default: 'prompt',
872
746
  markdownDescription: ( localizeWithPath(
873
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
874
- 'workspace.trust.untrustedFiles.description',
747
+ _moduleId,
748
+ 58,
875
749
  "Controls how to handle opening untrusted files in a trusted workspace. This setting also applies to opening files in an empty window which is trusted via `#{0}#`.",
876
750
  WORKSPACE_TRUST_EMPTY_WINDOW
877
751
  )),
@@ -880,18 +754,18 @@ registerAction2(class extends Action2 {
880
754
  enum: ['prompt', 'open', 'newWindow'],
881
755
  enumDescriptions: [
882
756
  ( localizeWithPath(
883
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
884
- 'workspace.trust.untrustedFiles.prompt',
757
+ _moduleId,
758
+ 59,
885
759
  "Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
886
760
  )),
887
761
  ( localizeWithPath(
888
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
889
- 'workspace.trust.untrustedFiles.open',
762
+ _moduleId,
763
+ 60,
890
764
  "Always allow untrusted files to be introduced to a trusted workspace without prompting."
891
765
  )),
892
766
  ( localizeWithPath(
893
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
894
- 'workspace.trust.untrustedFiles.newWindow',
767
+ _moduleId,
768
+ 61,
895
769
  "Always open untrusted files in a separate window in restricted mode without prompting."
896
770
  )),
897
771
  ]
@@ -900,8 +774,8 @@ registerAction2(class extends Action2 {
900
774
  type: 'boolean',
901
775
  default: true,
902
776
  markdownDescription: ( localizeWithPath(
903
- 'vs/workbench/contrib/workspace/browser/workspace.contribution',
904
- 'workspace.trust.emptyWindow.description',
777
+ _moduleId,
778
+ 62,
905
779
  "Controls whether or not the empty window is trusted by default within VS Code. When used with `#{0}#`, you can enable the full functionality of VS Code without prompting in an empty window.",
906
780
  WORKSPACE_TRUST_UNTRUSTED_FILES
907
781
  )),
@@ -968,14 +842,14 @@ let WorkspaceTrustTelemetryContribution = class WorkspaceTrustTelemetryContribut
968
842
  }
969
843
  }
970
844
  };
971
- WorkspaceTrustTelemetryContribution = ( __decorate([
972
- ( __param(0, IWorkbenchEnvironmentService)),
973
- ( __param(1, ITelemetryService)),
974
- ( __param(2, IWorkspaceContextService)),
975
- ( __param(3, IWorkspaceTrustEnablementService)),
976
- ( __param(4, IWorkspaceTrustManagementService))
977
- ], WorkspaceTrustTelemetryContribution));
978
- ( Registry.as(Extensions.Workbench))
845
+ WorkspaceTrustTelemetryContribution = ( (__decorate([
846
+ ( (__param(0, IWorkbenchEnvironmentService))),
847
+ ( (__param(1, ITelemetryService))),
848
+ ( (__param(2, IWorkspaceContextService))),
849
+ ( (__param(3, IWorkspaceTrustEnablementService))),
850
+ ( (__param(4, IWorkspaceTrustManagementService)))
851
+ ], WorkspaceTrustTelemetryContribution)));
852
+ ( (Registry.as(Extensions.Workbench)))
979
853
  .registerWorkbenchContribution(WorkspaceTrustTelemetryContribution, 3 );
980
854
 
981
855
  export { WorkspaceTrustContextKeys, WorkspaceTrustRequestHandler, WorkspaceTrustUXHandler };