@codingame/monaco-vscode-workspace-trust-service-override 8.0.4 → 9.0.2
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 +59 -59
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +68 -68
- package/vscode/src/vs/workbench/services/workspaces/browser/workspaceTrustEditorInput.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workspace-trust-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.2",
|
|
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@9.0.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -92,30 +92,30 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
92
92
|
const markdownDetails = [
|
|
93
93
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
94
94
|
( localize(
|
|
95
|
-
|
|
95
|
+
3185,
|
|
96
96
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
97
97
|
)) :
|
|
98
98
|
( localize(
|
|
99
|
-
|
|
99
|
+
3186,
|
|
100
100
|
"You are trying to open untrusted files in a window which is trusted."
|
|
101
101
|
)),
|
|
102
102
|
( localize(
|
|
103
|
-
|
|
103
|
+
3187,
|
|
104
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."
|
|
105
105
|
))
|
|
106
106
|
];
|
|
107
107
|
await this.dialogService.prompt({
|
|
108
108
|
type: Severity$1.Info,
|
|
109
109
|
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
110
|
-
( localize(
|
|
111
|
-
( localize(
|
|
110
|
+
( localize(3188, "Do you want to allow untrusted files in this workspace?")) :
|
|
111
|
+
( localize(3189, "Do you want to allow untrusted files in this window?")),
|
|
112
112
|
buttons: [
|
|
113
113
|
{
|
|
114
|
-
label: ( localize(
|
|
114
|
+
label: ( localize(3190, "&&Open")),
|
|
115
115
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
|
-
label: ( localize(
|
|
118
|
+
label: ( localize(3191, "Open in &&Restricted Mode")),
|
|
119
119
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.OpenInNewWindow, !!checkboxChecked)
|
|
120
120
|
}
|
|
121
121
|
],
|
|
@@ -123,7 +123,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
123
123
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
124
124
|
},
|
|
125
125
|
checkbox: {
|
|
126
|
-
label: ( localize(
|
|
126
|
+
label: ( localize(3192, "Remember my decision for all workspaces")),
|
|
127
127
|
checked: false
|
|
128
128
|
},
|
|
129
129
|
custom: {
|
|
@@ -135,19 +135,19 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
135
135
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
136
136
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
137
137
|
const message = this.useWorkspaceLanguage ?
|
|
138
|
-
( localize(
|
|
139
|
-
( localize(
|
|
138
|
+
( localize(3193, "Do you trust the authors of the files in this workspace?")) :
|
|
139
|
+
( localize(3194, "Do you trust the authors of the files in this folder?"));
|
|
140
140
|
const defaultDetails = ( localize(
|
|
141
|
-
|
|
141
|
+
3195,
|
|
142
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."
|
|
143
143
|
));
|
|
144
144
|
const details = requestOptions?.message ?? defaultDetails;
|
|
145
145
|
const buttons = requestOptions?.buttons ?? [
|
|
146
|
-
{ label: this.useWorkspaceLanguage ? ( localize(
|
|
147
|
-
{ label: ( localize(
|
|
146
|
+
{ label: this.useWorkspaceLanguage ? ( localize(3196, "&&Trust Workspace & Continue")) : ( localize(3197, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
|
|
147
|
+
{ label: ( localize(3198, "&&Manage")), type: 'Manage' }
|
|
148
148
|
];
|
|
149
149
|
if (!( (buttons.some(b => b.type === 'Cancel')))) {
|
|
150
|
-
buttons.push({ label: ( localize(
|
|
150
|
+
buttons.push({ label: ( localize(3199, "Cancel")), type: 'Cancel' });
|
|
151
151
|
}
|
|
152
152
|
const { result } = await this.dialogService.prompt({
|
|
153
153
|
type: Severity$1.Info,
|
|
@@ -157,7 +157,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
157
157
|
markdownDetails: [
|
|
158
158
|
{ markdown: ( (new MarkdownString(details))) },
|
|
159
159
|
{ markdown: ( (new MarkdownString(( localize(
|
|
160
|
-
|
|
160
|
+
3200,
|
|
161
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."
|
|
162
162
|
))))) }
|
|
163
163
|
]
|
|
@@ -258,12 +258,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
258
258
|
if (!( (addedFoldersTrustInfo.map(info => info.trusted))).every(trusted => trusted)) {
|
|
259
259
|
const { confirmed } = await this.dialogService.confirm({
|
|
260
260
|
type: Severity$1.Info,
|
|
261
|
-
message: ( localize(
|
|
261
|
+
message: ( localize(3201, "Do you trust the authors of the files in this folder?")),
|
|
262
262
|
detail: ( localize(
|
|
263
|
-
|
|
263
|
+
3202,
|
|
264
264
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
265
265
|
)),
|
|
266
|
-
cancelButton: ( localize(
|
|
266
|
+
cancelButton: ( localize(3203, 'No')),
|
|
267
267
|
custom: { icon: Codicon.shield }
|
|
268
268
|
});
|
|
269
269
|
await this.workspaceTrustManagementService.setUrisTrust(( (addedFoldersTrustInfo.map(i => i.uri))), confirmed);
|
|
@@ -291,30 +291,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
291
291
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
292
292
|
}
|
|
293
293
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
294
|
-
( localize(
|
|
295
|
-
( localize(
|
|
294
|
+
( localize(3193, "Do you trust the authors of the files in this workspace?")) :
|
|
295
|
+
( localize(3194, "Do you trust the authors of the files in this folder?")));
|
|
296
296
|
let checkboxText;
|
|
297
297
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
298
298
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
299
299
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
300
300
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
301
301
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
302
|
-
checkboxText = ( localize(
|
|
302
|
+
checkboxText = ( localize(3204, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
303
303
|
}
|
|
304
|
-
this.doShowModal(title, { label: trustOption ?? ( localize(
|
|
304
|
+
this.doShowModal(title, { label: trustOption ?? ( localize(3205, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(3206, "Trust folder and enable all features")) : ( localize(3207, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localize(3208, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(3209, "Browse folder in restricted mode")) : ( localize(3210, "Browse workspace in restricted mode")) }, [
|
|
305
305
|
!isSingleFolderWorkspace ?
|
|
306
306
|
( localize(
|
|
307
|
-
|
|
307
|
+
3211,
|
|
308
308
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
309
309
|
this.productService.nameShort
|
|
310
310
|
)) :
|
|
311
311
|
( localize(
|
|
312
|
-
|
|
312
|
+
3212,
|
|
313
313
|
"{0} provides features that may automatically execute files in this folder.",
|
|
314
314
|
this.productService.nameShort
|
|
315
315
|
)),
|
|
316
316
|
learnMoreString ?? ( localize(
|
|
317
|
-
|
|
317
|
+
3213,
|
|
318
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."
|
|
319
319
|
)),
|
|
320
320
|
!isEmptyWindow ?
|
|
@@ -432,11 +432,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
432
432
|
}
|
|
433
433
|
const actions = [
|
|
434
434
|
{
|
|
435
|
-
label: ( localize(
|
|
435
|
+
label: ( localize(3214, "Manage")),
|
|
436
436
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
|
-
label: ( localize(
|
|
439
|
+
label: ( localize(3215, "Learn More")),
|
|
440
440
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
441
441
|
}
|
|
442
442
|
];
|
|
@@ -457,17 +457,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
457
457
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
458
458
|
case WorkbenchState.EMPTY:
|
|
459
459
|
return ( localize(
|
|
460
|
-
|
|
460
|
+
3216,
|
|
461
461
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
462
462
|
));
|
|
463
463
|
case WorkbenchState.FOLDER:
|
|
464
464
|
return ( localize(
|
|
465
|
-
|
|
465
|
+
3217,
|
|
466
466
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
467
467
|
));
|
|
468
468
|
case WorkbenchState.WORKSPACE:
|
|
469
469
|
return ( localize(
|
|
470
|
-
|
|
470
|
+
3218,
|
|
471
471
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
472
472
|
));
|
|
473
473
|
}
|
|
@@ -476,17 +476,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
476
476
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
477
477
|
case WorkbenchState.EMPTY:
|
|
478
478
|
return ( localize(
|
|
479
|
-
|
|
479
|
+
3219,
|
|
480
480
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
481
481
|
));
|
|
482
482
|
case WorkbenchState.FOLDER:
|
|
483
483
|
return ( localize(
|
|
484
|
-
|
|
484
|
+
3220,
|
|
485
485
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
486
486
|
));
|
|
487
487
|
case WorkbenchState.WORKSPACE:
|
|
488
488
|
return ( localize(
|
|
489
|
-
|
|
489
|
+
3221,
|
|
490
490
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
491
491
|
));
|
|
492
492
|
}
|
|
@@ -504,12 +504,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
504
504
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
505
505
|
case WorkbenchState.EMPTY: {
|
|
506
506
|
ariaLabel = ( localize(
|
|
507
|
-
|
|
507
|
+
3222,
|
|
508
508
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
509
509
|
));
|
|
510
510
|
toolTip = {
|
|
511
511
|
value: ( localize(
|
|
512
|
-
|
|
512
|
+
3223,
|
|
513
513
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
514
514
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
515
515
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -521,12 +521,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
521
521
|
}
|
|
522
522
|
case WorkbenchState.FOLDER: {
|
|
523
523
|
ariaLabel = ( localize(
|
|
524
|
-
|
|
524
|
+
3224,
|
|
525
525
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
526
526
|
));
|
|
527
527
|
toolTip = {
|
|
528
528
|
value: ( localize(
|
|
529
|
-
|
|
529
|
+
3225,
|
|
530
530
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
531
531
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
532
532
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -538,12 +538,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
538
538
|
}
|
|
539
539
|
case WorkbenchState.WORKSPACE: {
|
|
540
540
|
ariaLabel = ( localize(
|
|
541
|
-
|
|
541
|
+
3226,
|
|
542
542
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
543
543
|
));
|
|
544
544
|
toolTip = {
|
|
545
545
|
value: ( localize(
|
|
546
|
-
|
|
546
|
+
3227,
|
|
547
547
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
548
548
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
549
549
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -555,8 +555,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
return {
|
|
558
|
-
name: ( localize(
|
|
559
|
-
text: `$(shield) ${( localize(
|
|
558
|
+
name: ( localize(3228, "Workspace Trust")),
|
|
559
|
+
text: `$(shield) ${( localize(3229, "Restricted Mode"))}`,
|
|
560
560
|
ariaLabel: ariaLabel,
|
|
561
561
|
tooltip: toolTip,
|
|
562
562
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -606,16 +606,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
606
606
|
}
|
|
607
607
|
( (Registry.as(EditorExtensions.EditorFactory)))
|
|
608
608
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
609
|
-
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
609
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(3230, "Workspace Trust Editor"))), [
|
|
610
610
|
( (new SyncDescriptor(WorkspaceTrustEditorInput)))
|
|
611
611
|
]);
|
|
612
612
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
613
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
613
|
+
const WORKSPACES_CATEGORY = ( localize2(3231, 'Workspaces'));
|
|
614
614
|
registerAction2(class extends Action2 {
|
|
615
615
|
constructor() {
|
|
616
616
|
super({
|
|
617
617
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
618
|
-
title: ( localize2(
|
|
618
|
+
title: ( localize2(3232, "Configure Workspace Trust Settings")),
|
|
619
619
|
precondition: ( (ContextKeyExpr.and(
|
|
620
620
|
WorkspaceTrustContext.IsEnabled,
|
|
621
621
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -632,7 +632,7 @@ registerAction2(class extends Action2 {
|
|
|
632
632
|
constructor() {
|
|
633
633
|
super({
|
|
634
634
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
635
|
-
title: ( localize2(
|
|
635
|
+
title: ( localize2(3233, "Manage Workspace Trust")),
|
|
636
636
|
precondition: ( (ContextKeyExpr.and(
|
|
637
637
|
WorkspaceTrustContext.IsEnabled,
|
|
638
638
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -656,44 +656,44 @@ registerAction2(class extends Action2 {
|
|
|
656
656
|
[WORKSPACE_TRUST_ENABLED]: {
|
|
657
657
|
type: 'boolean',
|
|
658
658
|
default: true,
|
|
659
|
-
description: ( localize(
|
|
659
|
+
description: ( localize(3234, "Controls whether or not Workspace Trust is enabled within VS Code.")),
|
|
660
660
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
661
661
|
scope: ConfigurationScope.APPLICATION,
|
|
662
662
|
},
|
|
663
663
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
664
664
|
type: 'string',
|
|
665
665
|
default: 'once',
|
|
666
|
-
description: ( localize(
|
|
666
|
+
description: ( localize(3235, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
667
667
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
668
668
|
scope: ConfigurationScope.APPLICATION,
|
|
669
669
|
enum: ['always', 'once', 'never'],
|
|
670
670
|
enumDescriptions: [
|
|
671
|
-
( localize(
|
|
672
|
-
( localize(
|
|
673
|
-
( localize(
|
|
671
|
+
( localize(3236, "Ask for trust every time an untrusted workspace is opened.")),
|
|
672
|
+
( localize(3237, "Ask for trust the first time an untrusted workspace is opened.")),
|
|
673
|
+
( localize(3238, "Do not ask for trust when an untrusted workspace is opened.")),
|
|
674
674
|
]
|
|
675
675
|
},
|
|
676
676
|
[WORKSPACE_TRUST_BANNER]: {
|
|
677
677
|
type: 'string',
|
|
678
678
|
default: 'untilDismissed',
|
|
679
|
-
description: ( localize(
|
|
679
|
+
description: ( localize(3239, "Controls when the restricted mode banner is shown.")),
|
|
680
680
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
681
681
|
scope: ConfigurationScope.APPLICATION,
|
|
682
682
|
enum: ['always', 'untilDismissed', 'never'],
|
|
683
683
|
enumDescriptions: [
|
|
684
|
-
( localize(
|
|
684
|
+
( localize(3240, "Show the banner every time an untrusted workspace is open.")),
|
|
685
685
|
( localize(
|
|
686
|
-
|
|
686
|
+
3241,
|
|
687
687
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
688
688
|
)),
|
|
689
|
-
( localize(
|
|
689
|
+
( localize(3242, "Do not show the banner when an untrusted workspace is open.")),
|
|
690
690
|
]
|
|
691
691
|
},
|
|
692
692
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
693
693
|
type: 'string',
|
|
694
694
|
default: 'prompt',
|
|
695
695
|
markdownDescription: ( localize(
|
|
696
|
-
|
|
696
|
+
3243,
|
|
697
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}#`.",
|
|
698
698
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
699
699
|
)),
|
|
@@ -702,15 +702,15 @@ registerAction2(class extends Action2 {
|
|
|
702
702
|
enum: ['prompt', 'open', 'newWindow'],
|
|
703
703
|
enumDescriptions: [
|
|
704
704
|
( localize(
|
|
705
|
-
|
|
705
|
+
3244,
|
|
706
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."
|
|
707
707
|
)),
|
|
708
708
|
( localize(
|
|
709
|
-
|
|
709
|
+
3245,
|
|
710
710
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
711
711
|
)),
|
|
712
712
|
( localize(
|
|
713
|
-
|
|
713
|
+
3246,
|
|
714
714
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
715
715
|
)),
|
|
716
716
|
]
|
|
@@ -719,7 +719,7 @@ registerAction2(class extends Action2 {
|
|
|
719
719
|
type: 'boolean',
|
|
720
720
|
default: true,
|
|
721
721
|
markdownDescription: ( localize(
|
|
722
|
-
|
|
722
|
+
3247,
|
|
723
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.",
|
|
724
724
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
725
725
|
)),
|
|
@@ -64,12 +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 shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, ( localize(
|
|
68
|
-
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localize(
|
|
69
|
-
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localize(
|
|
70
|
-
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localize(
|
|
71
|
-
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize(
|
|
72
|
-
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(
|
|
67
|
+
const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, ( localize(7559, 'Icon for workspace trust ion the banner.')));
|
|
68
|
+
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localize(7560, 'Icon for the checkmark in the workspace trust editor.')));
|
|
69
|
+
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localize(7561, 'Icon for the cross in the workspace trust editor.')));
|
|
70
|
+
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localize(7562, 'Icon for the pick folder icon in the workspace trust editor.')));
|
|
71
|
+
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize(7563, 'Icon for the edit folder icon in the workspace trust editor.')));
|
|
72
|
+
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(7564, 'Icon for the remove folder icon in the workspace trust editor.')));
|
|
73
73
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
74
74
|
constructor(container, instantiationService, workspaceService, workspaceTrustManagementService, uriService, labelService, fileDialogService) {
|
|
75
75
|
super();
|
|
@@ -93,14 +93,14 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
93
93
|
const addButtonBarElement = container.appendChild($('.trusted-uris-button-bar'));
|
|
94
94
|
this.table = this.instantiationService.createInstance(WorkbenchTable, 'WorkspaceTrust', tableElement, ( (new TrustedUriTableVirtualDelegate())), [
|
|
95
95
|
{
|
|
96
|
-
label: ( localize(
|
|
96
|
+
label: ( localize(7565, "Host")),
|
|
97
97
|
tooltip: '',
|
|
98
98
|
weight: 1,
|
|
99
99
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
100
100
|
project(row) { return row; }
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
|
-
label: ( localize(
|
|
103
|
+
label: ( localize(7566, "Path")),
|
|
104
104
|
tooltip: '',
|
|
105
105
|
weight: 8,
|
|
106
106
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -128,16 +128,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
128
128
|
getAriaLabel: (item) => {
|
|
129
129
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
130
130
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
131
|
-
return ( localize(
|
|
131
|
+
return ( localize(7567, "{0}, trusted", this.labelService.getUriLabel(item.uri)));
|
|
132
132
|
}
|
|
133
133
|
return ( localize(
|
|
134
|
-
|
|
134
|
+
7568,
|
|
135
135
|
"{0} on {1}, trusted",
|
|
136
136
|
this.labelService.getUriLabel(item.uri),
|
|
137
137
|
hostLabel
|
|
138
138
|
));
|
|
139
139
|
},
|
|
140
|
-
getWidgetAriaLabel: () => ( localize(
|
|
140
|
+
getWidgetAriaLabel: () => ( localize(7569, "Trusted Folders & Workspaces"))
|
|
141
141
|
},
|
|
142
142
|
identityProvider: {
|
|
143
143
|
getId(element) {
|
|
@@ -153,16 +153,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
153
153
|
}
|
|
154
154
|
}));
|
|
155
155
|
const buttonBar = this._register(( (new ButtonBar(addButtonBarElement))));
|
|
156
|
-
const addButton = this._register(buttonBar.addButton({ title: ( localize(
|
|
157
|
-
addButton.label = ( localize(
|
|
156
|
+
const addButton = this._register(buttonBar.addButton({ title: ( localize(7570, "Add Folder")), ...defaultButtonStyles }));
|
|
157
|
+
addButton.label = ( localize(7570, "Add Folder"));
|
|
158
158
|
this._register(addButton.onDidClick(async () => {
|
|
159
159
|
const uri = await this.fileDialogService.showOpenDialog({
|
|
160
160
|
canSelectFiles: false,
|
|
161
161
|
canSelectFolders: true,
|
|
162
162
|
canSelectMany: false,
|
|
163
163
|
defaultUri: this.currentWorkspaceUri,
|
|
164
|
-
openLabel: ( localize(
|
|
165
|
-
title: ( localize(
|
|
164
|
+
openLabel: ( localize(7571, "Trust Folder")),
|
|
165
|
+
title: ( localize(7572, "Select Folder To Trust"))
|
|
166
166
|
});
|
|
167
167
|
if (uri) {
|
|
168
168
|
this.workspaceTrustManagementService.setUrisTrust(uri, true);
|
|
@@ -243,10 +243,10 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
243
243
|
this.container.classList.toggle('empty', entries.length === 0);
|
|
244
244
|
this.descriptionElement.innerText = entries.length ?
|
|
245
245
|
( localize(
|
|
246
|
-
|
|
246
|
+
7573,
|
|
247
247
|
"You trust the following folders, their subfolders, and workspace files."
|
|
248
248
|
)) :
|
|
249
|
-
( localize(
|
|
249
|
+
( localize(7574, "You haven't trusted any folders or workspace files yet."));
|
|
250
250
|
this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
|
|
251
251
|
this.layout();
|
|
252
252
|
}
|
|
@@ -260,7 +260,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
260
260
|
return {
|
|
261
261
|
type: MessageType.WARNING,
|
|
262
262
|
content: ( localize(
|
|
263
|
-
|
|
263
|
+
7575,
|
|
264
264
|
"You will trust all repositories on {0}.",
|
|
265
265
|
getHostLabel(this.labelService, item)
|
|
266
266
|
))
|
|
@@ -270,7 +270,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
270
270
|
return {
|
|
271
271
|
type: MessageType.WARNING,
|
|
272
272
|
content: ( localize(
|
|
273
|
-
|
|
273
|
+
7576,
|
|
274
274
|
"You will trust all repositories and forks under '{0}' on {1}.",
|
|
275
275
|
segments[0],
|
|
276
276
|
getHostLabel(this.labelService, item)
|
|
@@ -280,7 +280,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
280
280
|
if (segments.length > 2) {
|
|
281
281
|
return {
|
|
282
282
|
type: MessageType.ERROR,
|
|
283
|
-
content: ( localize(
|
|
283
|
+
content: ( localize(7577, "You cannot trust individual folders within a repository.", path))
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
}
|
|
@@ -321,8 +321,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
321
321
|
canSelectFolders: true,
|
|
322
322
|
canSelectMany: false,
|
|
323
323
|
defaultUri: item.uri,
|
|
324
|
-
openLabel: ( localize(
|
|
325
|
-
title: ( localize(
|
|
324
|
+
openLabel: ( localize(7571, "Trust Folder")),
|
|
325
|
+
title: ( localize(7572, "Select Folder To Trust"))
|
|
326
326
|
});
|
|
327
327
|
if (uri) {
|
|
328
328
|
this.acceptEdit(item, uri[0]);
|
|
@@ -389,7 +389,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
389
389
|
class: ThemeIcon.asClassName(editIcon),
|
|
390
390
|
enabled: true,
|
|
391
391
|
id: 'editTrustedUri',
|
|
392
|
-
tooltip: ( localize(
|
|
392
|
+
tooltip: ( localize(7578, "Edit Path")),
|
|
393
393
|
run: () => {
|
|
394
394
|
this.table.edit(item, false);
|
|
395
395
|
}
|
|
@@ -401,7 +401,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
401
401
|
class: ThemeIcon.asClassName(folderPickerIcon),
|
|
402
402
|
enabled: true,
|
|
403
403
|
id: 'pickerTrustedUri',
|
|
404
|
-
tooltip: ( localize(
|
|
404
|
+
tooltip: ( localize(7579, "Open File Picker")),
|
|
405
405
|
run: () => {
|
|
406
406
|
this.table.edit(item, true);
|
|
407
407
|
}
|
|
@@ -413,7 +413,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
413
413
|
class: ThemeIcon.asClassName(removeIcon),
|
|
414
414
|
enabled: true,
|
|
415
415
|
id: 'deleteTrustedUri',
|
|
416
|
-
tooltip: ( localize(
|
|
416
|
+
tooltip: ( localize(7580, "Delete Path")),
|
|
417
417
|
run: async () => {
|
|
418
418
|
await this.table.delete(item);
|
|
419
419
|
}
|
|
@@ -530,7 +530,7 @@ TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( (__decorate([
|
|
|
530
530
|
( (__param(1, IContextViewService)))
|
|
531
531
|
], TrustedUriPathColumnRenderer)));
|
|
532
532
|
function getHostLabel(labelService, item) {
|
|
533
|
-
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(
|
|
533
|
+
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(7581, "Local"));
|
|
534
534
|
}
|
|
535
535
|
let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
|
|
536
536
|
static { TrustedUriHostColumnRenderer_1 = this; }
|
|
@@ -663,18 +663,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
663
663
|
getHeaderTitleText(trusted) {
|
|
664
664
|
if (trusted) {
|
|
665
665
|
if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
666
|
-
return ( localize(
|
|
666
|
+
return ( localize(7582, "This window is trusted"));
|
|
667
667
|
}
|
|
668
668
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
669
669
|
case WorkbenchState.EMPTY:
|
|
670
|
-
return ( localize(
|
|
670
|
+
return ( localize(7583, "You trust this window"));
|
|
671
671
|
case WorkbenchState.FOLDER:
|
|
672
|
-
return ( localize(
|
|
672
|
+
return ( localize(7584, "You trust this folder"));
|
|
673
673
|
case WorkbenchState.WORKSPACE:
|
|
674
|
-
return ( localize(
|
|
674
|
+
return ( localize(7585, "You trust this workspace"));
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
return ( localize(
|
|
677
|
+
return ( localize(7586, "You are in Restricted Mode"));
|
|
678
678
|
}
|
|
679
679
|
getHeaderTitleIconClassNames(trusted) {
|
|
680
680
|
return ThemeIcon.asClassNameArray(shieldIcon);
|
|
@@ -684,37 +684,37 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
684
684
|
let subTitle = '';
|
|
685
685
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
686
686
|
case WorkbenchState.EMPTY: {
|
|
687
|
-
title = trusted ? ( localize(
|
|
687
|
+
title = trusted ? ( localize(7587, "In a Trusted Window")) : ( localize(7588, "In Restricted Mode"));
|
|
688
688
|
subTitle = trusted ? ( localize(
|
|
689
|
-
|
|
689
|
+
7589,
|
|
690
690
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
691
691
|
)) :
|
|
692
692
|
( localize(
|
|
693
|
-
|
|
693
|
+
7590,
|
|
694
694
|
"You do not trust the authors of the files in the current window. The following features are disabled:"
|
|
695
695
|
));
|
|
696
696
|
break;
|
|
697
697
|
}
|
|
698
698
|
case WorkbenchState.FOLDER: {
|
|
699
|
-
title = trusted ? ( localize(
|
|
699
|
+
title = trusted ? ( localize(7591, "In a Trusted Folder")) : ( localize(7588, "In Restricted Mode"));
|
|
700
700
|
subTitle = trusted ? ( localize(
|
|
701
|
-
|
|
701
|
+
7592,
|
|
702
702
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
703
703
|
)) :
|
|
704
704
|
( localize(
|
|
705
|
-
|
|
705
|
+
7593,
|
|
706
706
|
"You do not trust the authors of the files in the current folder. The following features are disabled:"
|
|
707
707
|
));
|
|
708
708
|
break;
|
|
709
709
|
}
|
|
710
710
|
case WorkbenchState.WORKSPACE: {
|
|
711
|
-
title = trusted ? ( localize(
|
|
711
|
+
title = trusted ? ( localize(7594, "In a Trusted Workspace")) : ( localize(7588, "In Restricted Mode"));
|
|
712
712
|
subTitle = trusted ? ( localize(
|
|
713
|
-
|
|
713
|
+
7595,
|
|
714
714
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
715
715
|
)) :
|
|
716
716
|
( localize(
|
|
717
|
-
|
|
717
|
+
7596,
|
|
718
718
|
"You do not trust the authors of the files in the current workspace. The following features are disabled:"
|
|
719
719
|
));
|
|
720
720
|
break;
|
|
@@ -738,17 +738,17 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
738
738
|
const headerDescriptionText = append(this.headerDescription, $('div'));
|
|
739
739
|
headerDescriptionText.innerText = isWorkspaceTrusted ?
|
|
740
740
|
( localize(
|
|
741
|
-
|
|
741
|
+
7597,
|
|
742
742
|
"All features are enabled because trust has been granted to the workspace."
|
|
743
743
|
)) :
|
|
744
744
|
( localize(
|
|
745
|
-
|
|
745
|
+
7598,
|
|
746
746
|
"{0} is in a restricted mode intended for safe code browsing.",
|
|
747
747
|
this.productService.nameShort
|
|
748
748
|
));
|
|
749
749
|
const headerDescriptionActions = append(this.headerDescription, $('div'));
|
|
750
750
|
const headerDescriptionActionsText = ( localize(
|
|
751
|
-
|
|
751
|
+
7599,
|
|
752
752
|
"[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
|
|
753
753
|
`command:workbench.trust.configure`
|
|
754
754
|
));
|
|
@@ -761,7 +761,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
|
|
764
|
-
this.rootElement.setAttribute('aria-label', `${( localize(
|
|
764
|
+
this.rootElement.setAttribute('aria-label', `${( localize(7600, "Manage Workspace Trust"))}: ${this.headerContainer.innerText}`);
|
|
765
765
|
const restrictedSettings = this.configurationService.restrictedSettings;
|
|
766
766
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
767
767
|
const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
|
|
@@ -826,7 +826,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
826
826
|
createConfigurationElement(parent) {
|
|
827
827
|
this.configurationContainer = append(parent, $('.workspace-trust-settings', { tabIndex: '0' }));
|
|
828
828
|
const configurationTitle = append(this.configurationContainer, $('.workspace-trusted-folders-title'));
|
|
829
|
-
configurationTitle.innerText = ( localize(
|
|
829
|
+
configurationTitle.innerText = ( localize(7569, "Trusted Folders & Workspaces"));
|
|
830
830
|
this.workspaceTrustedUrisTable = this._register(this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer));
|
|
831
831
|
}
|
|
832
832
|
createAffectedFeaturesElement(parent) {
|
|
@@ -841,41 +841,41 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
841
841
|
this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
|
|
842
842
|
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ?
|
|
843
843
|
[
|
|
844
|
-
( localize(
|
|
845
|
-
( localize(
|
|
846
|
-
( localize(
|
|
844
|
+
( localize(7601, "Tasks are allowed to run")),
|
|
845
|
+
( localize(7602, "Debugging is enabled")),
|
|
846
|
+
( localize(7603, "All enabled extensions are activated"))
|
|
847
847
|
] :
|
|
848
848
|
[
|
|
849
|
-
( localize(
|
|
850
|
-
( localize(
|
|
851
|
-
( localize(
|
|
852
|
-
( localize(
|
|
849
|
+
( localize(7601, "Tasks are allowed to run")),
|
|
850
|
+
( localize(7602, "Debugging is enabled")),
|
|
851
|
+
( localize(7604, "All workspace settings are applied")),
|
|
852
|
+
( localize(7603, "All enabled extensions are activated"))
|
|
853
853
|
];
|
|
854
854
|
this.renderLimitationsListElement(this.trustedContainer, trustedContainerItems, ThemeIcon.asClassNameArray(checkListIcon));
|
|
855
855
|
const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
|
|
856
856
|
this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
|
|
857
857
|
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ?
|
|
858
858
|
[
|
|
859
|
-
( localize(
|
|
860
|
-
( localize(
|
|
859
|
+
( localize(7605, "Tasks are not allowed to run")),
|
|
860
|
+
( localize(7606, "Debugging is disabled")),
|
|
861
861
|
fixBadLocalizedLinks(( localize(
|
|
862
|
-
|
|
862
|
+
7607,
|
|
863
863
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
864
864
|
numExtensions,
|
|
865
865
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
866
866
|
)))
|
|
867
867
|
] :
|
|
868
868
|
[
|
|
869
|
-
( localize(
|
|
870
|
-
( localize(
|
|
869
|
+
( localize(7605, "Tasks are not allowed to run")),
|
|
870
|
+
( localize(7606, "Debugging is disabled")),
|
|
871
871
|
fixBadLocalizedLinks(numSettings ? ( localize(
|
|
872
|
-
|
|
872
|
+
7608,
|
|
873
873
|
"[{0} workspace settings]({1}) are not applied",
|
|
874
874
|
numSettings,
|
|
875
875
|
'command:settings.filterUntrusted'
|
|
876
|
-
)) : ( localize(
|
|
876
|
+
)) : ( localize(7609, "Workspace settings requiring trust are not applied"))),
|
|
877
877
|
fixBadLocalizedLinks(( localize(
|
|
878
|
-
|
|
878
|
+
7607,
|
|
879
879
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
880
880
|
numExtensions,
|
|
881
881
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
@@ -905,7 +905,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
905
905
|
button.label = action.label;
|
|
906
906
|
button.enabled = enabled !== undefined ? enabled : action.enabled;
|
|
907
907
|
button.description = keybinding.getLabel();
|
|
908
|
-
button.element.ariaLabel = action.label + ', ' + ( localize(
|
|
908
|
+
button.element.ariaLabel = action.label + ', ' + ( localize(7610, "Keyboard Shortcut: {0}", keybinding.getAriaLabel()));
|
|
909
909
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
910
910
|
if (e) {
|
|
911
911
|
EventHelper.stop(e, true);
|
|
@@ -915,7 +915,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
addTrustButtonToElement(parent) {
|
|
918
|
-
const trustAction = ( (new Action('workspace.trust.button.action.grant', ( localize(
|
|
918
|
+
const trustAction = ( (new Action('workspace.trust.button.action.grant', ( localize(7611, "Trust")), undefined, true, async () => {
|
|
919
919
|
await this.workspaceTrustManagementService.setWorkspaceTrust(true);
|
|
920
920
|
})));
|
|
921
921
|
const trustActions = [{ action: trustAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0] }];
|
|
@@ -924,11 +924,11 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
924
924
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
925
925
|
const trustMessageElement = append(parent, $('.trust-message-box'));
|
|
926
926
|
trustMessageElement.innerText = ( localize(
|
|
927
|
-
|
|
927
|
+
7612,
|
|
928
928
|
"Trust the authors of all files in the current folder or its parent '{0}'.",
|
|
929
929
|
name
|
|
930
930
|
));
|
|
931
|
-
const trustParentAction = ( (new Action('workspace.trust.button.action.grantParent', ( localize(
|
|
931
|
+
const trustParentAction = ( (new Action('workspace.trust.button.action.grantParent', ( localize(7613, "Trust Parent")), undefined, true, async () => {
|
|
932
932
|
await this.workspaceTrustManagementService.setParentFolderTrust(true);
|
|
933
933
|
})));
|
|
934
934
|
trustActions.push({ action: trustParentAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Shift+Enter' : 'Ctrl+Shift+Enter')[0] });
|
|
@@ -937,7 +937,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
937
937
|
}
|
|
938
938
|
addDontTrustButtonToElement(parent) {
|
|
939
939
|
this.createButtonRow(parent, [{
|
|
940
|
-
action: ( (new Action('workspace.trust.button.action.deny', ( localize(
|
|
940
|
+
action: ( (new Action('workspace.trust.button.action.deny', ( localize(7614, "Don't Trust")), undefined, true, async () => {
|
|
941
941
|
await this.workspaceTrustManagementService.setWorkspaceTrust(false);
|
|
942
942
|
}))),
|
|
943
943
|
keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0]
|
|
@@ -950,15 +950,15 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
950
950
|
const textElement = append(parent, $('.workspace-trust-untrusted-description'));
|
|
951
951
|
if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
952
952
|
textElement.innerText = this.workspaceService.getWorkbenchState() === WorkbenchState.WORKSPACE ? ( localize(
|
|
953
|
-
|
|
953
|
+
7615,
|
|
954
954
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
955
955
|
)) : ( localize(
|
|
956
|
-
|
|
956
|
+
7616,
|
|
957
957
|
"This folder is trusted via the bolded entries in the the trusted folders below."
|
|
958
958
|
));
|
|
959
959
|
}
|
|
960
960
|
else {
|
|
961
|
-
textElement.innerText = ( localize(
|
|
961
|
+
textElement.innerText = ( localize(7617, "This window is trusted by nature of the workspace that is opened."));
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
964
|
renderLimitationsHeaderElement(parent, headerText, subtitleText) {
|
|
@@ -6,7 +6,7 @@ import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistr
|
|
|
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 WorkspaceTrustEditorIcon = registerIcon('workspace-trust-editor-label-icon', Codicon.shield, ( localize(
|
|
9
|
+
const WorkspaceTrustEditorIcon = registerIcon('workspace-trust-editor-label-icon', Codicon.shield, ( localize(7618, 'Icon of the workspace trust editor label.')));
|
|
10
10
|
class WorkspaceTrustEditorInput extends EditorInput {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
@@ -26,7 +26,7 @@ class WorkspaceTrustEditorInput extends EditorInput {
|
|
|
26
26
|
return super.matches(otherInput) || otherInput instanceof WorkspaceTrustEditorInput;
|
|
27
27
|
}
|
|
28
28
|
getName() {
|
|
29
|
-
return ( localize(
|
|
29
|
+
return ( localize(7619, "Workspace Trust"));
|
|
30
30
|
}
|
|
31
31
|
getIcon() {
|
|
32
32
|
return WorkspaceTrustEditorIcon;
|