@codingame/monaco-vscode-workspace-trust-service-override 1.83.5 → 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.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +340 -63
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +372 -89
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +10 -10
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workspace-trust-service-override",
|
|
3
|
-
"version": "1.83.
|
|
3
|
+
"version": "1.83.6",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.83.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.83.6",
|
|
22
22
|
"monaco-editor": "0.44.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -83,22 +83,50 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
83
83
|
this._register(this.workspaceTrustRequestService.onDidInitiateOpenFilesTrustRequest(async () => {
|
|
84
84
|
const markdownDetails = [
|
|
85
85
|
this.workspaceContextService.getWorkbenchState() !== 1 ?
|
|
86
|
-
localizeWithPath(
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
( localizeWithPath(
|
|
87
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
88
|
+
'openLooseFileWorkspaceDetails',
|
|
89
|
+
"You are trying to open untrusted files in a workspace which is trusted."
|
|
90
|
+
)) :
|
|
91
|
+
( localizeWithPath(
|
|
92
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
93
|
+
'openLooseFileWindowDetails',
|
|
94
|
+
"You are trying to open untrusted files in a window which is trusted."
|
|
95
|
+
)),
|
|
96
|
+
( localizeWithPath(
|
|
97
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
98
|
+
'openLooseFileLearnMore',
|
|
99
|
+
"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."
|
|
100
|
+
))
|
|
89
101
|
];
|
|
90
102
|
await this.dialogService.prompt({
|
|
91
103
|
type: Severity.Info,
|
|
92
104
|
message: this.workspaceContextService.getWorkbenchState() !== 1 ?
|
|
93
|
-
localizeWithPath(
|
|
94
|
-
|
|
105
|
+
( localizeWithPath(
|
|
106
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
107
|
+
'openLooseFileWorkspaceMesssage',
|
|
108
|
+
"Do you want to allow untrusted files in this workspace?"
|
|
109
|
+
)) :
|
|
110
|
+
( localizeWithPath(
|
|
111
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
112
|
+
'openLooseFileWindowMesssage',
|
|
113
|
+
"Do you want to allow untrusted files in this window?"
|
|
114
|
+
)),
|
|
95
115
|
buttons: [
|
|
96
116
|
{
|
|
97
|
-
label: localizeWithPath(
|
|
117
|
+
label: ( localizeWithPath(
|
|
118
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
119
|
+
{ key: 'open', comment: ['&& denotes a mnemonic'] },
|
|
120
|
+
"&&Open"
|
|
121
|
+
)),
|
|
98
122
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(1 , !!checkboxChecked)
|
|
99
123
|
},
|
|
100
124
|
{
|
|
101
|
-
label: localizeWithPath(
|
|
125
|
+
label: ( localizeWithPath(
|
|
126
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
127
|
+
{ key: 'newWindow', comment: ['&& denotes a mnemonic'] },
|
|
128
|
+
"Open in &&Restricted Mode"
|
|
129
|
+
)),
|
|
102
130
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(2 , !!checkboxChecked)
|
|
103
131
|
}
|
|
104
132
|
],
|
|
@@ -106,7 +134,11 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
106
134
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(3 )
|
|
107
135
|
},
|
|
108
136
|
checkbox: {
|
|
109
|
-
label: localizeWithPath(
|
|
137
|
+
label: ( localizeWithPath(
|
|
138
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
139
|
+
'openLooseFileWorkspaceCheckbox',
|
|
140
|
+
"Remember my decision for all workspaces"
|
|
141
|
+
)),
|
|
110
142
|
checked: false
|
|
111
143
|
},
|
|
112
144
|
custom: {
|
|
@@ -117,16 +149,44 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
117
149
|
}));
|
|
118
150
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
119
151
|
const message = this.useWorkspaceLanguage ?
|
|
120
|
-
localizeWithPath(
|
|
121
|
-
|
|
122
|
-
|
|
152
|
+
( localizeWithPath(
|
|
153
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
154
|
+
'workspaceTrust',
|
|
155
|
+
"Do you trust the authors of the files in this workspace?"
|
|
156
|
+
)) :
|
|
157
|
+
( localizeWithPath(
|
|
158
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
159
|
+
'folderTrust',
|
|
160
|
+
"Do you trust the authors of the files in this folder?"
|
|
161
|
+
));
|
|
162
|
+
const defaultDetails = ( localizeWithPath(
|
|
163
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
164
|
+
'immediateTrustRequestMessage',
|
|
165
|
+
"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."
|
|
166
|
+
));
|
|
123
167
|
const details = requestOptions?.message ?? defaultDetails;
|
|
124
168
|
const buttons = requestOptions?.buttons ?? [
|
|
125
|
-
{ label: this.useWorkspaceLanguage ?
|
|
126
|
-
|
|
169
|
+
{ label: this.useWorkspaceLanguage ? ( localizeWithPath(
|
|
170
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
171
|
+
{ key: 'grantWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] },
|
|
172
|
+
"&&Trust Workspace & Continue"
|
|
173
|
+
)) : ( localizeWithPath(
|
|
174
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
175
|
+
{ key: 'grantFolderTrustButton', comment: ['&& denotes a mnemonic'] },
|
|
176
|
+
"&&Trust Folder & Continue"
|
|
177
|
+
)), type: 'ContinueWithTrust' },
|
|
178
|
+
{ label: ( localizeWithPath(
|
|
179
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
180
|
+
{ key: 'manageWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] },
|
|
181
|
+
"&&Manage"
|
|
182
|
+
)), type: 'Manage' }
|
|
127
183
|
];
|
|
128
184
|
if (!( buttons.some(b => b.type === 'Cancel'))) {
|
|
129
|
-
buttons.push({ label: localizeWithPath(
|
|
185
|
+
buttons.push({ label: ( localizeWithPath(
|
|
186
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
187
|
+
'cancelWorkspaceTrustButton',
|
|
188
|
+
"Cancel"
|
|
189
|
+
)), type: 'Cancel' });
|
|
130
190
|
}
|
|
131
191
|
const { result } = await this.dialogService.prompt({
|
|
132
192
|
type: Severity.Info,
|
|
@@ -135,9 +195,11 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
135
195
|
icon: Codicon.shield,
|
|
136
196
|
markdownDetails: [
|
|
137
197
|
{ markdown: ( new MarkdownString(details)) },
|
|
138
|
-
{ markdown: ( new MarkdownString(
|
|
139
|
-
|
|
140
|
-
|
|
198
|
+
{ markdown: ( new MarkdownString(( localizeWithPath(
|
|
199
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
200
|
+
'immediateTrustRequestLearnMore',
|
|
201
|
+
"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."
|
|
202
|
+
)))) }
|
|
141
203
|
]
|
|
142
204
|
},
|
|
143
205
|
buttons: ( buttons.filter(b => b.type !== 'Cancel').map(button => {
|
|
@@ -236,9 +298,21 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
236
298
|
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
237
299
|
const { confirmed } = await this.dialogService.confirm({
|
|
238
300
|
type: Severity.Info,
|
|
239
|
-
message: localizeWithPath(
|
|
240
|
-
|
|
241
|
-
|
|
301
|
+
message: ( localizeWithPath(
|
|
302
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
303
|
+
'addWorkspaceFolderMessage',
|
|
304
|
+
"Do you trust the authors of the files in this folder?"
|
|
305
|
+
)),
|
|
306
|
+
detail: ( localizeWithPath(
|
|
307
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
308
|
+
'addWorkspaceFolderDetail',
|
|
309
|
+
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
310
|
+
)),
|
|
311
|
+
cancelButton: ( localizeWithPath(
|
|
312
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
313
|
+
'no',
|
|
314
|
+
'No'
|
|
315
|
+
)),
|
|
242
316
|
custom: { icon: Codicon.shield }
|
|
243
317
|
});
|
|
244
318
|
await this.workspaceTrustManagementService.setUrisTrust(( addedFoldersTrustInfo.map(i => i.uri)), confirmed);
|
|
@@ -266,21 +340,72 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
266
340
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
267
341
|
}
|
|
268
342
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
269
|
-
localizeWithPath(
|
|
270
|
-
|
|
343
|
+
( localizeWithPath(
|
|
344
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
345
|
+
'workspaceTrust',
|
|
346
|
+
"Do you trust the authors of the files in this workspace?"
|
|
347
|
+
)) :
|
|
348
|
+
( localizeWithPath(
|
|
349
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
350
|
+
'folderTrust',
|
|
351
|
+
"Do you trust the authors of the files in this folder?"
|
|
352
|
+
)));
|
|
271
353
|
let checkboxText;
|
|
272
354
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
273
355
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
274
356
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
275
357
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
276
358
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
277
|
-
checkboxText = localizeWithPath(
|
|
359
|
+
checkboxText = ( localizeWithPath(
|
|
360
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
361
|
+
'checkboxString',
|
|
362
|
+
"Trust the authors of all files in the parent folder '{0}'",
|
|
363
|
+
name
|
|
364
|
+
));
|
|
278
365
|
}
|
|
279
|
-
this.doShowModal(title, { label: trustOption ??
|
|
366
|
+
this.doShowModal(title, { label: trustOption ?? ( localizeWithPath(
|
|
367
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
368
|
+
{ key: 'trustOption', comment: ['&& denotes a mnemonic'] },
|
|
369
|
+
"&&Yes, I trust the authors"
|
|
370
|
+
)), sublabel: isSingleFolderWorkspace ? ( localizeWithPath(
|
|
371
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
372
|
+
'trustFolderOptionDescription',
|
|
373
|
+
"Trust folder and enable all features"
|
|
374
|
+
)) : ( localizeWithPath(
|
|
375
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
376
|
+
'trustWorkspaceOptionDescription',
|
|
377
|
+
"Trust workspace and enable all features"
|
|
378
|
+
)) }, { label: dontTrustOption ?? ( localizeWithPath(
|
|
379
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
380
|
+
{ key: 'dontTrustOption', comment: ['&& denotes a mnemonic'] },
|
|
381
|
+
"&&No, I don't trust the authors"
|
|
382
|
+
)), sublabel: isSingleFolderWorkspace ? ( localizeWithPath(
|
|
383
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
384
|
+
'dontTrustFolderOptionDescription',
|
|
385
|
+
"Browse folder in restricted mode"
|
|
386
|
+
)) : ( localizeWithPath(
|
|
387
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
388
|
+
'dontTrustWorkspaceOptionDescription',
|
|
389
|
+
"Browse workspace in restricted mode"
|
|
390
|
+
)) }, [
|
|
280
391
|
!isSingleFolderWorkspace ?
|
|
281
|
-
localizeWithPath(
|
|
282
|
-
|
|
283
|
-
|
|
392
|
+
( localizeWithPath(
|
|
393
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
394
|
+
'workspaceStartupTrustDetails',
|
|
395
|
+
"{0} provides features that may automatically execute files in this workspace.",
|
|
396
|
+
this.productService.nameShort
|
|
397
|
+
)) :
|
|
398
|
+
( localizeWithPath(
|
|
399
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
400
|
+
'folderStartupTrustDetails',
|
|
401
|
+
"{0} provides features that may automatically execute files in this folder.",
|
|
402
|
+
this.productService.nameShort
|
|
403
|
+
)),
|
|
404
|
+
learnMoreString ?? ( localizeWithPath(
|
|
405
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
406
|
+
'startupTrustRequestLearnMore',
|
|
407
|
+
"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."
|
|
408
|
+
)),
|
|
284
409
|
!isEmptyWindow ?
|
|
285
410
|
`\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, { verbose: 2 })}\`` : '',
|
|
286
411
|
], checkboxText);
|
|
@@ -396,11 +521,19 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
396
521
|
}
|
|
397
522
|
const actions = [
|
|
398
523
|
{
|
|
399
|
-
label: localizeWithPath(
|
|
524
|
+
label: ( localizeWithPath(
|
|
525
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
526
|
+
'restrictedModeBannerManage',
|
|
527
|
+
"Manage"
|
|
528
|
+
)),
|
|
400
529
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
401
530
|
},
|
|
402
531
|
{
|
|
403
|
-
label: localizeWithPath(
|
|
532
|
+
label: ( localizeWithPath(
|
|
533
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
534
|
+
'restrictedModeBannerLearnMore',
|
|
535
|
+
"Learn More"
|
|
536
|
+
)),
|
|
404
537
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
405
538
|
}
|
|
406
539
|
];
|
|
@@ -420,21 +553,45 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
420
553
|
getBannerItemAriaLabels() {
|
|
421
554
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
422
555
|
case 1 :
|
|
423
|
-
return localizeWithPath(
|
|
556
|
+
return ( localizeWithPath(
|
|
557
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
558
|
+
'restrictedModeBannerAriaLabelWindow',
|
|
559
|
+
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
560
|
+
));
|
|
424
561
|
case 2 :
|
|
425
|
-
return localizeWithPath(
|
|
562
|
+
return ( localizeWithPath(
|
|
563
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
564
|
+
'restrictedModeBannerAriaLabelFolder',
|
|
565
|
+
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
566
|
+
));
|
|
426
567
|
case 3 :
|
|
427
|
-
return localizeWithPath(
|
|
568
|
+
return ( localizeWithPath(
|
|
569
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
570
|
+
'restrictedModeBannerAriaLabelWorkspace',
|
|
571
|
+
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
572
|
+
));
|
|
428
573
|
}
|
|
429
574
|
}
|
|
430
575
|
getBannerItemMessages() {
|
|
431
576
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
432
577
|
case 1 :
|
|
433
|
-
return localizeWithPath(
|
|
578
|
+
return ( localizeWithPath(
|
|
579
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
580
|
+
'restrictedModeBannerMessageWindow',
|
|
581
|
+
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
582
|
+
));
|
|
434
583
|
case 2 :
|
|
435
|
-
return localizeWithPath(
|
|
584
|
+
return ( localizeWithPath(
|
|
585
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
586
|
+
'restrictedModeBannerMessageFolder',
|
|
587
|
+
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
588
|
+
));
|
|
436
589
|
case 3 :
|
|
437
|
-
return localizeWithPath(
|
|
590
|
+
return ( localizeWithPath(
|
|
591
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
592
|
+
'restrictedModeBannerMessageWorkspace',
|
|
593
|
+
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
594
|
+
));
|
|
438
595
|
}
|
|
439
596
|
}
|
|
440
597
|
get bannerSetting() {
|
|
@@ -455,30 +612,72 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
455
612
|
let toolTip;
|
|
456
613
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
457
614
|
case 1 : {
|
|
458
|
-
ariaLabel = trusted ? localizeWithPath(
|
|
459
|
-
|
|
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
|
+
));
|
|
460
625
|
toolTip = trusted ? ariaLabel : {
|
|
461
|
-
value:
|
|
626
|
+
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}'] },
|
|
629
|
+
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
630
|
+
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
631
|
+
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
632
|
+
)),
|
|
462
633
|
isTrusted: true,
|
|
463
634
|
supportThemeIcons: true
|
|
464
635
|
};
|
|
465
636
|
break;
|
|
466
637
|
}
|
|
467
638
|
case 2 : {
|
|
468
|
-
ariaLabel = trusted ? localizeWithPath(
|
|
469
|
-
|
|
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
|
+
));
|
|
470
649
|
toolTip = trusted ? ariaLabel : {
|
|
471
|
-
value:
|
|
650
|
+
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}'] },
|
|
653
|
+
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
654
|
+
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
655
|
+
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
656
|
+
)),
|
|
472
657
|
isTrusted: true,
|
|
473
658
|
supportThemeIcons: true
|
|
474
659
|
};
|
|
475
660
|
break;
|
|
476
661
|
}
|
|
477
662
|
case 3 : {
|
|
478
|
-
ariaLabel = trusted ? localizeWithPath(
|
|
479
|
-
|
|
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
|
+
));
|
|
480
673
|
toolTip = trusted ? ariaLabel : {
|
|
481
|
-
value:
|
|
674
|
+
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}'] },
|
|
677
|
+
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
678
|
+
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
679
|
+
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
680
|
+
)),
|
|
482
681
|
isTrusted: true,
|
|
483
682
|
supportThemeIcons: true
|
|
484
683
|
};
|
|
@@ -486,7 +685,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
486
685
|
}
|
|
487
686
|
}
|
|
488
687
|
return {
|
|
489
|
-
name: localizeWithPath(
|
|
688
|
+
name: ( localizeWithPath(
|
|
689
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
690
|
+
'status.WorkspaceTrust',
|
|
691
|
+
"Workspace Trust"
|
|
692
|
+
)),
|
|
490
693
|
text: trusted ? `$(shield)` : `$(shield) ${text}`,
|
|
491
694
|
ariaLabel: ariaLabel,
|
|
492
695
|
tooltip: toolTip,
|
|
@@ -518,16 +721,28 @@ WorkspaceTrustUXHandler = ( __decorate([
|
|
|
518
721
|
], WorkspaceTrustUXHandler));
|
|
519
722
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustRequestHandler, 2 );
|
|
520
723
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustUXHandler, 3 );
|
|
521
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, localizeWithPath(
|
|
724
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localizeWithPath(
|
|
725
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
726
|
+
'workspaceTrustEditor',
|
|
727
|
+
"Workspace Trust Editor"
|
|
728
|
+
))), [
|
|
522
729
|
( new SyncDescriptor(WorkspaceTrustEditorInput))
|
|
523
730
|
]);
|
|
524
731
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
525
|
-
const WORKSPACES_CATEGORY = { value: localizeWithPath(
|
|
732
|
+
const WORKSPACES_CATEGORY = { value: ( localizeWithPath(
|
|
733
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
734
|
+
'workspacesCategory',
|
|
735
|
+
"Workspaces"
|
|
736
|
+
)), original: 'Workspaces' };
|
|
526
737
|
registerAction2(class extends Action2 {
|
|
527
738
|
constructor() {
|
|
528
739
|
super({
|
|
529
740
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
530
|
-
title: { original: 'Configure Workspace Trust Settings', value: localizeWithPath(
|
|
741
|
+
title: { original: 'Configure Workspace Trust Settings', value: ( localizeWithPath(
|
|
742
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
743
|
+
'configureWorkspaceTrustSettings',
|
|
744
|
+
"Configure Workspace Trust Settings"
|
|
745
|
+
)) },
|
|
531
746
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
532
747
|
category: WORKSPACES_CATEGORY,
|
|
533
748
|
f1: true
|
|
@@ -541,7 +756,11 @@ registerAction2(class extends Action2 {
|
|
|
541
756
|
constructor() {
|
|
542
757
|
super({
|
|
543
758
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
544
|
-
title: { original: 'Manage Workspace Trust', value: localizeWithPath(
|
|
759
|
+
title: { original: 'Manage Workspace Trust', value: ( localizeWithPath(
|
|
760
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
761
|
+
'manageWorkspaceTrust',
|
|
762
|
+
"Manage Workspace Trust"
|
|
763
|
+
)) },
|
|
545
764
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
546
765
|
category: WORKSPACES_CATEGORY,
|
|
547
766
|
f1: true,
|
|
@@ -562,53 +781,111 @@ registerAction2(class extends Action2 {
|
|
|
562
781
|
[WORKSPACE_TRUST_ENABLED]: {
|
|
563
782
|
type: 'boolean',
|
|
564
783
|
default: true,
|
|
565
|
-
description: localizeWithPath(
|
|
784
|
+
description: ( localizeWithPath(
|
|
785
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
786
|
+
'workspace.trust.description',
|
|
787
|
+
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
788
|
+
)),
|
|
566
789
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
567
790
|
scope: 1 ,
|
|
568
791
|
},
|
|
569
792
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
570
793
|
type: 'string',
|
|
571
794
|
default: 'once',
|
|
572
|
-
description: localizeWithPath(
|
|
795
|
+
description: ( localizeWithPath(
|
|
796
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
797
|
+
'workspace.trust.startupPrompt.description',
|
|
798
|
+
"Controls when the startup prompt to trust a workspace is shown."
|
|
799
|
+
)),
|
|
573
800
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
574
801
|
scope: 1 ,
|
|
575
802
|
enum: ['always', 'once', 'never'],
|
|
576
803
|
enumDescriptions: [
|
|
577
|
-
localizeWithPath(
|
|
578
|
-
|
|
579
|
-
|
|
804
|
+
( localizeWithPath(
|
|
805
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
806
|
+
'workspace.trust.startupPrompt.always',
|
|
807
|
+
"Ask for trust every time an untrusted workspace is opened."
|
|
808
|
+
)),
|
|
809
|
+
( localizeWithPath(
|
|
810
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
811
|
+
'workspace.trust.startupPrompt.once',
|
|
812
|
+
"Ask for trust the first time an untrusted workspace is opened."
|
|
813
|
+
)),
|
|
814
|
+
( localizeWithPath(
|
|
815
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
816
|
+
'workspace.trust.startupPrompt.never',
|
|
817
|
+
"Do not ask for trust when an untrusted workspace is opened."
|
|
818
|
+
)),
|
|
580
819
|
]
|
|
581
820
|
},
|
|
582
821
|
[WORKSPACE_TRUST_BANNER]: {
|
|
583
822
|
type: 'string',
|
|
584
823
|
default: 'untilDismissed',
|
|
585
|
-
description: localizeWithPath(
|
|
824
|
+
description: ( localizeWithPath(
|
|
825
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
826
|
+
'workspace.trust.banner.description',
|
|
827
|
+
"Controls when the restricted mode banner is shown."
|
|
828
|
+
)),
|
|
586
829
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
587
830
|
scope: 1 ,
|
|
588
831
|
enum: ['always', 'untilDismissed', 'never'],
|
|
589
832
|
enumDescriptions: [
|
|
590
|
-
localizeWithPath(
|
|
591
|
-
|
|
592
|
-
|
|
833
|
+
( localizeWithPath(
|
|
834
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
835
|
+
'workspace.trust.banner.always',
|
|
836
|
+
"Show the banner every time an untrusted workspace is open."
|
|
837
|
+
)),
|
|
838
|
+
( localizeWithPath(
|
|
839
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
840
|
+
'workspace.trust.banner.untilDismissed',
|
|
841
|
+
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
842
|
+
)),
|
|
843
|
+
( localizeWithPath(
|
|
844
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
845
|
+
'workspace.trust.banner.never',
|
|
846
|
+
"Do not show the banner when an untrusted workspace is open."
|
|
847
|
+
)),
|
|
593
848
|
]
|
|
594
849
|
},
|
|
595
850
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
596
851
|
type: 'string',
|
|
597
852
|
default: 'prompt',
|
|
598
|
-
markdownDescription: localizeWithPath(
|
|
853
|
+
markdownDescription: ( localizeWithPath(
|
|
854
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
855
|
+
'workspace.trust.untrustedFiles.description',
|
|
856
|
+
"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}#`.",
|
|
857
|
+
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
858
|
+
)),
|
|
599
859
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
600
860
|
scope: 1 ,
|
|
601
861
|
enum: ['prompt', 'open', 'newWindow'],
|
|
602
862
|
enumDescriptions: [
|
|
603
|
-
localizeWithPath(
|
|
604
|
-
|
|
605
|
-
|
|
863
|
+
( localizeWithPath(
|
|
864
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
865
|
+
'workspace.trust.untrustedFiles.prompt',
|
|
866
|
+
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
867
|
+
)),
|
|
868
|
+
( localizeWithPath(
|
|
869
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
870
|
+
'workspace.trust.untrustedFiles.open',
|
|
871
|
+
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
872
|
+
)),
|
|
873
|
+
( localizeWithPath(
|
|
874
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
875
|
+
'workspace.trust.untrustedFiles.newWindow',
|
|
876
|
+
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
877
|
+
)),
|
|
606
878
|
]
|
|
607
879
|
},
|
|
608
880
|
[WORKSPACE_TRUST_EMPTY_WINDOW]: {
|
|
609
881
|
type: 'boolean',
|
|
610
882
|
default: true,
|
|
611
|
-
markdownDescription: localizeWithPath(
|
|
883
|
+
markdownDescription: ( localizeWithPath(
|
|
884
|
+
'vs/workbench/contrib/workspace/browser/workspace.contribution',
|
|
885
|
+
'workspace.trust.emptyWindow.description',
|
|
886
|
+
"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.",
|
|
887
|
+
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
888
|
+
)),
|
|
612
889
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
613
890
|
scope: 1
|
|
614
891
|
}
|