@codingame/monaco-vscode-workspace-trust-service-override 23.1.0 → 23.2.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 +10 -10
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +59 -59
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +69 -69
- 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": "23.
|
|
3
|
+
"version": "23.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - workspace-trust service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "23.
|
|
19
|
-
"@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "23.
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
22
|
-
"@codingame/monaco-vscode-
|
|
23
|
-
"@codingame/monaco-vscode-
|
|
24
|
-
"@codingame/monaco-vscode-
|
|
25
|
-
"@codingame/monaco-vscode-api": "23.
|
|
26
|
-
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "23.
|
|
18
|
+
"@codingame/monaco-vscode-158b9837-fc78-5d9c-86f5-9134e4358643-common": "23.2.0",
|
|
19
|
+
"@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "23.2.0",
|
|
20
|
+
"@codingame/monaco-vscode-2c64d2c2-fdf7-5675-a2fe-f6f65fbdedbf-common": "23.2.0",
|
|
21
|
+
"@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common": "23.2.0",
|
|
22
|
+
"@codingame/monaco-vscode-571c8352-7953-5038-9f09-e03bb6219a0e-common": "23.2.0",
|
|
23
|
+
"@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common": "23.2.0",
|
|
24
|
+
"@codingame/monaco-vscode-7869cfe8-f42c-5721-9f2b-7d04a6a41f16-common": "23.2.0",
|
|
25
|
+
"@codingame/monaco-vscode-api": "23.2.0",
|
|
26
|
+
"@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common": "23.2.0"
|
|
27
27
|
},
|
|
28
28
|
"main": "index.js",
|
|
29
29
|
"module": "index.js",
|
|
@@ -95,30 +95,30 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
95
95
|
const markdownDetails = [
|
|
96
96
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
97
97
|
( localize(
|
|
98
|
-
|
|
98
|
+
13259,
|
|
99
99
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
100
100
|
)) :
|
|
101
101
|
( localize(
|
|
102
|
-
|
|
102
|
+
13260,
|
|
103
103
|
"You are trying to open untrusted files in a window which is trusted."
|
|
104
104
|
)),
|
|
105
105
|
( localize(
|
|
106
|
-
|
|
106
|
+
13261,
|
|
107
107
|
"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."
|
|
108
108
|
))
|
|
109
109
|
];
|
|
110
110
|
await this.dialogService.prompt({
|
|
111
111
|
type: Severity.Info,
|
|
112
112
|
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
113
|
-
( localize(
|
|
114
|
-
( localize(
|
|
113
|
+
( localize(13262, "Do you want to allow untrusted files in this workspace?")) :
|
|
114
|
+
( localize(13263, "Do you want to allow untrusted files in this window?")),
|
|
115
115
|
buttons: [
|
|
116
116
|
{
|
|
117
|
-
label: ( localize(
|
|
117
|
+
label: ( localize(13264, "&&Open")),
|
|
118
118
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
|
-
label: ( localize(
|
|
121
|
+
label: ( localize(13265, "Open in &&Restricted Mode")),
|
|
122
122
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.OpenInNewWindow, !!checkboxChecked)
|
|
123
123
|
}
|
|
124
124
|
],
|
|
@@ -126,7 +126,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
126
126
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
127
127
|
},
|
|
128
128
|
checkbox: {
|
|
129
|
-
label: ( localize(
|
|
129
|
+
label: ( localize(13266, "Remember my decision for all workspaces")),
|
|
130
130
|
checked: false
|
|
131
131
|
},
|
|
132
132
|
custom: {
|
|
@@ -138,19 +138,19 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
138
138
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
139
139
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
140
140
|
const message = this.useWorkspaceLanguage ?
|
|
141
|
-
( localize(
|
|
142
|
-
( localize(
|
|
141
|
+
( localize(13267, "Do you trust the authors of the files in this workspace?")) :
|
|
142
|
+
( localize(13268, "Do you trust the authors of the files in this folder?"));
|
|
143
143
|
const defaultDetails = ( localize(
|
|
144
|
-
|
|
144
|
+
13269,
|
|
145
145
|
"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."
|
|
146
146
|
));
|
|
147
147
|
const details = requestOptions?.message ?? defaultDetails;
|
|
148
148
|
const buttons = requestOptions?.buttons ?? [
|
|
149
|
-
{ label: this.useWorkspaceLanguage ? ( localize(
|
|
150
|
-
{ label: ( localize(
|
|
149
|
+
{ label: this.useWorkspaceLanguage ? ( localize(13270, "&&Trust Workspace & Continue")) : ( localize(13271, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
|
|
150
|
+
{ label: ( localize(13272, "&&Manage")), type: 'Manage' }
|
|
151
151
|
];
|
|
152
152
|
if (!( buttons.some(b => b.type === 'Cancel'))) {
|
|
153
|
-
buttons.push({ label: ( localize(
|
|
153
|
+
buttons.push({ label: ( localize(13273, "Cancel")), type: 'Cancel' });
|
|
154
154
|
}
|
|
155
155
|
const { result } = await this.dialogService.prompt({
|
|
156
156
|
type: Severity.Info,
|
|
@@ -160,7 +160,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
160
160
|
markdownDetails: [
|
|
161
161
|
{ markdown: ( new MarkdownString(details)) },
|
|
162
162
|
{ markdown: ( new MarkdownString(( localize(
|
|
163
|
-
|
|
163
|
+
13274,
|
|
164
164
|
"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."
|
|
165
165
|
)))) }
|
|
166
166
|
]
|
|
@@ -261,12 +261,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
261
261
|
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
262
262
|
const { confirmed } = await this.dialogService.confirm({
|
|
263
263
|
type: Severity.Info,
|
|
264
|
-
message: ( localize(
|
|
264
|
+
message: ( localize(13275, "Do you trust the authors of the files in this folder?")),
|
|
265
265
|
detail: ( localize(
|
|
266
|
-
|
|
266
|
+
13276,
|
|
267
267
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
268
268
|
)),
|
|
269
|
-
cancelButton: ( localize(
|
|
269
|
+
cancelButton: ( localize(13277, 'No')),
|
|
270
270
|
custom: { icon: Codicon.shield }
|
|
271
271
|
});
|
|
272
272
|
await this.workspaceTrustManagementService.setUrisTrust(( addedFoldersTrustInfo.map(i => i.uri)), confirmed);
|
|
@@ -294,30 +294,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
294
294
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
295
295
|
}
|
|
296
296
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
297
|
-
( localize(
|
|
298
|
-
( localize(
|
|
297
|
+
( localize(13267, "Do you trust the authors of the files in this workspace?")) :
|
|
298
|
+
( localize(13268, "Do you trust the authors of the files in this folder?")));
|
|
299
299
|
let checkboxText;
|
|
300
300
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
301
301
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
302
302
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
303
303
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
304
304
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
305
|
-
checkboxText = ( localize(
|
|
305
|
+
checkboxText = ( localize(13278, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
306
306
|
}
|
|
307
|
-
this.doShowModal(title, { label: trustOption ?? ( localize(
|
|
307
|
+
this.doShowModal(title, { label: trustOption ?? ( localize(13279, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(13280, "Trust folder and enable all features")) : ( localize(13281, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localize(13282, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(13283, "Browse folder in restricted mode")) : ( localize(13284, "Browse workspace in restricted mode")) }, [
|
|
308
308
|
!isSingleFolderWorkspace ?
|
|
309
309
|
( localize(
|
|
310
|
-
|
|
310
|
+
13285,
|
|
311
311
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
312
312
|
this.productService.nameShort
|
|
313
313
|
)) :
|
|
314
314
|
( localize(
|
|
315
|
-
|
|
315
|
+
13286,
|
|
316
316
|
"{0} provides features that may automatically execute files in this folder.",
|
|
317
317
|
this.productService.nameShort
|
|
318
318
|
)),
|
|
319
319
|
learnMoreString ?? ( localize(
|
|
320
|
-
|
|
320
|
+
13287,
|
|
321
321
|
"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."
|
|
322
322
|
)),
|
|
323
323
|
!isEmptyWindow ?
|
|
@@ -435,11 +435,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
435
435
|
}
|
|
436
436
|
const actions = [
|
|
437
437
|
{
|
|
438
|
-
label: ( localize(
|
|
438
|
+
label: ( localize(13288, "Manage")),
|
|
439
439
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
440
440
|
},
|
|
441
441
|
{
|
|
442
|
-
label: ( localize(
|
|
442
|
+
label: ( localize(13289, "Learn More")),
|
|
443
443
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
444
444
|
}
|
|
445
445
|
];
|
|
@@ -460,17 +460,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
460
460
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
461
461
|
case WorkbenchState.EMPTY:
|
|
462
462
|
return localize(
|
|
463
|
-
|
|
463
|
+
13290,
|
|
464
464
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
465
465
|
);
|
|
466
466
|
case WorkbenchState.FOLDER:
|
|
467
467
|
return localize(
|
|
468
|
-
|
|
468
|
+
13291,
|
|
469
469
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
470
470
|
);
|
|
471
471
|
case WorkbenchState.WORKSPACE:
|
|
472
472
|
return localize(
|
|
473
|
-
|
|
473
|
+
13292,
|
|
474
474
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
475
475
|
);
|
|
476
476
|
}
|
|
@@ -479,17 +479,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
479
479
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
480
480
|
case WorkbenchState.EMPTY:
|
|
481
481
|
return localize(
|
|
482
|
-
|
|
482
|
+
13293,
|
|
483
483
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
484
484
|
);
|
|
485
485
|
case WorkbenchState.FOLDER:
|
|
486
486
|
return localize(
|
|
487
|
-
|
|
487
|
+
13294,
|
|
488
488
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
489
489
|
);
|
|
490
490
|
case WorkbenchState.WORKSPACE:
|
|
491
491
|
return localize(
|
|
492
|
-
|
|
492
|
+
13295,
|
|
493
493
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
494
494
|
);
|
|
495
495
|
}
|
|
@@ -507,12 +507,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
507
507
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
508
508
|
case WorkbenchState.EMPTY: {
|
|
509
509
|
ariaLabel = ( localize(
|
|
510
|
-
|
|
510
|
+
13296,
|
|
511
511
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
512
512
|
));
|
|
513
513
|
toolTip = {
|
|
514
514
|
value: ( localize(
|
|
515
|
-
|
|
515
|
+
13297,
|
|
516
516
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
517
517
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
518
518
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -524,12 +524,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
524
524
|
}
|
|
525
525
|
case WorkbenchState.FOLDER: {
|
|
526
526
|
ariaLabel = ( localize(
|
|
527
|
-
|
|
527
|
+
13298,
|
|
528
528
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
529
529
|
));
|
|
530
530
|
toolTip = {
|
|
531
531
|
value: ( localize(
|
|
532
|
-
|
|
532
|
+
13299,
|
|
533
533
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
534
534
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
535
535
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -541,12 +541,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
541
541
|
}
|
|
542
542
|
case WorkbenchState.WORKSPACE: {
|
|
543
543
|
ariaLabel = ( localize(
|
|
544
|
-
|
|
544
|
+
13300,
|
|
545
545
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
546
546
|
));
|
|
547
547
|
toolTip = {
|
|
548
548
|
value: ( localize(
|
|
549
|
-
|
|
549
|
+
13301,
|
|
550
550
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
551
551
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
552
552
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -558,8 +558,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
return {
|
|
561
|
-
name: ( localize(
|
|
562
|
-
text: `$(shield) ${( localize(
|
|
561
|
+
name: ( localize(13302, "Workspace Trust")),
|
|
562
|
+
text: `$(shield) ${( localize(13303, "Restricted Mode"))}`,
|
|
563
563
|
ariaLabel: ariaLabel,
|
|
564
564
|
tooltip: toolTip,
|
|
565
565
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -609,16 +609,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
609
609
|
}
|
|
610
610
|
( Registry.as(EditorExtensions.EditorFactory))
|
|
611
611
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
612
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
612
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(13304, "Workspace Trust Editor"))), [
|
|
613
613
|
( new SyncDescriptor(WorkspaceTrustEditorInput))
|
|
614
614
|
]);
|
|
615
615
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
616
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
616
|
+
const WORKSPACES_CATEGORY = ( localize2(13305, 'Workspaces'));
|
|
617
617
|
registerAction2(class extends Action2 {
|
|
618
618
|
constructor() {
|
|
619
619
|
super({
|
|
620
620
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
621
|
-
title: ( localize2(
|
|
621
|
+
title: ( localize2(13306, "Configure Workspace Trust Settings")),
|
|
622
622
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
623
623
|
category: WORKSPACES_CATEGORY,
|
|
624
624
|
f1: 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(13307, "Manage Workspace Trust")),
|
|
636
636
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
637
637
|
category: WORKSPACES_CATEGORY,
|
|
638
638
|
f1: true,
|
|
@@ -654,7 +654,7 @@ registerAction2(class extends Action2 {
|
|
|
654
654
|
type: 'boolean',
|
|
655
655
|
default: true,
|
|
656
656
|
description: ( localize(
|
|
657
|
-
|
|
657
|
+
13308,
|
|
658
658
|
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
659
659
|
)),
|
|
660
660
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -663,37 +663,37 @@ registerAction2(class extends Action2 {
|
|
|
663
663
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
664
664
|
type: 'string',
|
|
665
665
|
default: 'once',
|
|
666
|
-
description: ( localize(
|
|
666
|
+
description: ( localize(13309, "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(13310, "Ask for trust every time an untrusted workspace is opened.")),
|
|
672
|
+
( localize(13311, "Ask for trust the first time an untrusted workspace is opened.")),
|
|
673
|
+
( localize(13312, "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(13313, "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(13314, "Show the banner every time an untrusted workspace is open.")),
|
|
685
685
|
( localize(
|
|
686
|
-
|
|
686
|
+
13315,
|
|
687
687
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
688
688
|
)),
|
|
689
|
-
( localize(
|
|
689
|
+
( localize(13316, "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
|
+
13317,
|
|
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
|
+
13318,
|
|
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
|
+
13319,
|
|
710
710
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
711
711
|
)),
|
|
712
712
|
( localize(
|
|
713
|
-
|
|
713
|
+
13320,
|
|
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
|
+
13321,
|
|
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
|
)),
|
|
@@ -45,7 +45,7 @@ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/t
|
|
|
45
45
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
46
46
|
import { IWorkspaceTrustManagementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
47
47
|
import { EditorPane } from '@codingame/monaco-vscode-60014c9d-b815-501d-83a9-4b08725c2ec2-common/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
48
|
-
import { debugIconStartForeground } from '@codingame/monaco-vscode-
|
|
48
|
+
import { debugIconStartForeground } from '@codingame/monaco-vscode-2c64d2c2-fdf7-5675-a2fe-f6f65fbdedbf-common/vscode/vs/workbench/contrib/debug/browser/debugColors';
|
|
49
49
|
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
50
50
|
import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
|
|
51
51
|
import { APPLICATION_SCOPES } from '@codingame/monaco-vscode-ce7c734f-7712-563c-9335-d7acb43306af-common/vscode/vs/workbench/services/configuration/common/configuration';
|
|
@@ -66,12 +66,12 @@ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
66
66
|
import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
67
67
|
|
|
68
68
|
var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
|
|
69
|
-
const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, ( localize(
|
|
70
|
-
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localize(
|
|
71
|
-
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localize(
|
|
72
|
-
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localize(
|
|
73
|
-
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize(
|
|
74
|
-
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(
|
|
69
|
+
const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, ( localize(13322, 'Icon for workspace trust ion the banner.')));
|
|
70
|
+
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localize(13323, 'Icon for the checkmark in the workspace trust editor.')));
|
|
71
|
+
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localize(13324, 'Icon for the cross in the workspace trust editor.')));
|
|
72
|
+
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localize(13325, 'Icon for the pick folder icon in the workspace trust editor.')));
|
|
73
|
+
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize(13326, 'Icon for the edit folder icon in the workspace trust editor.')));
|
|
74
|
+
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(13327, 'Icon for the remove folder icon in the workspace trust editor.')));
|
|
75
75
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
76
76
|
constructor(container, instantiationService, workspaceService, workspaceTrustManagementService, uriService, labelService, fileDialogService) {
|
|
77
77
|
super();
|
|
@@ -95,14 +95,14 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
95
95
|
const addButtonBarElement = container.appendChild($('.trusted-uris-button-bar'));
|
|
96
96
|
this.table = this.instantiationService.createInstance(WorkbenchTable, 'WorkspaceTrust', tableElement, ( new TrustedUriTableVirtualDelegate()), [
|
|
97
97
|
{
|
|
98
|
-
label: ( localize(
|
|
98
|
+
label: ( localize(13328, "Host")),
|
|
99
99
|
tooltip: '',
|
|
100
100
|
weight: 1,
|
|
101
101
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
102
102
|
project(row) { return row; }
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
label: ( localize(
|
|
105
|
+
label: ( localize(13329, "Path")),
|
|
106
106
|
tooltip: '',
|
|
107
107
|
weight: 8,
|
|
108
108
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -130,16 +130,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
130
130
|
getAriaLabel: (item) => {
|
|
131
131
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
132
132
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
133
|
-
return localize(
|
|
133
|
+
return localize(13330, "{0}, trusted", this.labelService.getUriLabel(item.uri));
|
|
134
134
|
}
|
|
135
135
|
return localize(
|
|
136
|
-
|
|
136
|
+
13331,
|
|
137
137
|
"{0} on {1}, trusted",
|
|
138
138
|
this.labelService.getUriLabel(item.uri),
|
|
139
139
|
hostLabel
|
|
140
140
|
);
|
|
141
141
|
},
|
|
142
|
-
getWidgetAriaLabel: () => ( localize(
|
|
142
|
+
getWidgetAriaLabel: () => ( localize(13332, "Trusted Folders & Workspaces"))
|
|
143
143
|
},
|
|
144
144
|
identityProvider: {
|
|
145
145
|
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(13333, "Add Folder")), ...defaultButtonStyles }));
|
|
157
|
+
addButton.label = ( localize(13333, "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(13334, "Trust Folder")),
|
|
165
|
+
title: ( localize(13335, "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
|
+
13336,
|
|
247
247
|
"You trust the following folders, their subfolders, and workspace files."
|
|
248
248
|
)) :
|
|
249
|
-
( localize(
|
|
249
|
+
( localize(13337, "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
|
+
13338,
|
|
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
|
+
13339,
|
|
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(13340, "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(13334, "Trust Folder")),
|
|
325
|
+
title: ( localize(13335, "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(13341, "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(13342, "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(13343, "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(13344, "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(13345, "This window is trusted");
|
|
667
667
|
}
|
|
668
668
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
669
669
|
case WorkbenchState.EMPTY:
|
|
670
|
-
return localize(
|
|
670
|
+
return localize(13346, "You trust this window");
|
|
671
671
|
case WorkbenchState.FOLDER:
|
|
672
|
-
return localize(
|
|
672
|
+
return localize(13347, "You trust this folder");
|
|
673
673
|
case WorkbenchState.WORKSPACE:
|
|
674
|
-
return localize(
|
|
674
|
+
return localize(13348, "You trust this workspace");
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
return localize(
|
|
677
|
+
return localize(13349, "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(13350, "In a Trusted Window")) : ( localize(13351, "In Restricted Mode"));
|
|
688
688
|
subTitle = trusted ? ( localize(
|
|
689
|
-
|
|
689
|
+
13352,
|
|
690
690
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
691
691
|
)) :
|
|
692
692
|
( localize(
|
|
693
|
-
|
|
693
|
+
13353,
|
|
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(13354, "In a Trusted Folder")) : ( localize(13351, "In Restricted Mode"));
|
|
700
700
|
subTitle = trusted ? ( localize(
|
|
701
|
-
|
|
701
|
+
13355,
|
|
702
702
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
703
703
|
)) :
|
|
704
704
|
( localize(
|
|
705
|
-
|
|
705
|
+
13356,
|
|
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(13357, "In a Trusted Workspace")) : ( localize(13351, "In Restricted Mode"));
|
|
712
712
|
subTitle = trusted ? ( localize(
|
|
713
|
-
|
|
713
|
+
13358,
|
|
714
714
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
715
715
|
)) :
|
|
716
716
|
( localize(
|
|
717
|
-
|
|
717
|
+
13359,
|
|
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
|
+
13360,
|
|
742
742
|
"All features are enabled because trust has been granted to the workspace."
|
|
743
743
|
)) :
|
|
744
744
|
( localize(
|
|
745
|
-
|
|
745
|
+
13361,
|
|
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
|
+
13362,
|
|
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(13363, "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(13332, "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(13364, "Tasks are allowed to run")),
|
|
845
|
+
( localize(13365, "Debugging is enabled")),
|
|
846
|
+
( localize(13366, "All enabled extensions are activated"))
|
|
847
847
|
] :
|
|
848
848
|
[
|
|
849
|
-
( localize(
|
|
850
|
-
( localize(
|
|
851
|
-
( localize(
|
|
852
|
-
( localize(
|
|
849
|
+
( localize(13364, "Tasks are allowed to run")),
|
|
850
|
+
( localize(13365, "Debugging is enabled")),
|
|
851
|
+
( localize(13367, "All workspace settings are applied")),
|
|
852
|
+
( localize(13366, "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(13368, "Tasks are not allowed to run")),
|
|
860
|
+
( localize(13369, "Debugging is disabled")),
|
|
861
861
|
fixBadLocalizedLinks(( localize(
|
|
862
|
-
|
|
862
|
+
13370,
|
|
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(13368, "Tasks are not allowed to run")),
|
|
870
|
+
( localize(13369, "Debugging is disabled")),
|
|
871
871
|
fixBadLocalizedLinks(numSettings ? ( localize(
|
|
872
|
-
|
|
872
|
+
13371,
|
|
873
873
|
"[{0} workspace settings]({1}) are not applied",
|
|
874
874
|
numSettings,
|
|
875
875
|
'command:settings.filterUntrusted'
|
|
876
|
-
)) : ( localize(
|
|
876
|
+
)) : ( localize(13372, "Workspace settings requiring trust are not applied"))),
|
|
877
877
|
fixBadLocalizedLinks(( localize(
|
|
878
|
-
|
|
878
|
+
13370,
|
|
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(13373, "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 = this.rerenderDisposables.add(( new Action('workspace.trust.button.action.grant', ( localize(
|
|
918
|
+
const trustAction = this.rerenderDisposables.add(( new Action('workspace.trust.button.action.grant', ( localize(13374, "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
|
+
13375,
|
|
928
928
|
"Trust the authors of all files in the current folder or its parent '{0}'.",
|
|
929
929
|
name
|
|
930
930
|
));
|
|
931
|
-
const trustParentAction = this.rerenderDisposables.add(( new Action('workspace.trust.button.action.grantParent', ( localize(
|
|
931
|
+
const trustParentAction = this.rerenderDisposables.add(( new Action('workspace.trust.button.action.grantParent', ( localize(13376, "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: this.rerenderDisposables.add(( new Action('workspace.trust.button.action.deny', ( localize(
|
|
940
|
+
action: this.rerenderDisposables.add(( new Action('workspace.trust.button.action.deny', ( localize(13377, "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
|
+
13378,
|
|
954
954
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
955
955
|
)) : ( localize(
|
|
956
|
-
|
|
956
|
+
13379,
|
|
957
957
|
"This folder is trusted via the bolded entries in the trusted folders below."
|
|
958
958
|
));
|
|
959
959
|
}
|
|
960
960
|
else {
|
|
961
|
-
textElement.innerText = ( localize(
|
|
961
|
+
textElement.innerText = ( localize(13380, "This window is trusted by nature of the workspace that is opened."));
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
964
|
renderLimitationsHeaderElement(parent, headerText, subtitleText) {
|
|
@@ -7,7 +7,7 @@ import { registerIcon } from '@codingame/monaco-vscode-api/vscode/vs/platform/th
|
|
|
7
7
|
import { EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
8
8
|
import { EditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput';
|
|
9
9
|
|
|
10
|
-
const WorkspaceTrustEditorIcon = registerIcon('workspace-trust-editor-label-icon', Codicon.shield, ( localize(
|
|
10
|
+
const WorkspaceTrustEditorIcon = registerIcon('workspace-trust-editor-label-icon', Codicon.shield, ( localize(14464, 'Icon of the workspace trust editor label.')));
|
|
11
11
|
class WorkspaceTrustEditorInput extends EditorInput {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
@@ -27,7 +27,7 @@ class WorkspaceTrustEditorInput extends EditorInput {
|
|
|
27
27
|
return super.matches(otherInput) || otherInput instanceof WorkspaceTrustEditorInput;
|
|
28
28
|
}
|
|
29
29
|
getName() {
|
|
30
|
-
return localize(
|
|
30
|
+
return localize(14465, "Workspace Trust");
|
|
31
31
|
}
|
|
32
32
|
getIcon() {
|
|
33
33
|
return WorkspaceTrustEditorIcon;
|