@codingame/monaco-vscode-workspace-trust-service-override 7.1.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +87 -148
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +88 -129
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.js +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workspace-trust-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@8.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import './media/workspaceTrustEditor.css.js';
|
|
3
3
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
4
|
import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import {
|
|
5
|
+
import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
6
6
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
7
|
import { Extensions as Extensions$1, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
8
8
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
@@ -53,7 +53,6 @@ import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/commo
|
|
|
53
53
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
54
54
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
55
55
|
|
|
56
|
-
const _moduleId = "vs/workbench/contrib/workspace/browser/workspace.contribution";
|
|
57
56
|
const BANNER_RESTRICTED_MODE = 'workbench.banner.restrictedMode';
|
|
58
57
|
const STARTUP_PROMPT_SHOWN_KEY = 'workspace.trust.startupPrompt.shown';
|
|
59
58
|
const BANNER_RESTRICTED_MODE_DISMISSED_KEY = 'workbench.banner.restrictedMode.dismissed';
|
|
@@ -92,34 +91,31 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
92
91
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
93
92
|
const markdownDetails = [
|
|
94
93
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
95
|
-
(
|
|
96
|
-
|
|
97
|
-
0,
|
|
94
|
+
( localize(
|
|
95
|
+
2680,
|
|
98
96
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
99
97
|
)) :
|
|
100
|
-
(
|
|
101
|
-
|
|
102
|
-
1,
|
|
98
|
+
( localize(
|
|
99
|
+
2681,
|
|
103
100
|
"You are trying to open untrusted files in a window which is trusted."
|
|
104
101
|
)),
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
2,
|
|
102
|
+
( localize(
|
|
103
|
+
2682,
|
|
108
104
|
"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."
|
|
109
105
|
))
|
|
110
106
|
];
|
|
111
107
|
await this.dialogService.prompt({
|
|
112
108
|
type: Severity$1.Info,
|
|
113
109
|
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
114
|
-
(
|
|
115
|
-
(
|
|
110
|
+
( localize(2683, "Do you want to allow untrusted files in this workspace?")) :
|
|
111
|
+
( localize(2684, "Do you want to allow untrusted files in this window?")),
|
|
116
112
|
buttons: [
|
|
117
113
|
{
|
|
118
|
-
label: (
|
|
114
|
+
label: ( localize(2685, "&&Open")),
|
|
119
115
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
120
116
|
},
|
|
121
117
|
{
|
|
122
|
-
label: (
|
|
118
|
+
label: ( localize(2686, "Open in &&Restricted Mode")),
|
|
123
119
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.OpenInNewWindow, !!checkboxChecked)
|
|
124
120
|
}
|
|
125
121
|
],
|
|
@@ -127,7 +123,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
127
123
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
128
124
|
},
|
|
129
125
|
checkbox: {
|
|
130
|
-
label: (
|
|
126
|
+
label: ( localize(2687, "Remember my decision for all workspaces")),
|
|
131
127
|
checked: false
|
|
132
128
|
},
|
|
133
129
|
custom: {
|
|
@@ -139,20 +135,19 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
139
135
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
140
136
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
141
137
|
const message = this.useWorkspaceLanguage ?
|
|
142
|
-
(
|
|
143
|
-
(
|
|
144
|
-
const defaultDetails = (
|
|
145
|
-
|
|
146
|
-
10,
|
|
138
|
+
( localize(2688, "Do you trust the authors of the files in this workspace?")) :
|
|
139
|
+
( localize(2689, "Do you trust the authors of the files in this folder?"));
|
|
140
|
+
const defaultDetails = ( localize(
|
|
141
|
+
2690,
|
|
147
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."
|
|
148
143
|
));
|
|
149
144
|
const details = requestOptions?.message ?? defaultDetails;
|
|
150
145
|
const buttons = requestOptions?.buttons ?? [
|
|
151
|
-
{ label: this.useWorkspaceLanguage ? (
|
|
152
|
-
{ label: (
|
|
146
|
+
{ label: this.useWorkspaceLanguage ? ( localize(2691, "&&Trust Workspace & Continue")) : ( localize(2692, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
|
|
147
|
+
{ label: ( localize(2693, "&&Manage")), type: 'Manage' }
|
|
153
148
|
];
|
|
154
149
|
if (!( (buttons.some(b => b.type === 'Cancel')))) {
|
|
155
|
-
buttons.push({ label: (
|
|
150
|
+
buttons.push({ label: ( localize(2694, "Cancel")), type: 'Cancel' });
|
|
156
151
|
}
|
|
157
152
|
const { result } = await this.dialogService.prompt({
|
|
158
153
|
type: Severity$1.Info,
|
|
@@ -161,9 +156,8 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
161
156
|
icon: Codicon.shield,
|
|
162
157
|
markdownDetails: [
|
|
163
158
|
{ markdown: ( (new MarkdownString(details))) },
|
|
164
|
-
{ markdown: ( (new MarkdownString((
|
|
165
|
-
|
|
166
|
-
15,
|
|
159
|
+
{ markdown: ( (new MarkdownString(( localize(
|
|
160
|
+
2695,
|
|
167
161
|
"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."
|
|
168
162
|
))))) }
|
|
169
163
|
]
|
|
@@ -264,13 +258,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
264
258
|
if (!( (addedFoldersTrustInfo.map(info => info.trusted))).every(trusted => trusted)) {
|
|
265
259
|
const { confirmed } = await this.dialogService.confirm({
|
|
266
260
|
type: Severity$1.Info,
|
|
267
|
-
message: (
|
|
268
|
-
detail: (
|
|
269
|
-
|
|
270
|
-
17,
|
|
261
|
+
message: ( localize(2696, "Do you trust the authors of the files in this folder?")),
|
|
262
|
+
detail: ( localize(
|
|
263
|
+
2697,
|
|
271
264
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
272
265
|
)),
|
|
273
|
-
cancelButton: (
|
|
266
|
+
cancelButton: ( localize(2698, 'No')),
|
|
274
267
|
custom: { icon: Codicon.shield }
|
|
275
268
|
});
|
|
276
269
|
await this.workspaceTrustManagementService.setUrisTrust(( (addedFoldersTrustInfo.map(i => i.uri))), confirmed);
|
|
@@ -298,38 +291,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
298
291
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
299
292
|
}
|
|
300
293
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
301
|
-
(
|
|
302
|
-
(
|
|
294
|
+
( localize(2698, "Do you trust the authors of the files in this workspace?")) :
|
|
295
|
+
( localize(2698, "Do you trust the authors of the files in this folder?")));
|
|
303
296
|
let checkboxText;
|
|
304
297
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
305
298
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
306
299
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
307
300
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
308
301
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
309
|
-
checkboxText = (
|
|
310
|
-
_moduleId,
|
|
311
|
-
19,
|
|
312
|
-
"Trust the authors of all files in the parent folder '{0}'",
|
|
313
|
-
name
|
|
314
|
-
));
|
|
302
|
+
checkboxText = ( localize(2699, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
315
303
|
}
|
|
316
|
-
this.doShowModal(title, { label: trustOption ?? (
|
|
304
|
+
this.doShowModal(title, { label: trustOption ?? ( localize(2700, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(2701, "Trust folder and enable all features")) : ( localize(2702, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localize(2703, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(2704, "Browse folder in restricted mode")) : ( localize(2705, "Browse workspace in restricted mode")) }, [
|
|
317
305
|
!isSingleFolderWorkspace ?
|
|
318
|
-
(
|
|
319
|
-
|
|
320
|
-
26,
|
|
306
|
+
( localize(
|
|
307
|
+
2706,
|
|
321
308
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
322
309
|
this.productService.nameShort
|
|
323
310
|
)) :
|
|
324
|
-
(
|
|
325
|
-
|
|
326
|
-
27,
|
|
311
|
+
( localize(
|
|
312
|
+
2707,
|
|
327
313
|
"{0} provides features that may automatically execute files in this folder.",
|
|
328
314
|
this.productService.nameShort
|
|
329
315
|
)),
|
|
330
|
-
learnMoreString ?? (
|
|
331
|
-
|
|
332
|
-
28,
|
|
316
|
+
learnMoreString ?? ( localize(
|
|
317
|
+
2708,
|
|
333
318
|
"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."
|
|
334
319
|
)),
|
|
335
320
|
!isEmptyWindow ?
|
|
@@ -447,11 +432,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
447
432
|
}
|
|
448
433
|
const actions = [
|
|
449
434
|
{
|
|
450
|
-
label: (
|
|
435
|
+
label: ( localize(2709, "Manage")),
|
|
451
436
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
452
437
|
},
|
|
453
438
|
{
|
|
454
|
-
label: (
|
|
439
|
+
label: ( localize(2710, "Learn More")),
|
|
455
440
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
456
441
|
}
|
|
457
442
|
];
|
|
@@ -471,21 +456,18 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
471
456
|
getBannerItemAriaLabels() {
|
|
472
457
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
473
458
|
case WorkbenchState.EMPTY:
|
|
474
|
-
return (
|
|
475
|
-
|
|
476
|
-
31,
|
|
459
|
+
return ( localize(
|
|
460
|
+
2711,
|
|
477
461
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
478
462
|
));
|
|
479
463
|
case WorkbenchState.FOLDER:
|
|
480
|
-
return (
|
|
481
|
-
|
|
482
|
-
32,
|
|
464
|
+
return ( localize(
|
|
465
|
+
2712,
|
|
483
466
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
484
467
|
));
|
|
485
468
|
case WorkbenchState.WORKSPACE:
|
|
486
|
-
return (
|
|
487
|
-
|
|
488
|
-
33,
|
|
469
|
+
return ( localize(
|
|
470
|
+
2713,
|
|
489
471
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
490
472
|
));
|
|
491
473
|
}
|
|
@@ -493,21 +475,18 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
493
475
|
getBannerItemMessages() {
|
|
494
476
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
495
477
|
case WorkbenchState.EMPTY:
|
|
496
|
-
return (
|
|
497
|
-
|
|
498
|
-
34,
|
|
478
|
+
return ( localize(
|
|
479
|
+
2714,
|
|
499
480
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
500
481
|
));
|
|
501
482
|
case WorkbenchState.FOLDER:
|
|
502
|
-
return (
|
|
503
|
-
|
|
504
|
-
35,
|
|
483
|
+
return ( localize(
|
|
484
|
+
2715,
|
|
505
485
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
506
486
|
));
|
|
507
487
|
case WorkbenchState.WORKSPACE:
|
|
508
|
-
return (
|
|
509
|
-
|
|
510
|
-
36,
|
|
488
|
+
return ( localize(
|
|
489
|
+
2716,
|
|
511
490
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
512
491
|
));
|
|
513
492
|
}
|
|
@@ -524,15 +503,13 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
524
503
|
let toolTip;
|
|
525
504
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
526
505
|
case WorkbenchState.EMPTY: {
|
|
527
|
-
ariaLabel = (
|
|
528
|
-
|
|
529
|
-
37,
|
|
506
|
+
ariaLabel = ( localize(
|
|
507
|
+
2717,
|
|
530
508
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
531
509
|
));
|
|
532
510
|
toolTip = {
|
|
533
|
-
value: (
|
|
534
|
-
|
|
535
|
-
38,
|
|
511
|
+
value: ( localize(
|
|
512
|
+
2718,
|
|
536
513
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
537
514
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
538
515
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -543,15 +520,13 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
543
520
|
break;
|
|
544
521
|
}
|
|
545
522
|
case WorkbenchState.FOLDER: {
|
|
546
|
-
ariaLabel = (
|
|
547
|
-
|
|
548
|
-
39,
|
|
523
|
+
ariaLabel = ( localize(
|
|
524
|
+
2719,
|
|
549
525
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
550
526
|
));
|
|
551
527
|
toolTip = {
|
|
552
|
-
value: (
|
|
553
|
-
|
|
554
|
-
40,
|
|
528
|
+
value: ( localize(
|
|
529
|
+
2720,
|
|
555
530
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
556
531
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
557
532
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -562,15 +537,13 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
562
537
|
break;
|
|
563
538
|
}
|
|
564
539
|
case WorkbenchState.WORKSPACE: {
|
|
565
|
-
ariaLabel = (
|
|
566
|
-
|
|
567
|
-
41,
|
|
540
|
+
ariaLabel = ( localize(
|
|
541
|
+
2721,
|
|
568
542
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
569
543
|
));
|
|
570
544
|
toolTip = {
|
|
571
|
-
value: (
|
|
572
|
-
|
|
573
|
-
42,
|
|
545
|
+
value: ( localize(
|
|
546
|
+
2722,
|
|
574
547
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
575
548
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
576
549
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -582,8 +555,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
582
555
|
}
|
|
583
556
|
}
|
|
584
557
|
return {
|
|
585
|
-
name: (
|
|
586
|
-
text: `$(shield) ${(
|
|
558
|
+
name: ( localize(2723, "Workspace Trust")),
|
|
559
|
+
text: `$(shield) ${( localize(2724, "Restricted Mode"))}`,
|
|
587
560
|
ariaLabel: ariaLabel,
|
|
588
561
|
tooltip: toolTip,
|
|
589
562
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -633,16 +606,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
633
606
|
}
|
|
634
607
|
( (Registry.as(EditorExtensions.EditorFactory)))
|
|
635
608
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
636
|
-
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, (
|
|
609
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(2725, "Workspace Trust Editor"))), [
|
|
637
610
|
( (new SyncDescriptor(WorkspaceTrustEditorInput)))
|
|
638
611
|
]);
|
|
639
612
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
640
|
-
const WORKSPACES_CATEGORY = (
|
|
613
|
+
const WORKSPACES_CATEGORY = ( localize2(2726, 'Workspaces'));
|
|
641
614
|
registerAction2(class extends Action2 {
|
|
642
615
|
constructor() {
|
|
643
616
|
super({
|
|
644
617
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
645
|
-
title: (
|
|
618
|
+
title: ( localize2(2727, "Configure Workspace Trust Settings")),
|
|
646
619
|
precondition: ( (ContextKeyExpr.and(
|
|
647
620
|
WorkspaceTrustContext.IsEnabled,
|
|
648
621
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -659,7 +632,7 @@ registerAction2(class extends Action2 {
|
|
|
659
632
|
constructor() {
|
|
660
633
|
super({
|
|
661
634
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
662
|
-
title: (
|
|
635
|
+
title: ( localize2(2728, "Manage Workspace Trust")),
|
|
663
636
|
precondition: ( (ContextKeyExpr.and(
|
|
664
637
|
WorkspaceTrustContext.IsEnabled,
|
|
665
638
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -683,74 +656,44 @@ registerAction2(class extends Action2 {
|
|
|
683
656
|
[WORKSPACE_TRUST_ENABLED]: {
|
|
684
657
|
type: 'boolean',
|
|
685
658
|
default: true,
|
|
686
|
-
description: (
|
|
687
|
-
_moduleId,
|
|
688
|
-
49,
|
|
689
|
-
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
690
|
-
)),
|
|
659
|
+
description: ( localize(2729, "Controls whether or not Workspace Trust is enabled within VS Code.")),
|
|
691
660
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
692
661
|
scope: ConfigurationScope.APPLICATION,
|
|
693
662
|
},
|
|
694
663
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
695
664
|
type: 'string',
|
|
696
665
|
default: 'once',
|
|
697
|
-
description: (
|
|
698
|
-
_moduleId,
|
|
699
|
-
50,
|
|
700
|
-
"Controls when the startup prompt to trust a workspace is shown."
|
|
701
|
-
)),
|
|
666
|
+
description: ( localize(2730, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
702
667
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
703
668
|
scope: ConfigurationScope.APPLICATION,
|
|
704
669
|
enum: ['always', 'once', 'never'],
|
|
705
670
|
enumDescriptions: [
|
|
706
|
-
(
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
"Ask for trust every time an untrusted workspace is opened."
|
|
710
|
-
)),
|
|
711
|
-
( localizeWithPath(
|
|
712
|
-
_moduleId,
|
|
713
|
-
52,
|
|
714
|
-
"Ask for trust the first time an untrusted workspace is opened."
|
|
715
|
-
)),
|
|
716
|
-
( localizeWithPath(
|
|
717
|
-
_moduleId,
|
|
718
|
-
53,
|
|
719
|
-
"Do not ask for trust when an untrusted workspace is opened."
|
|
720
|
-
)),
|
|
671
|
+
( localize(2731, "Ask for trust every time an untrusted workspace is opened.")),
|
|
672
|
+
( localize(2732, "Ask for trust the first time an untrusted workspace is opened.")),
|
|
673
|
+
( localize(2733, "Do not ask for trust when an untrusted workspace is opened.")),
|
|
721
674
|
]
|
|
722
675
|
},
|
|
723
676
|
[WORKSPACE_TRUST_BANNER]: {
|
|
724
677
|
type: 'string',
|
|
725
678
|
default: 'untilDismissed',
|
|
726
|
-
description: (
|
|
679
|
+
description: ( localize(2734, "Controls when the restricted mode banner is shown.")),
|
|
727
680
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
728
681
|
scope: ConfigurationScope.APPLICATION,
|
|
729
682
|
enum: ['always', 'untilDismissed', 'never'],
|
|
730
683
|
enumDescriptions: [
|
|
731
|
-
(
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
"Show the banner every time an untrusted workspace is open."
|
|
735
|
-
)),
|
|
736
|
-
( localizeWithPath(
|
|
737
|
-
_moduleId,
|
|
738
|
-
56,
|
|
684
|
+
( localize(2735, "Show the banner every time an untrusted workspace is open.")),
|
|
685
|
+
( localize(
|
|
686
|
+
2736,
|
|
739
687
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
740
688
|
)),
|
|
741
|
-
(
|
|
742
|
-
_moduleId,
|
|
743
|
-
57,
|
|
744
|
-
"Do not show the banner when an untrusted workspace is open."
|
|
745
|
-
)),
|
|
689
|
+
( localize(2737, "Do not show the banner when an untrusted workspace is open.")),
|
|
746
690
|
]
|
|
747
691
|
},
|
|
748
692
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
749
693
|
type: 'string',
|
|
750
694
|
default: 'prompt',
|
|
751
|
-
markdownDescription: (
|
|
752
|
-
|
|
753
|
-
58,
|
|
695
|
+
markdownDescription: ( localize(
|
|
696
|
+
2738,
|
|
754
697
|
"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}#`.",
|
|
755
698
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
756
699
|
)),
|
|
@@ -758,19 +701,16 @@ registerAction2(class extends Action2 {
|
|
|
758
701
|
scope: ConfigurationScope.APPLICATION,
|
|
759
702
|
enum: ['prompt', 'open', 'newWindow'],
|
|
760
703
|
enumDescriptions: [
|
|
761
|
-
(
|
|
762
|
-
|
|
763
|
-
59,
|
|
704
|
+
( localize(
|
|
705
|
+
2739,
|
|
764
706
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
765
707
|
)),
|
|
766
|
-
(
|
|
767
|
-
|
|
768
|
-
60,
|
|
708
|
+
( localize(
|
|
709
|
+
2740,
|
|
769
710
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
770
711
|
)),
|
|
771
|
-
(
|
|
772
|
-
|
|
773
|
-
61,
|
|
712
|
+
( localize(
|
|
713
|
+
2741,
|
|
774
714
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
775
715
|
)),
|
|
776
716
|
]
|
|
@@ -778,9 +718,8 @@ registerAction2(class extends Action2 {
|
|
|
778
718
|
[WORKSPACE_TRUST_EMPTY_WINDOW]: {
|
|
779
719
|
type: 'boolean',
|
|
780
720
|
default: true,
|
|
781
|
-
markdownDescription: (
|
|
782
|
-
|
|
783
|
-
62,
|
|
721
|
+
markdownDescription: ( localize(
|
|
722
|
+
2742,
|
|
784
723
|
"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.",
|
|
785
724
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
786
725
|
)),
|
|
@@ -15,7 +15,7 @@ import { parseLinkedText } from 'vscode/vscode/vs/base/common/linkedText';
|
|
|
15
15
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
16
16
|
import { ScrollbarVisibility } from 'vscode/vscode/vs/base/common/scrollable';
|
|
17
17
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
18
|
-
import {
|
|
18
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
19
19
|
import { Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
20
20
|
import { IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
21
21
|
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
@@ -64,25 +64,12 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
|
|
|
64
64
|
import { basename, dirname } from 'vscode/vscode/vs/base/common/resources';
|
|
65
65
|
|
|
66
66
|
var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
3,
|
|
74
|
-
'Icon for the pick folder icon in the workspace trust editor.'
|
|
75
|
-
)));
|
|
76
|
-
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localizeWithPath(
|
|
77
|
-
_moduleId,
|
|
78
|
-
4,
|
|
79
|
-
'Icon for the edit folder icon in the workspace trust editor.'
|
|
80
|
-
)));
|
|
81
|
-
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localizeWithPath(
|
|
82
|
-
_moduleId,
|
|
83
|
-
5,
|
|
84
|
-
'Icon for the remove folder icon in the workspace trust editor.'
|
|
85
|
-
)));
|
|
67
|
+
const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, ( localize(7320, 'Icon for workspace trust ion the banner.')));
|
|
68
|
+
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localize(7321, 'Icon for the checkmark in the workspace trust editor.')));
|
|
69
|
+
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localize(7322, 'Icon for the cross in the workspace trust editor.')));
|
|
70
|
+
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localize(7323, 'Icon for the pick folder icon in the workspace trust editor.')));
|
|
71
|
+
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize(7324, 'Icon for the edit folder icon in the workspace trust editor.')));
|
|
72
|
+
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(7325, 'Icon for the remove folder icon in the workspace trust editor.')));
|
|
86
73
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
87
74
|
constructor(container, instantiationService, workspaceService, workspaceTrustManagementService, uriService, labelService, fileDialogService) {
|
|
88
75
|
super();
|
|
@@ -106,14 +93,14 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
106
93
|
const addButtonBarElement = container.appendChild($('.trusted-uris-button-bar'));
|
|
107
94
|
this.table = this.instantiationService.createInstance(WorkbenchTable, 'WorkspaceTrust', tableElement, ( (new TrustedUriTableVirtualDelegate())), [
|
|
108
95
|
{
|
|
109
|
-
label: (
|
|
96
|
+
label: ( localize(7326, "Host")),
|
|
110
97
|
tooltip: '',
|
|
111
98
|
weight: 1,
|
|
112
99
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
113
100
|
project(row) { return row; }
|
|
114
101
|
},
|
|
115
102
|
{
|
|
116
|
-
label: (
|
|
103
|
+
label: ( localize(7327, "Path")),
|
|
117
104
|
tooltip: '',
|
|
118
105
|
weight: 8,
|
|
119
106
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -141,17 +128,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
141
128
|
getAriaLabel: (item) => {
|
|
142
129
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
143
130
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
144
|
-
return (
|
|
131
|
+
return ( localize(7328, "{0}, trusted", this.labelService.getUriLabel(item.uri)));
|
|
145
132
|
}
|
|
146
|
-
return (
|
|
147
|
-
|
|
148
|
-
9,
|
|
133
|
+
return ( localize(
|
|
134
|
+
7329,
|
|
149
135
|
"{0} on {1}, trusted",
|
|
150
136
|
this.labelService.getUriLabel(item.uri),
|
|
151
137
|
hostLabel
|
|
152
138
|
));
|
|
153
139
|
},
|
|
154
|
-
getWidgetAriaLabel: () => (
|
|
140
|
+
getWidgetAriaLabel: () => ( localize(7330, "Trusted Folders & Workspaces"))
|
|
155
141
|
},
|
|
156
142
|
identityProvider: {
|
|
157
143
|
getId(element) {
|
|
@@ -167,16 +153,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
167
153
|
}
|
|
168
154
|
}));
|
|
169
155
|
const buttonBar = this._register(( (new ButtonBar(addButtonBarElement))));
|
|
170
|
-
const addButton = this._register(buttonBar.addButton({ title: (
|
|
171
|
-
addButton.label = (
|
|
156
|
+
const addButton = this._register(buttonBar.addButton({ title: ( localize(7331, "Add Folder")), ...defaultButtonStyles }));
|
|
157
|
+
addButton.label = ( localize(7331, "Add Folder"));
|
|
172
158
|
this._register(addButton.onDidClick(async () => {
|
|
173
159
|
const uri = await this.fileDialogService.showOpenDialog({
|
|
174
160
|
canSelectFiles: false,
|
|
175
161
|
canSelectFolders: true,
|
|
176
162
|
canSelectMany: false,
|
|
177
163
|
defaultUri: this.currentWorkspaceUri,
|
|
178
|
-
openLabel: (
|
|
179
|
-
title: (
|
|
164
|
+
openLabel: ( localize(7332, "Trust Folder")),
|
|
165
|
+
title: ( localize(7333, "Select Folder To Trust"))
|
|
180
166
|
});
|
|
181
167
|
if (uri) {
|
|
182
168
|
this.workspaceTrustManagementService.setUrisTrust(uri, true);
|
|
@@ -256,12 +242,11 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
256
242
|
const entries = this.trustedUriEntries;
|
|
257
243
|
this.container.classList.toggle('empty', entries.length === 0);
|
|
258
244
|
this.descriptionElement.innerText = entries.length ?
|
|
259
|
-
(
|
|
260
|
-
|
|
261
|
-
14,
|
|
245
|
+
( localize(
|
|
246
|
+
7334,
|
|
262
247
|
"You trust the following folders, their subfolders, and workspace files."
|
|
263
248
|
)) :
|
|
264
|
-
(
|
|
249
|
+
( localize(7335, "You haven't trusted any folders or workspace files yet."));
|
|
265
250
|
this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
|
|
266
251
|
this.layout();
|
|
267
252
|
}
|
|
@@ -274,9 +259,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
274
259
|
if (segments.length === 0 && path.startsWith(posix.sep)) {
|
|
275
260
|
return {
|
|
276
261
|
type: MessageType.WARNING,
|
|
277
|
-
content: (
|
|
278
|
-
|
|
279
|
-
16,
|
|
262
|
+
content: ( localize(
|
|
263
|
+
7336,
|
|
280
264
|
"You will trust all repositories on {0}.",
|
|
281
265
|
getHostLabel(this.labelService, item)
|
|
282
266
|
))
|
|
@@ -285,9 +269,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
285
269
|
if (segments.length === 1) {
|
|
286
270
|
return {
|
|
287
271
|
type: MessageType.WARNING,
|
|
288
|
-
content: (
|
|
289
|
-
|
|
290
|
-
17,
|
|
272
|
+
content: ( localize(
|
|
273
|
+
7337,
|
|
291
274
|
"You will trust all repositories and forks under '{0}' on {1}.",
|
|
292
275
|
segments[0],
|
|
293
276
|
getHostLabel(this.labelService, item)
|
|
@@ -297,12 +280,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
297
280
|
if (segments.length > 2) {
|
|
298
281
|
return {
|
|
299
282
|
type: MessageType.ERROR,
|
|
300
|
-
content: (
|
|
301
|
-
_moduleId,
|
|
302
|
-
18,
|
|
303
|
-
"You cannot trust individual folders within a repository.",
|
|
304
|
-
path
|
|
305
|
-
))
|
|
283
|
+
content: ( localize(7338, "You cannot trust individual folders within a repository.", path))
|
|
306
284
|
};
|
|
307
285
|
}
|
|
308
286
|
}
|
|
@@ -343,8 +321,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
343
321
|
canSelectFolders: true,
|
|
344
322
|
canSelectMany: false,
|
|
345
323
|
defaultUri: item.uri,
|
|
346
|
-
openLabel: (
|
|
347
|
-
title: (
|
|
324
|
+
openLabel: ( localize(7338, "Trust Folder")),
|
|
325
|
+
title: ( localize(7338, "Select Folder To Trust"))
|
|
348
326
|
});
|
|
349
327
|
if (uri) {
|
|
350
328
|
this.acceptEdit(item, uri[0]);
|
|
@@ -411,7 +389,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
411
389
|
class: ThemeIcon.asClassName(editIcon),
|
|
412
390
|
enabled: true,
|
|
413
391
|
id: 'editTrustedUri',
|
|
414
|
-
tooltip: (
|
|
392
|
+
tooltip: ( localize(7339, "Edit Path")),
|
|
415
393
|
run: () => {
|
|
416
394
|
this.table.edit(item, false);
|
|
417
395
|
}
|
|
@@ -423,7 +401,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
423
401
|
class: ThemeIcon.asClassName(folderPickerIcon),
|
|
424
402
|
enabled: true,
|
|
425
403
|
id: 'pickerTrustedUri',
|
|
426
|
-
tooltip: (
|
|
404
|
+
tooltip: ( localize(7340, "Open File Picker")),
|
|
427
405
|
run: () => {
|
|
428
406
|
this.table.edit(item, true);
|
|
429
407
|
}
|
|
@@ -435,7 +413,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
435
413
|
class: ThemeIcon.asClassName(removeIcon),
|
|
436
414
|
enabled: true,
|
|
437
415
|
id: 'deleteTrustedUri',
|
|
438
|
-
tooltip: (
|
|
416
|
+
tooltip: ( localize(7341, "Delete Path")),
|
|
439
417
|
run: async () => {
|
|
440
418
|
await this.table.delete(item);
|
|
441
419
|
}
|
|
@@ -552,7 +530,7 @@ TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( (__decorate([
|
|
|
552
530
|
( (__param(1, IContextViewService)))
|
|
553
531
|
], TrustedUriPathColumnRenderer)));
|
|
554
532
|
function getHostLabel(labelService, item) {
|
|
555
|
-
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : (
|
|
533
|
+
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(7342, "Local"));
|
|
556
534
|
}
|
|
557
535
|
let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
|
|
558
536
|
static { TrustedUriHostColumnRenderer_1 = this; }
|
|
@@ -685,18 +663,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
685
663
|
getHeaderTitleText(trusted) {
|
|
686
664
|
if (trusted) {
|
|
687
665
|
if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
688
|
-
return (
|
|
666
|
+
return ( localize(7343, "This window is trusted"));
|
|
689
667
|
}
|
|
690
668
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
691
669
|
case WorkbenchState.EMPTY:
|
|
692
|
-
return (
|
|
670
|
+
return ( localize(7344, "You trust this window"));
|
|
693
671
|
case WorkbenchState.FOLDER:
|
|
694
|
-
return (
|
|
672
|
+
return ( localize(7345, "You trust this folder"));
|
|
695
673
|
case WorkbenchState.WORKSPACE:
|
|
696
|
-
return (
|
|
674
|
+
return ( localize(7346, "You trust this workspace"));
|
|
697
675
|
}
|
|
698
676
|
}
|
|
699
|
-
return (
|
|
677
|
+
return ( localize(7347, "You are in Restricted Mode"));
|
|
700
678
|
}
|
|
701
679
|
getHeaderTitleIconClassNames(trusted) {
|
|
702
680
|
return ThemeIcon.asClassNameArray(shieldIcon);
|
|
@@ -706,43 +684,37 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
706
684
|
let subTitle = '';
|
|
707
685
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
708
686
|
case WorkbenchState.EMPTY: {
|
|
709
|
-
title = trusted ? (
|
|
710
|
-
subTitle = trusted ? (
|
|
711
|
-
|
|
712
|
-
30,
|
|
687
|
+
title = trusted ? ( localize(7348, "In a Trusted Window")) : ( localize(7349, "In Restricted Mode"));
|
|
688
|
+
subTitle = trusted ? ( localize(
|
|
689
|
+
7350,
|
|
713
690
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
714
691
|
)) :
|
|
715
|
-
(
|
|
716
|
-
|
|
717
|
-
31,
|
|
692
|
+
( localize(
|
|
693
|
+
7351,
|
|
718
694
|
"You do not trust the authors of the files in the current window. The following features are disabled:"
|
|
719
695
|
));
|
|
720
696
|
break;
|
|
721
697
|
}
|
|
722
698
|
case WorkbenchState.FOLDER: {
|
|
723
|
-
title = trusted ? (
|
|
724
|
-
subTitle = trusted ? (
|
|
725
|
-
|
|
726
|
-
33,
|
|
699
|
+
title = trusted ? ( localize(7352, "In a Trusted Folder")) : ( localize(7352, "In Restricted Mode"));
|
|
700
|
+
subTitle = trusted ? ( localize(
|
|
701
|
+
7353,
|
|
727
702
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
728
703
|
)) :
|
|
729
|
-
(
|
|
730
|
-
|
|
731
|
-
34,
|
|
704
|
+
( localize(
|
|
705
|
+
7354,
|
|
732
706
|
"You do not trust the authors of the files in the current folder. The following features are disabled:"
|
|
733
707
|
));
|
|
734
708
|
break;
|
|
735
709
|
}
|
|
736
710
|
case WorkbenchState.WORKSPACE: {
|
|
737
|
-
title = trusted ? (
|
|
738
|
-
subTitle = trusted ? (
|
|
739
|
-
|
|
740
|
-
36,
|
|
711
|
+
title = trusted ? ( localize(7355, "In a Trusted Workspace")) : ( localize(7355, "In Restricted Mode"));
|
|
712
|
+
subTitle = trusted ? ( localize(
|
|
713
|
+
7356,
|
|
741
714
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
742
715
|
)) :
|
|
743
|
-
(
|
|
744
|
-
|
|
745
|
-
37,
|
|
716
|
+
( localize(
|
|
717
|
+
7357,
|
|
746
718
|
"You do not trust the authors of the files in the current workspace. The following features are disabled:"
|
|
747
719
|
));
|
|
748
720
|
break;
|
|
@@ -765,21 +737,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
765
737
|
this.headerDescription.innerText = '';
|
|
766
738
|
const headerDescriptionText = append(this.headerDescription, $('div'));
|
|
767
739
|
headerDescriptionText.innerText = isWorkspaceTrusted ?
|
|
768
|
-
(
|
|
769
|
-
|
|
770
|
-
38,
|
|
740
|
+
( localize(
|
|
741
|
+
7358,
|
|
771
742
|
"All features are enabled because trust has been granted to the workspace."
|
|
772
743
|
)) :
|
|
773
|
-
(
|
|
774
|
-
|
|
775
|
-
39,
|
|
744
|
+
( localize(
|
|
745
|
+
7359,
|
|
776
746
|
"{0} is in a restricted mode intended for safe code browsing.",
|
|
777
747
|
this.productService.nameShort
|
|
778
748
|
));
|
|
779
749
|
const headerDescriptionActions = append(this.headerDescription, $('div'));
|
|
780
|
-
const headerDescriptionActionsText = (
|
|
781
|
-
|
|
782
|
-
40,
|
|
750
|
+
const headerDescriptionActionsText = ( localize(
|
|
751
|
+
7360,
|
|
783
752
|
"[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
|
|
784
753
|
`command:workbench.trust.configure`
|
|
785
754
|
));
|
|
@@ -792,7 +761,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
792
761
|
}
|
|
793
762
|
}
|
|
794
763
|
this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
|
|
795
|
-
this.rootElement.setAttribute('aria-label', `${(
|
|
764
|
+
this.rootElement.setAttribute('aria-label', `${( localize(7361, "Manage Workspace Trust"))}: ${this.headerContainer.innerText}`);
|
|
796
765
|
const restrictedSettings = this.configurationService.restrictedSettings;
|
|
797
766
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
798
767
|
const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
|
|
@@ -857,7 +826,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
857
826
|
createConfigurationElement(parent) {
|
|
858
827
|
this.configurationContainer = append(parent, $('.workspace-trust-settings', { tabIndex: '0' }));
|
|
859
828
|
const configurationTitle = append(this.configurationContainer, $('.workspace-trusted-folders-title'));
|
|
860
|
-
configurationTitle.innerText = (
|
|
829
|
+
configurationTitle.innerText = ( localize(7361, "Trusted Folders & Workspaces"));
|
|
861
830
|
this.workspaceTrustedUrisTable = this._register(this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer));
|
|
862
831
|
}
|
|
863
832
|
createAffectedFeaturesElement(parent) {
|
|
@@ -872,44 +841,41 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
872
841
|
this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
|
|
873
842
|
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ?
|
|
874
843
|
[
|
|
875
|
-
(
|
|
876
|
-
(
|
|
877
|
-
(
|
|
844
|
+
( localize(7362, "Tasks are allowed to run")),
|
|
845
|
+
( localize(7363, "Debugging is enabled")),
|
|
846
|
+
( localize(7364, "All enabled extensions are activated"))
|
|
878
847
|
] :
|
|
879
848
|
[
|
|
880
|
-
(
|
|
881
|
-
(
|
|
882
|
-
(
|
|
883
|
-
(
|
|
849
|
+
( localize(7364, "Tasks are allowed to run")),
|
|
850
|
+
( localize(7364, "Debugging is enabled")),
|
|
851
|
+
( localize(7365, "All workspace settings are applied")),
|
|
852
|
+
( localize(7365, "All enabled extensions are activated"))
|
|
884
853
|
];
|
|
885
854
|
this.renderLimitationsListElement(this.trustedContainer, trustedContainerItems, ThemeIcon.asClassNameArray(checkListIcon));
|
|
886
855
|
const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
|
|
887
856
|
this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
|
|
888
857
|
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ?
|
|
889
858
|
[
|
|
890
|
-
(
|
|
891
|
-
(
|
|
892
|
-
fixBadLocalizedLinks((
|
|
893
|
-
|
|
894
|
-
48,
|
|
859
|
+
( localize(7366, "Tasks are not allowed to run")),
|
|
860
|
+
( localize(7367, "Debugging is disabled")),
|
|
861
|
+
fixBadLocalizedLinks(( localize(
|
|
862
|
+
7368,
|
|
895
863
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
896
864
|
numExtensions,
|
|
897
865
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
898
866
|
)))
|
|
899
867
|
] :
|
|
900
868
|
[
|
|
901
|
-
(
|
|
902
|
-
(
|
|
903
|
-
fixBadLocalizedLinks(numSettings ? (
|
|
904
|
-
|
|
905
|
-
49,
|
|
869
|
+
( localize(7368, "Tasks are not allowed to run")),
|
|
870
|
+
( localize(7368, "Debugging is disabled")),
|
|
871
|
+
fixBadLocalizedLinks(numSettings ? ( localize(
|
|
872
|
+
7369,
|
|
906
873
|
"[{0} workspace settings]({1}) are not applied",
|
|
907
874
|
numSettings,
|
|
908
875
|
'command:settings.filterUntrusted'
|
|
909
|
-
)) : (
|
|
910
|
-
fixBadLocalizedLinks((
|
|
911
|
-
|
|
912
|
-
48,
|
|
876
|
+
)) : ( localize(7370, "Workspace settings requiring trust are not applied"))),
|
|
877
|
+
fixBadLocalizedLinks(( localize(
|
|
878
|
+
7370,
|
|
913
879
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
914
880
|
numExtensions,
|
|
915
881
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
@@ -939,7 +905,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
939
905
|
button.label = action.label;
|
|
940
906
|
button.enabled = enabled !== undefined ? enabled : action.enabled;
|
|
941
907
|
button.description = keybinding.getLabel();
|
|
942
|
-
button.element.ariaLabel = action.label + ', ' + (
|
|
908
|
+
button.element.ariaLabel = action.label + ', ' + ( localize(7371, "Keyboard Shortcut: {0}", keybinding.getAriaLabel()));
|
|
943
909
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
944
910
|
if (e) {
|
|
945
911
|
EventHelper.stop(e, true);
|
|
@@ -949,7 +915,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
949
915
|
}
|
|
950
916
|
}
|
|
951
917
|
addTrustButtonToElement(parent) {
|
|
952
|
-
const trustAction = ( (new Action('workspace.trust.button.action.grant', (
|
|
918
|
+
const trustAction = ( (new Action('workspace.trust.button.action.grant', ( localize(7372, "Trust")), undefined, true, async () => {
|
|
953
919
|
await this.workspaceTrustManagementService.setWorkspaceTrust(true);
|
|
954
920
|
})));
|
|
955
921
|
const trustActions = [{ action: trustAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0] }];
|
|
@@ -957,13 +923,12 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
957
923
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceService.getWorkspace());
|
|
958
924
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
959
925
|
const trustMessageElement = append(parent, $('.trust-message-box'));
|
|
960
|
-
trustMessageElement.innerText = (
|
|
961
|
-
|
|
962
|
-
53,
|
|
926
|
+
trustMessageElement.innerText = ( localize(
|
|
927
|
+
7373,
|
|
963
928
|
"Trust the authors of all files in the current folder or its parent '{0}'.",
|
|
964
929
|
name
|
|
965
930
|
));
|
|
966
|
-
const trustParentAction = ( (new Action('workspace.trust.button.action.grantParent', (
|
|
931
|
+
const trustParentAction = ( (new Action('workspace.trust.button.action.grantParent', ( localize(7374, "Trust Parent")), undefined, true, async () => {
|
|
967
932
|
await this.workspaceTrustManagementService.setParentFolderTrust(true);
|
|
968
933
|
})));
|
|
969
934
|
trustActions.push({ action: trustParentAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Shift+Enter' : 'Ctrl+Shift+Enter')[0] });
|
|
@@ -972,7 +937,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
972
937
|
}
|
|
973
938
|
addDontTrustButtonToElement(parent) {
|
|
974
939
|
this.createButtonRow(parent, [{
|
|
975
|
-
action: ( (new Action('workspace.trust.button.action.deny', (
|
|
940
|
+
action: ( (new Action('workspace.trust.button.action.deny', ( localize(7375, "Don't Trust")), undefined, true, async () => {
|
|
976
941
|
await this.workspaceTrustManagementService.setWorkspaceTrust(false);
|
|
977
942
|
}))),
|
|
978
943
|
keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0]
|
|
@@ -984,22 +949,16 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
984
949
|
}
|
|
985
950
|
const textElement = append(parent, $('.workspace-trust-untrusted-description'));
|
|
986
951
|
if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
987
|
-
textElement.innerText = this.workspaceService.getWorkbenchState() === WorkbenchState.WORKSPACE ? (
|
|
988
|
-
|
|
989
|
-
56,
|
|
952
|
+
textElement.innerText = this.workspaceService.getWorkbenchState() === WorkbenchState.WORKSPACE ? ( localize(
|
|
953
|
+
7376,
|
|
990
954
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
991
|
-
)) : (
|
|
992
|
-
|
|
993
|
-
57,
|
|
955
|
+
)) : ( localize(
|
|
956
|
+
7377,
|
|
994
957
|
"This folder is trusted via the bolded entries in the the trusted folders below."
|
|
995
958
|
));
|
|
996
959
|
}
|
|
997
960
|
else {
|
|
998
|
-
textElement.innerText = (
|
|
999
|
-
_moduleId,
|
|
1000
|
-
58,
|
|
1001
|
-
"This window is trusted by nature of the workspace that is opened."
|
|
1002
|
-
));
|
|
961
|
+
textElement.innerText = ( localize(7378, "This window is trusted by nature of the workspace that is opened."));
|
|
1003
962
|
}
|
|
1004
963
|
}
|
|
1005
964
|
renderLimitationsHeaderElement(parent, headerText, subtitleText) {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
2
2
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
3
3
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
|
-
import {
|
|
4
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
6
6
|
import { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
|
|
7
7
|
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
const WorkspaceTrustEditorIcon = registerIcon('workspace-trust-editor-label-icon', Codicon.shield, ( localizeWithPath(_moduleId, 0, 'Icon of the workspace trust editor label.')));
|
|
9
|
+
const WorkspaceTrustEditorIcon = registerIcon('workspace-trust-editor-label-icon', Codicon.shield, ( localize(7379, 'Icon of the workspace trust editor label.')));
|
|
11
10
|
class WorkspaceTrustEditorInput extends EditorInput {
|
|
12
11
|
constructor() {
|
|
13
12
|
super(...arguments);
|
|
@@ -27,7 +26,7 @@ class WorkspaceTrustEditorInput extends EditorInput {
|
|
|
27
26
|
return super.matches(otherInput) || otherInput instanceof WorkspaceTrustEditorInput;
|
|
28
27
|
}
|
|
29
28
|
getName() {
|
|
30
|
-
return (
|
|
29
|
+
return ( localize(7380, "Workspace Trust"));
|
|
31
30
|
}
|
|
32
31
|
getIcon() {
|
|
33
32
|
return WorkspaceTrustEditorIcon;
|