@codingame/monaco-vscode-workspace-trust-service-override 36.2.7 → 37.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 +2 -2
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +63 -63
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +67 -63
- 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": "37.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,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.2.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -64,13 +64,13 @@ function getSessionsWindowTrustNote(environmentService, productService, isWorksp
|
|
|
64
64
|
}
|
|
65
65
|
if (isWorkspace) {
|
|
66
66
|
return localize(
|
|
67
|
-
|
|
67
|
+
19127,
|
|
68
68
|
"Trusting this workspace will also mark it as trusted in {0}.",
|
|
69
69
|
productService.nameLong
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
return localize(
|
|
73
|
-
|
|
73
|
+
19128,
|
|
74
74
|
"Trusting this folder will also mark it as trusted in {0}.",
|
|
75
75
|
productService.nameLong
|
|
76
76
|
);
|
|
@@ -127,29 +127,29 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
127
127
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
128
128
|
const markdownDetails = [
|
|
129
129
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(
|
|
130
|
-
|
|
130
|
+
19129,
|
|
131
131
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
132
132
|
)) : ( localize(
|
|
133
|
-
|
|
133
|
+
19130,
|
|
134
134
|
"You are trying to open untrusted files in a window which is trusted."
|
|
135
135
|
)),
|
|
136
136
|
( localize(
|
|
137
|
-
|
|
137
|
+
19131,
|
|
138
138
|
"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."
|
|
139
139
|
))
|
|
140
140
|
];
|
|
141
141
|
await this.dialogService.prompt({
|
|
142
142
|
type: Severity.Info,
|
|
143
|
-
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(
|
|
143
|
+
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ? ( localize(19132, "Do you want to allow untrusted files in this workspace?")) : ( localize(19133, "Do you want to allow untrusted files in this window?")),
|
|
144
144
|
buttons: [{
|
|
145
|
-
label: ( localize(
|
|
145
|
+
label: ( localize(19134, "&&Open")),
|
|
146
146
|
run: (
|
|
147
147
|
{
|
|
148
148
|
checkboxChecked
|
|
149
149
|
}
|
|
150
150
|
) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
151
151
|
}, {
|
|
152
|
-
label: ( localize(
|
|
152
|
+
label: ( localize(19135, "Open in &&Restricted Mode")),
|
|
153
153
|
run: (
|
|
154
154
|
{
|
|
155
155
|
checkboxChecked
|
|
@@ -160,7 +160,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
160
160
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
161
161
|
},
|
|
162
162
|
checkbox: {
|
|
163
|
-
label: ( localize(
|
|
163
|
+
label: ( localize(19136, "Remember my decision for all workspaces")),
|
|
164
164
|
checked: false
|
|
165
165
|
},
|
|
166
166
|
custom: {
|
|
@@ -178,10 +178,10 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
178
178
|
this.workspaceTrustRequestService.onDidInitiateResourcesTrustRequest(async options => {
|
|
179
179
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
180
180
|
const markdownDetails = [options?.message ?? ( localize(
|
|
181
|
-
|
|
181
|
+
19137,
|
|
182
182
|
"You are trying to open an untrusted folder. Do you trust the authors of this content?"
|
|
183
183
|
)), ( localize(
|
|
184
|
-
|
|
184
|
+
19138,
|
|
185
185
|
"If you don't trust the authors of these files, we recommend not continuing as the files may be malicious. See [our docs](https://aka.ms/vscode-workspace-trust) to learn more."
|
|
186
186
|
)), `\`${this.labelService.getUriLabel(options.uri)}\``];
|
|
187
187
|
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, false);
|
|
@@ -190,9 +190,9 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
190
190
|
}
|
|
191
191
|
await this.dialogService.prompt({
|
|
192
192
|
type: Severity.Info,
|
|
193
|
-
message: ( localize(
|
|
193
|
+
message: ( localize(19139, "Do you trust the authors of the files in this folder?")),
|
|
194
194
|
buttons: [{
|
|
195
|
-
label: ( localize(
|
|
195
|
+
label: ( localize(19140, "&&Trust Folder & Continue")),
|
|
196
196
|
run: () => this.workspaceTrustRequestService.completeResourcesTrustRequest(options.uri, WorkspaceTrustUriResponse.Open)
|
|
197
197
|
}],
|
|
198
198
|
cancelButton: {
|
|
@@ -212,22 +212,22 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
212
212
|
this._register(
|
|
213
213
|
this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async requestOptions => {
|
|
214
214
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
215
|
-
const message = this.useWorkspaceLanguage ? ( localize(
|
|
215
|
+
const message = this.useWorkspaceLanguage ? ( localize(19141, "Do you trust the authors of the files in this workspace?")) : ( localize(19142, "Do you trust the authors of the files in this folder?"));
|
|
216
216
|
const defaultDetails = ( localize(
|
|
217
|
-
|
|
217
|
+
19143,
|
|
218
218
|
"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."
|
|
219
219
|
));
|
|
220
220
|
const details = requestOptions?.message ?? defaultDetails;
|
|
221
221
|
const buttons = requestOptions?.buttons ?? [{
|
|
222
|
-
label: this.useWorkspaceLanguage ? ( localize(
|
|
222
|
+
label: this.useWorkspaceLanguage ? ( localize(19144, "&&Trust Workspace & Continue")) : ( localize(19145, "&&Trust Folder & Continue")),
|
|
223
223
|
type: "ContinueWithTrust"
|
|
224
224
|
}, {
|
|
225
|
-
label: ( localize(
|
|
225
|
+
label: ( localize(19146, "&&Manage")),
|
|
226
226
|
type: "Manage"
|
|
227
227
|
}];
|
|
228
228
|
if (!( buttons.some(b => b.type === "Cancel"))) {
|
|
229
229
|
buttons.push({
|
|
230
|
-
label: ( localize(
|
|
230
|
+
label: ( localize(19147, "Cancel")),
|
|
231
231
|
type: "Cancel"
|
|
232
232
|
});
|
|
233
233
|
}
|
|
@@ -235,7 +235,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
235
235
|
markdown: ( new MarkdownString(details))
|
|
236
236
|
}, {
|
|
237
237
|
markdown: ( new MarkdownString(( localize(
|
|
238
|
-
|
|
238
|
+
19148,
|
|
239
239
|
"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."
|
|
240
240
|
))))
|
|
241
241
|
}];
|
|
@@ -359,7 +359,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
359
359
|
const addedFoldersTrustInfo = await Promise.all(( e.changes.added.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder.uri))));
|
|
360
360
|
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
361
361
|
let detail = ( localize(
|
|
362
|
-
|
|
362
|
+
19149,
|
|
363
363
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
364
364
|
));
|
|
365
365
|
const sessionsTrustNote = getSessionsWindowTrustNote(this.environmentService, this.productService, false);
|
|
@@ -370,9 +370,9 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
370
370
|
confirmed
|
|
371
371
|
} = await this.dialogService.confirm({
|
|
372
372
|
type: Severity.Info,
|
|
373
|
-
message: ( localize(
|
|
373
|
+
message: ( localize(19150, "Do you trust the authors of the files in this folder?")),
|
|
374
374
|
detail,
|
|
375
|
-
cancelButton: ( localize(
|
|
375
|
+
cancelButton: ( localize(19151, "No")),
|
|
376
376
|
custom: {
|
|
377
377
|
icon: Codicon.shield
|
|
378
378
|
}
|
|
@@ -401,25 +401,25 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
401
401
|
} else {
|
|
402
402
|
console.warn("AI generated workspace trust dialog contents not available.");
|
|
403
403
|
}
|
|
404
|
-
const title = titleString ?? (this.useWorkspaceLanguage ? ( localize(
|
|
404
|
+
const title = titleString ?? (this.useWorkspaceLanguage ? ( localize(19141, "Do you trust the authors of the files in this workspace?")) : ( localize(19142, "Do you trust the authors of the files in this folder?")));
|
|
405
405
|
let checkboxText;
|
|
406
406
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
407
407
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
408
408
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
409
409
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
410
410
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
411
|
-
checkboxText = ( localize(
|
|
411
|
+
checkboxText = ( localize(19152, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
412
412
|
}
|
|
413
413
|
const markdownStrings = [!isSingleFolderWorkspace ? ( localize(
|
|
414
|
-
|
|
414
|
+
19153,
|
|
415
415
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
416
416
|
this.productService.nameShort
|
|
417
417
|
)) : ( localize(
|
|
418
|
-
|
|
418
|
+
19154,
|
|
419
419
|
"{0} provides features that may automatically execute files in this folder.",
|
|
420
420
|
this.productService.nameShort
|
|
421
421
|
)), learnMoreString ?? ( localize(
|
|
422
|
-
|
|
422
|
+
19155,
|
|
423
423
|
"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."
|
|
424
424
|
)), !isEmptyWindow ? `\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, {
|
|
425
425
|
verbose: Verbosity.LONG
|
|
@@ -429,11 +429,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
429
429
|
markdownStrings.push(sessionsTrustNote);
|
|
430
430
|
}
|
|
431
431
|
this.doShowModal(title, {
|
|
432
|
-
label: trustOption ?? ( localize(
|
|
433
|
-
sublabel: isSingleFolderWorkspace ? ( localize(
|
|
432
|
+
label: trustOption ?? ( localize(19156, "&&Yes, I trust the authors")),
|
|
433
|
+
sublabel: isSingleFolderWorkspace ? ( localize(19157, "Trust folder and enable all features")) : ( localize(19158, "Trust workspace and enable all features"))
|
|
434
434
|
}, {
|
|
435
|
-
label: dontTrustOption ?? ( localize(
|
|
436
|
-
sublabel: isSingleFolderWorkspace ? ( localize(
|
|
435
|
+
label: dontTrustOption ?? ( localize(19159, "&&No, I don't trust the authors")),
|
|
436
|
+
sublabel: isSingleFolderWorkspace ? ( localize(19160, "Open folder in restricted mode")) : ( localize(19161, "Open workspace in restricted mode"))
|
|
437
437
|
}, markdownStrings, checkboxText);
|
|
438
438
|
})
|
|
439
439
|
);
|
|
@@ -556,10 +556,10 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
556
556
|
return undefined;
|
|
557
557
|
}
|
|
558
558
|
const actions = [{
|
|
559
|
-
label: ( localize(
|
|
559
|
+
label: ( localize(19162, "Manage")),
|
|
560
560
|
href: "command:" + MANAGE_TRUST_COMMAND_ID
|
|
561
561
|
}, {
|
|
562
|
-
label: ( localize(
|
|
562
|
+
label: ( localize(19163, "Learn More")),
|
|
563
563
|
href: "https://aka.ms/vscode-workspace-trust"
|
|
564
564
|
}];
|
|
565
565
|
return {
|
|
@@ -584,17 +584,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
584
584
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
585
585
|
case WorkbenchState.EMPTY:
|
|
586
586
|
return localize(
|
|
587
|
-
|
|
587
|
+
19164,
|
|
588
588
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
589
589
|
);
|
|
590
590
|
case WorkbenchState.FOLDER:
|
|
591
591
|
return localize(
|
|
592
|
-
|
|
592
|
+
19165,
|
|
593
593
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
594
594
|
);
|
|
595
595
|
case WorkbenchState.WORKSPACE:
|
|
596
596
|
return localize(
|
|
597
|
-
|
|
597
|
+
19166,
|
|
598
598
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
599
599
|
);
|
|
600
600
|
}
|
|
@@ -603,17 +603,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
603
603
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
604
604
|
case WorkbenchState.EMPTY:
|
|
605
605
|
return localize(
|
|
606
|
-
|
|
606
|
+
19167,
|
|
607
607
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
608
608
|
);
|
|
609
609
|
case WorkbenchState.FOLDER:
|
|
610
610
|
return localize(
|
|
611
|
-
|
|
611
|
+
19168,
|
|
612
612
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
613
613
|
);
|
|
614
614
|
case WorkbenchState.WORKSPACE:
|
|
615
615
|
return localize(
|
|
616
|
-
|
|
616
|
+
19169,
|
|
617
617
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
618
618
|
);
|
|
619
619
|
}
|
|
@@ -632,12 +632,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
632
632
|
case WorkbenchState.EMPTY:
|
|
633
633
|
{
|
|
634
634
|
ariaLabel = ( localize(
|
|
635
|
-
|
|
635
|
+
19170,
|
|
636
636
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
637
637
|
));
|
|
638
638
|
toolTip = {
|
|
639
639
|
value: ( localize(
|
|
640
|
-
|
|
640
|
+
19171,
|
|
641
641
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
642
642
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
643
643
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -650,12 +650,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
650
650
|
case WorkbenchState.FOLDER:
|
|
651
651
|
{
|
|
652
652
|
ariaLabel = ( localize(
|
|
653
|
-
|
|
653
|
+
19172,
|
|
654
654
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
655
655
|
));
|
|
656
656
|
toolTip = {
|
|
657
657
|
value: ( localize(
|
|
658
|
-
|
|
658
|
+
19173,
|
|
659
659
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
660
660
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
661
661
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -668,12 +668,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
668
668
|
case WorkbenchState.WORKSPACE:
|
|
669
669
|
{
|
|
670
670
|
ariaLabel = ( localize(
|
|
671
|
-
|
|
671
|
+
19174,
|
|
672
672
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
673
673
|
));
|
|
674
674
|
toolTip = {
|
|
675
675
|
value: ( localize(
|
|
676
|
-
|
|
676
|
+
19175,
|
|
677
677
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
678
678
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
679
679
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -685,8 +685,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
return {
|
|
688
|
-
name: ( localize(
|
|
689
|
-
text: `$(shield) ${( localize(
|
|
688
|
+
name: ( localize(19176, "Workspace Trust")),
|
|
689
|
+
text: `$(shield) ${( localize(19177, "Restricted Mode"))}`,
|
|
690
690
|
ariaLabel: ariaLabel,
|
|
691
691
|
tooltip: toolTip,
|
|
692
692
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -730,16 +730,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
730
730
|
}
|
|
731
731
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
732
732
|
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
733
|
-
EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
733
|
+
EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(19178, "Workspace Trust Editor"))),
|
|
734
734
|
[( new SyncDescriptor(WorkspaceTrustEditorInput))]
|
|
735
735
|
);
|
|
736
736
|
const CONFIGURE_TRUST_COMMAND_ID = "workbench.trust.configure";
|
|
737
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
737
|
+
const WORKSPACES_CATEGORY = ( localize2(19179, "Workspaces"));
|
|
738
738
|
registerAction2(class extends Action2 {
|
|
739
739
|
constructor() {
|
|
740
740
|
super({
|
|
741
741
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
742
|
-
title: ( localize2(
|
|
742
|
+
title: ( localize2(19180, "Configure Workspace Trust Settings")),
|
|
743
743
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
744
744
|
category: WORKSPACES_CATEGORY,
|
|
745
745
|
f1: true
|
|
@@ -756,7 +756,7 @@ registerAction2(class extends Action2 {
|
|
|
756
756
|
constructor() {
|
|
757
757
|
super({
|
|
758
758
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
759
|
-
title: ( localize2(
|
|
759
|
+
title: ( localize2(19181, "Manage Workspace Trust")),
|
|
760
760
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
761
761
|
category: WORKSPACES_CATEGORY,
|
|
762
762
|
f1: true
|
|
@@ -779,7 +779,7 @@ registerAction2(class extends Action2 {
|
|
|
779
779
|
type: "boolean",
|
|
780
780
|
default: true,
|
|
781
781
|
description: ( localize(
|
|
782
|
-
|
|
782
|
+
19182,
|
|
783
783
|
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
784
784
|
)),
|
|
785
785
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -788,29 +788,29 @@ registerAction2(class extends Action2 {
|
|
|
788
788
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
789
789
|
type: "string",
|
|
790
790
|
default: "never",
|
|
791
|
-
description: ( localize(
|
|
791
|
+
description: ( localize(19183, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
792
792
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
793
793
|
scope: ConfigurationScope.APPLICATION,
|
|
794
794
|
enum: ["always", "once", "never"],
|
|
795
|
-
enumDescriptions: [( localize(
|
|
795
|
+
enumDescriptions: [( localize(19184, "Ask for trust every time an untrusted workspace is opened.")), ( localize(19185, "Ask for trust the first time an untrusted workspace is opened.")), ( localize(19186, "Do not ask for trust when an untrusted workspace is opened."))]
|
|
796
796
|
},
|
|
797
797
|
[WORKSPACE_TRUST_BANNER]: {
|
|
798
798
|
type: "string",
|
|
799
799
|
default: "untilDismissed",
|
|
800
|
-
description: ( localize(
|
|
800
|
+
description: ( localize(19187, "Controls when the restricted mode banner is shown.")),
|
|
801
801
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
802
802
|
scope: ConfigurationScope.APPLICATION,
|
|
803
803
|
enum: ["always", "untilDismissed", "never"],
|
|
804
|
-
enumDescriptions: [( localize(
|
|
805
|
-
|
|
804
|
+
enumDescriptions: [( localize(19188, "Show the banner every time an untrusted workspace is open.")), ( localize(
|
|
805
|
+
19189,
|
|
806
806
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
807
|
-
)), ( localize(
|
|
807
|
+
)), ( localize(19190, "Do not show the banner when an untrusted workspace is open."))]
|
|
808
808
|
},
|
|
809
809
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
810
810
|
type: "string",
|
|
811
811
|
default: "prompt",
|
|
812
812
|
markdownDescription: ( localize(
|
|
813
|
-
|
|
813
|
+
19191,
|
|
814
814
|
"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}#`.",
|
|
815
815
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
816
816
|
)),
|
|
@@ -818,13 +818,13 @@ registerAction2(class extends Action2 {
|
|
|
818
818
|
scope: ConfigurationScope.APPLICATION,
|
|
819
819
|
enum: ["prompt", "open", "newWindow"],
|
|
820
820
|
enumDescriptions: [( localize(
|
|
821
|
-
|
|
821
|
+
19192,
|
|
822
822
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
823
823
|
)), ( localize(
|
|
824
|
-
|
|
824
|
+
19193,
|
|
825
825
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
826
826
|
)), ( localize(
|
|
827
|
-
|
|
827
|
+
19194,
|
|
828
828
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
829
829
|
))]
|
|
830
830
|
},
|
|
@@ -832,7 +832,7 @@ registerAction2(class extends Action2 {
|
|
|
832
832
|
type: "boolean",
|
|
833
833
|
default: true,
|
|
834
834
|
markdownDescription: ( localize(
|
|
835
|
-
|
|
835
|
+
19195,
|
|
836
836
|
"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.",
|
|
837
837
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
838
838
|
)),
|
|
@@ -65,12 +65,12 @@ import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/
|
|
|
65
65
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
66
66
|
|
|
67
67
|
var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
|
|
68
|
-
const shieldIcon = registerIcon("workspace-trust-banner", Codicon.shield, ( localize(
|
|
69
|
-
const checkListIcon = registerIcon("workspace-trust-editor-check", Codicon.check, ( localize(
|
|
70
|
-
const xListIcon = registerIcon("workspace-trust-editor-cross", Codicon.x, ( localize(
|
|
71
|
-
const folderPickerIcon = registerIcon("workspace-trust-editor-folder-picker", Codicon.folder, ( localize(
|
|
72
|
-
const editIcon = registerIcon("workspace-trust-editor-edit-folder", Codicon.edit, ( localize(
|
|
73
|
-
const removeIcon = registerIcon("workspace-trust-editor-remove-folder", Codicon.close, ( localize(
|
|
68
|
+
const shieldIcon = registerIcon("workspace-trust-banner", Codicon.shield, ( localize(19196, "Icon for workspace trust ion the banner.")));
|
|
69
|
+
const checkListIcon = registerIcon("workspace-trust-editor-check", Codicon.check, ( localize(19197, "Icon for the checkmark in the workspace trust editor.")));
|
|
70
|
+
const xListIcon = registerIcon("workspace-trust-editor-cross", Codicon.x, ( localize(19198, "Icon for the cross in the workspace trust editor.")));
|
|
71
|
+
const folderPickerIcon = registerIcon("workspace-trust-editor-folder-picker", Codicon.folder, ( localize(19199, "Icon for the pick folder icon in the workspace trust editor.")));
|
|
72
|
+
const editIcon = registerIcon("workspace-trust-editor-edit-folder", Codicon.edit, ( localize(19200, "Icon for the edit folder icon in the workspace trust editor.")));
|
|
73
|
+
const removeIcon = registerIcon("workspace-trust-editor-remove-folder", Codicon.close, ( localize(19201, "Icon for the remove folder icon in the workspace trust editor.")));
|
|
74
74
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
75
75
|
constructor(
|
|
76
76
|
container,
|
|
@@ -101,7 +101,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
101
101
|
const tableElement = container.appendChild($(".trusted-uris-table"));
|
|
102
102
|
const addButtonBarElement = container.appendChild($(".trusted-uris-button-bar"));
|
|
103
103
|
this.table = this.instantiationService.createInstance(WorkbenchTable, "WorkspaceTrust", tableElement, ( new TrustedUriTableVirtualDelegate()), [{
|
|
104
|
-
label: ( localize(
|
|
104
|
+
label: ( localize(19202, "Host")),
|
|
105
105
|
tooltip: "",
|
|
106
106
|
weight: 1,
|
|
107
107
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
@@ -109,7 +109,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
109
109
|
return row;
|
|
110
110
|
}
|
|
111
111
|
}, {
|
|
112
|
-
label: ( localize(
|
|
112
|
+
label: ( localize(19203, "Path")),
|
|
113
113
|
tooltip: "",
|
|
114
114
|
weight: 8,
|
|
115
115
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -139,16 +139,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
139
139
|
getAriaLabel: item => {
|
|
140
140
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
141
141
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
142
|
-
return localize(
|
|
142
|
+
return localize(19204, "{0}, trusted", this.labelService.getUriLabel(item.uri));
|
|
143
143
|
}
|
|
144
144
|
return localize(
|
|
145
|
-
|
|
145
|
+
19205,
|
|
146
146
|
"{0} on {1}, trusted",
|
|
147
147
|
this.labelService.getUriLabel(item.uri),
|
|
148
148
|
hostLabel
|
|
149
149
|
);
|
|
150
150
|
},
|
|
151
|
-
getWidgetAriaLabel: () => ( localize(
|
|
151
|
+
getWidgetAriaLabel: () => ( localize(19206, "Trusted Folders & Workspaces"))
|
|
152
152
|
},
|
|
153
153
|
identityProvider: {
|
|
154
154
|
getId(element) {
|
|
@@ -163,18 +163,18 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
163
163
|
}));
|
|
164
164
|
const buttonBar = this._register(( new ButtonBar(addButtonBarElement)));
|
|
165
165
|
const addButton = this._register(buttonBar.addButton({
|
|
166
|
-
title: ( localize(
|
|
166
|
+
title: ( localize(19207, "Add Folder")),
|
|
167
167
|
...defaultButtonStyles
|
|
168
168
|
}));
|
|
169
|
-
addButton.label = ( localize(
|
|
169
|
+
addButton.label = ( localize(19207, "Add Folder"));
|
|
170
170
|
this._register(addButton.onDidClick(async () => {
|
|
171
171
|
const uri = await this.fileDialogService.showOpenDialog({
|
|
172
172
|
canSelectFiles: false,
|
|
173
173
|
canSelectFolders: true,
|
|
174
174
|
canSelectMany: false,
|
|
175
175
|
defaultUri: this.currentWorkspaceUri,
|
|
176
|
-
openLabel: ( localize(
|
|
177
|
-
title: ( localize(
|
|
176
|
+
openLabel: ( localize(19208, "Trust Folder")),
|
|
177
|
+
title: ( localize(19209, "Select Folder To Trust"))
|
|
178
178
|
});
|
|
179
179
|
if (uri) {
|
|
180
180
|
this.workspaceTrustManagementService.setUrisTrust(uri, true);
|
|
@@ -257,9 +257,9 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
257
257
|
const entries = this.trustedUriEntries;
|
|
258
258
|
this.container.classList.toggle("empty", entries.length === 0);
|
|
259
259
|
this.descriptionElement.innerText = entries.length ? ( localize(
|
|
260
|
-
|
|
260
|
+
19210,
|
|
261
261
|
"You trust the following folders, their subfolders, and workspace files."
|
|
262
|
-
)) : ( localize(
|
|
262
|
+
)) : ( localize(19211, "You haven't trusted any folders or workspace files yet."));
|
|
263
263
|
this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
|
|
264
264
|
this.layout();
|
|
265
265
|
}
|
|
@@ -273,7 +273,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
273
273
|
return {
|
|
274
274
|
type: MessageType.WARNING,
|
|
275
275
|
content: ( localize(
|
|
276
|
-
|
|
276
|
+
19212,
|
|
277
277
|
"You will trust all repositories on {0}.",
|
|
278
278
|
getHostLabel(this.labelService, item)
|
|
279
279
|
))
|
|
@@ -283,7 +283,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
283
283
|
return {
|
|
284
284
|
type: MessageType.WARNING,
|
|
285
285
|
content: ( localize(
|
|
286
|
-
|
|
286
|
+
19213,
|
|
287
287
|
"You will trust all repositories and forks under '{0}' on {1}.",
|
|
288
288
|
segments[0],
|
|
289
289
|
getHostLabel(this.labelService, item)
|
|
@@ -293,7 +293,7 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
293
293
|
if (segments.length > 2) {
|
|
294
294
|
return {
|
|
295
295
|
type: MessageType.ERROR,
|
|
296
|
-
content: ( localize(
|
|
296
|
+
content: ( localize(19214, "You cannot trust individual folders within a repository.", path))
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
299
|
}
|
|
@@ -314,13 +314,17 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
314
314
|
this._onDidRejectEdit.fire(item);
|
|
315
315
|
}
|
|
316
316
|
async delete(item) {
|
|
317
|
-
this.table.
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
317
|
+
const index = this.table.indexOf(item);
|
|
318
|
+
if (index < this.table.length - 1) {
|
|
319
|
+
this.table.setFocus([index + 1]);
|
|
320
|
+
} else if (index > 0) {
|
|
321
|
+
this.table.setFocus([index - 1]);
|
|
322
|
+
} else {
|
|
323
|
+
this.table.setFocus([]);
|
|
321
324
|
}
|
|
322
|
-
this._onDelete.fire(item);
|
|
323
325
|
this.table.domFocus();
|
|
326
|
+
await this.workspaceTrustManagementService.setUrisTrust([item.uri], false);
|
|
327
|
+
this._onDelete.fire(item);
|
|
324
328
|
}
|
|
325
329
|
async edit(item, usePickerIfPossible) {
|
|
326
330
|
const canUseOpenDialog = item.uri.scheme === Schemas.file || (item.uri.scheme === this.currentWorkspaceUri.scheme && this.uriService.extUri.isEqualAuthority(this.currentWorkspaceUri.authority, item.uri.authority) && !isVirtualResource(item.uri));
|
|
@@ -330,8 +334,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
330
334
|
canSelectFolders: true,
|
|
331
335
|
canSelectMany: false,
|
|
332
336
|
defaultUri: item.uri,
|
|
333
|
-
openLabel: ( localize(
|
|
334
|
-
title: ( localize(
|
|
337
|
+
openLabel: ( localize(19208, "Trust Folder")),
|
|
338
|
+
title: ( localize(19209, "Select Folder To Trust"))
|
|
335
339
|
});
|
|
336
340
|
if (uri) {
|
|
337
341
|
this.acceptEdit(item, uri[0]);
|
|
@@ -398,7 +402,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
398
402
|
class: ThemeIcon.asClassName(editIcon),
|
|
399
403
|
enabled: true,
|
|
400
404
|
id: "editTrustedUri",
|
|
401
|
-
tooltip: ( localize(
|
|
405
|
+
tooltip: ( localize(19215, "Edit Path")),
|
|
402
406
|
run: () => {
|
|
403
407
|
this.table.edit(item, false);
|
|
404
408
|
}
|
|
@@ -410,7 +414,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
410
414
|
class: ThemeIcon.asClassName(folderPickerIcon),
|
|
411
415
|
enabled: true,
|
|
412
416
|
id: "pickerTrustedUri",
|
|
413
|
-
tooltip: ( localize(
|
|
417
|
+
tooltip: ( localize(19216, "Open File Picker")),
|
|
414
418
|
run: () => {
|
|
415
419
|
this.table.edit(item, true);
|
|
416
420
|
}
|
|
@@ -422,7 +426,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
422
426
|
class: ThemeIcon.asClassName(removeIcon),
|
|
423
427
|
enabled: true,
|
|
424
428
|
id: "deleteTrustedUri",
|
|
425
|
-
tooltip: ( localize(
|
|
429
|
+
tooltip: ( localize(19217, "Delete Path")),
|
|
426
430
|
run: async () => {
|
|
427
431
|
await this.table.delete(item);
|
|
428
432
|
}
|
|
@@ -548,7 +552,7 @@ let TrustedUriPathColumnRenderer = class TrustedUriPathColumnRenderer {
|
|
|
548
552
|
};
|
|
549
553
|
TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( __decorate([( __param(1, IContextViewService))], TrustedUriPathColumnRenderer));
|
|
550
554
|
function getHostLabel(labelService, item) {
|
|
551
|
-
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(
|
|
555
|
+
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : ( localize(19218, "Local"));
|
|
552
556
|
}
|
|
553
557
|
let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
|
|
554
558
|
static {
|
|
@@ -717,18 +721,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
717
721
|
getHeaderTitleText(trusted) {
|
|
718
722
|
if (trusted) {
|
|
719
723
|
if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
720
|
-
return localize(
|
|
724
|
+
return localize(19219, "This window is trusted");
|
|
721
725
|
}
|
|
722
726
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
723
727
|
case WorkbenchState.EMPTY:
|
|
724
|
-
return localize(
|
|
728
|
+
return localize(19220, "You trust this window");
|
|
725
729
|
case WorkbenchState.FOLDER:
|
|
726
|
-
return localize(
|
|
730
|
+
return localize(19221, "You trust this folder");
|
|
727
731
|
case WorkbenchState.WORKSPACE:
|
|
728
|
-
return localize(
|
|
732
|
+
return localize(19222, "You trust this workspace");
|
|
729
733
|
}
|
|
730
734
|
}
|
|
731
|
-
return localize(
|
|
735
|
+
return localize(19223, "You are in Restricted Mode");
|
|
732
736
|
}
|
|
733
737
|
getHeaderTitleIconClassNames(trusted) {
|
|
734
738
|
return ThemeIcon.asClassNameArray(shieldIcon);
|
|
@@ -739,36 +743,36 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
739
743
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
740
744
|
case WorkbenchState.EMPTY:
|
|
741
745
|
{
|
|
742
|
-
title = trusted ? ( localize(
|
|
746
|
+
title = trusted ? ( localize(19224, "In a Trusted Window")) : ( localize(19225, "In Restricted Mode"));
|
|
743
747
|
subTitle = trusted ? ( localize(
|
|
744
|
-
|
|
748
|
+
19226,
|
|
745
749
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
746
750
|
)) : ( localize(
|
|
747
|
-
|
|
751
|
+
19227,
|
|
748
752
|
"You do not trust the authors of the files in the current window. The following features are disabled:"
|
|
749
753
|
));
|
|
750
754
|
break;
|
|
751
755
|
}
|
|
752
756
|
case WorkbenchState.FOLDER:
|
|
753
757
|
{
|
|
754
|
-
title = trusted ? ( localize(
|
|
758
|
+
title = trusted ? ( localize(19228, "In a Trusted Folder")) : ( localize(19225, "In Restricted Mode"));
|
|
755
759
|
subTitle = trusted ? ( localize(
|
|
756
|
-
|
|
760
|
+
19229,
|
|
757
761
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
758
762
|
)) : ( localize(
|
|
759
|
-
|
|
763
|
+
19230,
|
|
760
764
|
"You do not trust the authors of the files in the current folder. The following features are disabled:"
|
|
761
765
|
));
|
|
762
766
|
break;
|
|
763
767
|
}
|
|
764
768
|
case WorkbenchState.WORKSPACE:
|
|
765
769
|
{
|
|
766
|
-
title = trusted ? ( localize(
|
|
770
|
+
title = trusted ? ( localize(19231, "In a Trusted Workspace")) : ( localize(19225, "In Restricted Mode"));
|
|
767
771
|
subTitle = trusted ? ( localize(
|
|
768
|
-
|
|
772
|
+
19232,
|
|
769
773
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
770
774
|
)) : ( localize(
|
|
771
|
-
|
|
775
|
+
19233,
|
|
772
776
|
"You do not trust the authors of the files in the current workspace. The following features are disabled:"
|
|
773
777
|
));
|
|
774
778
|
break;
|
|
@@ -794,16 +798,16 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
794
798
|
this.headerDescription.innerText = "";
|
|
795
799
|
const headerDescriptionText = append(this.headerDescription, $("div"));
|
|
796
800
|
headerDescriptionText.innerText = isWorkspaceTrusted ? ( localize(
|
|
797
|
-
|
|
801
|
+
19234,
|
|
798
802
|
"All features are enabled because trust has been granted to the workspace."
|
|
799
803
|
)) : ( localize(
|
|
800
|
-
|
|
804
|
+
19235,
|
|
801
805
|
"{0} is in a restricted mode intended for safe code browsing.",
|
|
802
806
|
this.productService.nameShort
|
|
803
807
|
));
|
|
804
808
|
const headerDescriptionActions = append(this.headerDescription, $("div"));
|
|
805
809
|
const headerDescriptionActionsText = ( localize(
|
|
806
|
-
|
|
810
|
+
19236,
|
|
807
811
|
"[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
|
|
808
812
|
`command:workbench.trust.configure`
|
|
809
813
|
));
|
|
@@ -818,7 +822,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
818
822
|
}
|
|
819
823
|
}
|
|
820
824
|
this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
|
|
821
|
-
this.rootElement.setAttribute("aria-label", `${( localize(
|
|
825
|
+
this.rootElement.setAttribute("aria-label", `${( localize(19237, "Manage Workspace Trust"))}: ${this.headerContainer.innerText}`);
|
|
822
826
|
const restrictedSettings = this.configurationService.restrictedSettings;
|
|
823
827
|
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
824
828
|
const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
|
|
@@ -886,7 +890,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
886
890
|
tabIndex: "0"
|
|
887
891
|
}));
|
|
888
892
|
const configurationTitle = append(this.configurationContainer, $(".workspace-trusted-folders-title"));
|
|
889
|
-
configurationTitle.innerText = ( localize(
|
|
893
|
+
configurationTitle.innerText = ( localize(19206, "Trusted Folders & Workspaces"));
|
|
890
894
|
this.workspaceTrustedUrisTable = this._register(
|
|
891
895
|
this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer)
|
|
892
896
|
);
|
|
@@ -911,7 +915,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
911
915
|
clearNode(this.untrustedContainer);
|
|
912
916
|
const [trustedTitle, trustedSubTitle] = this.getFeaturesHeaderText(true);
|
|
913
917
|
this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
|
|
914
|
-
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(
|
|
918
|
+
const trustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(19238, "Tasks are allowed to run")), ( localize(19239, "Debugging is enabled")), ( localize(19240, "All enabled extensions are activated"))] : [( localize(19238, "Tasks are allowed to run")), ( localize(19239, "Debugging is enabled")), ( localize(19241, "All workspace settings are applied")), ( localize(19240, "All enabled extensions are activated"))];
|
|
915
919
|
this.renderLimitationsListElement(
|
|
916
920
|
this.trustedContainer,
|
|
917
921
|
trustedContainerItems,
|
|
@@ -919,18 +923,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
919
923
|
);
|
|
920
924
|
const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
|
|
921
925
|
this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
|
|
922
|
-
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(
|
|
923
|
-
|
|
926
|
+
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY ? [( localize(19242, "Tasks are not allowed to run")), ( localize(19243, "Debugging is disabled")), fixBadLocalizedLinks(( localize(
|
|
927
|
+
19244,
|
|
924
928
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
925
929
|
numExtensions,
|
|
926
930
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
927
|
-
)))] : [( localize(
|
|
928
|
-
|
|
931
|
+
)))] : [( localize(19242, "Tasks are not allowed to run")), ( localize(19243, "Debugging is disabled")), fixBadLocalizedLinks(numSettings ? ( localize(
|
|
932
|
+
19245,
|
|
929
933
|
"[{0} workspace settings]({1}) are not applied",
|
|
930
934
|
numSettings,
|
|
931
935
|
"command:settings.filterUntrusted"
|
|
932
|
-
)) : ( localize(
|
|
933
|
-
|
|
936
|
+
)) : ( localize(19246, "Workspace settings requiring trust are not applied"))), fixBadLocalizedLinks(( localize(
|
|
937
|
+
19244,
|
|
934
938
|
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
935
939
|
numExtensions,
|
|
936
940
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
@@ -964,7 +968,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
964
968
|
button.label = action.label;
|
|
965
969
|
button.enabled = enabled !== undefined ? enabled : action.enabled;
|
|
966
970
|
button.description = keybinding.getLabel();
|
|
967
|
-
button.element.ariaLabel = action.label + ", " + ( localize(
|
|
971
|
+
button.element.ariaLabel = action.label + ", " + ( localize(19247, "Keyboard Shortcut: {0}", keybinding.getAriaLabel()));
|
|
968
972
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
969
973
|
if (e) {
|
|
970
974
|
EventHelper.stop(e, true);
|
|
@@ -974,7 +978,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
974
978
|
}
|
|
975
979
|
}
|
|
976
980
|
addTrustButtonToElement(parent) {
|
|
977
|
-
const trustAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grant", ( localize(
|
|
981
|
+
const trustAction = this.rerenderDisposables.add(( new Action("workspace.trust.button.action.grant", ( localize(19248, "Trust")), undefined, true, async () => {
|
|
978
982
|
await this.workspaceTrustManagementService.setWorkspaceTrust(true);
|
|
979
983
|
})));
|
|
980
984
|
const trustActions = [{
|
|
@@ -985,7 +989,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
985
989
|
}
|
|
986
990
|
addDontTrustButtonToElement(parent) {
|
|
987
991
|
this.createButtonRow(parent, [{
|
|
988
|
-
action: this.rerenderDisposables.add(( new Action("workspace.trust.button.action.deny", ( localize(
|
|
992
|
+
action: this.rerenderDisposables.add(( new Action("workspace.trust.button.action.deny", ( localize(19249, "Don't Trust")), undefined, true, async () => {
|
|
989
993
|
await this.workspaceTrustManagementService.setWorkspaceTrust(false);
|
|
990
994
|
}))),
|
|
991
995
|
keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? "Cmd+Enter" : "Ctrl+Enter")[0]
|
|
@@ -998,14 +1002,14 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
998
1002
|
const textElement = append(parent, $(".workspace-trust-untrusted-description"));
|
|
999
1003
|
if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
1000
1004
|
textElement.innerText = this.workspaceService.getWorkbenchState() === WorkbenchState.WORKSPACE ? ( localize(
|
|
1001
|
-
|
|
1005
|
+
19250,
|
|
1002
1006
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
1003
1007
|
)) : ( localize(
|
|
1004
|
-
|
|
1008
|
+
19251,
|
|
1005
1009
|
"This folder is trusted via the bolded entries in the trusted folders below."
|
|
1006
1010
|
));
|
|
1007
1011
|
} else {
|
|
1008
|
-
textElement.innerText = ( localize(
|
|
1012
|
+
textElement.innerText = ( localize(19252, "This window is trusted by nature of the workspace that is opened."));
|
|
1009
1013
|
}
|
|
1010
1014
|
}
|
|
1011
1015
|
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(20427, "Icon of the workspace trust editor label.")));
|
|
11
11
|
class WorkspaceTrustEditorInput extends EditorInput {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
@@ -29,7 +29,7 @@ class WorkspaceTrustEditorInput extends EditorInput {
|
|
|
29
29
|
return super.matches(otherInput) || otherInput instanceof WorkspaceTrustEditorInput;
|
|
30
30
|
}
|
|
31
31
|
getName() {
|
|
32
|
-
return localize(
|
|
32
|
+
return localize(20428, "Workspace Trust");
|
|
33
33
|
}
|
|
34
34
|
getIcon() {
|
|
35
35
|
return WorkspaceTrustEditorIcon;
|