@codingame/monaco-vscode-workspace-trust-service-override 14.0.6 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -10
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspace.contribution.js +64 -64
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +76 -76
- 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": "15.0.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,16 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-0f5ced28-abde-558b-8652-db8e7d4d64aa-common": "
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-
|
|
22
|
-
"@codingame/monaco-vscode-
|
|
23
|
-
"@codingame/monaco-vscode-
|
|
24
|
-
"@codingame/monaco-vscode-
|
|
25
|
-
"@codingame/monaco-vscode-
|
|
26
|
-
"@codingame/monaco-vscode-
|
|
18
|
+
"@codingame/monaco-vscode-0f5ced28-abde-558b-8652-db8e7d4d64aa-common": "15.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-12c5f9eb-72d3-57ca-babd-5bef7aa9de3b-common": "15.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-1bb39316-6fbf-572e-ab6a-818a2496c14f-common": "15.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common": "15.0.0",
|
|
22
|
+
"@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common": "15.0.0",
|
|
23
|
+
"@codingame/monaco-vscode-7559b0be-bfa5-5fe6-b731-1973fe9fffa1-common": "15.0.0",
|
|
24
|
+
"@codingame/monaco-vscode-7ba0af96-90c2-5e11-ad7f-befdbbf246c8-common": "15.0.0",
|
|
25
|
+
"@codingame/monaco-vscode-api": "15.0.0",
|
|
26
|
+
"@codingame/monaco-vscode-b1249c5b-1339-5278-b002-746f08105c6d-common": "15.0.0",
|
|
27
|
+
"@codingame/monaco-vscode-d7f659f5-da33-5ea8-a3b8-9b94f2cf5f33-common": "15.0.0"
|
|
27
28
|
},
|
|
28
29
|
"main": "index.js",
|
|
29
30
|
"module": "index.js",
|
|
@@ -21,7 +21,7 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
21
21
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
22
22
|
import { StatusbarAlignment } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
23
23
|
import { IStatusbarService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/statusbar/browser/statusbar.service';
|
|
24
|
-
import { EditorPaneDescriptor } from '@codingame/monaco-vscode-
|
|
24
|
+
import { EditorPaneDescriptor } from '@codingame/monaco-vscode-12c5f9eb-72d3-57ca-babd-5bef7aa9de3b-common/vscode/vs/workbench/browser/editor';
|
|
25
25
|
import { shieldIcon, WorkspaceTrustEditor } from './workspaceTrustEditor.js';
|
|
26
26
|
import { WorkspaceTrustEditorInput } from '../../../services/workspaces/browser/workspaceTrustEditorInput.js';
|
|
27
27
|
import { WORKSPACE_TRUST_STARTUP_PROMPT, WORKSPACE_TRUST_BANNER, WORKSPACE_TRUST_ENABLED, WORKSPACE_TRUST_EMPTY_WINDOW, WORKSPACE_TRUST_UNTRUSTED_FILES } from '@codingame/monaco-vscode-d7f659f5-da33-5ea8-a3b8-9b94f2cf5f33-common/vscode/vs/workbench/services/workspaces/common/workspaceTrust';
|
|
@@ -36,12 +36,12 @@ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode
|
|
|
36
36
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
37
37
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
38
38
|
import { IBannerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/banner/browser/bannerService.service';
|
|
39
|
-
import { isVirtualWorkspace } from '@codingame/monaco-vscode-
|
|
40
|
-
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
39
|
+
import { isVirtualWorkspace } from '@codingame/monaco-vscode-7559b0be-bfa5-5fe6-b731-1973fe9fffa1-common/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
40
|
+
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from '@codingame/monaco-vscode-7ba0af96-90c2-5e11-ad7f-befdbbf246c8-common/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
41
41
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
42
42
|
import { WORKSPACE_TRUST_SETTING_TAG } from '@codingame/monaco-vscode-0f5ced28-abde-558b-8652-db8e7d4d64aa-common/vscode/vs/workbench/contrib/preferences/common/preferences';
|
|
43
43
|
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
44
|
-
import { Verbosity } from '@codingame/monaco-vscode-
|
|
44
|
+
import { Verbosity } from '@codingame/monaco-vscode-7559b0be-bfa5-5fe6-b731-1973fe9fffa1-common/vscode/vs/platform/label/common/label';
|
|
45
45
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
46
46
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
47
47
|
import { WorkspaceTrustContext, MANAGE_TRUST_COMMAND_ID } from '@codingame/monaco-vscode-27663a0b-1249-58ba-9085-e52d706b50bc-common/vscode/vs/workbench/contrib/workspace/common/workspace';
|
|
@@ -93,30 +93,30 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
93
93
|
const markdownDetails = [
|
|
94
94
|
this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
95
95
|
( localize(
|
|
96
|
-
|
|
96
|
+
11315,
|
|
97
97
|
"You are trying to open untrusted files in a workspace which is trusted."
|
|
98
98
|
)) :
|
|
99
99
|
( localize(
|
|
100
|
-
|
|
100
|
+
11316,
|
|
101
101
|
"You are trying to open untrusted files in a window which is trusted."
|
|
102
102
|
)),
|
|
103
103
|
( localize(
|
|
104
|
-
|
|
104
|
+
11317,
|
|
105
105
|
"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."
|
|
106
106
|
))
|
|
107
107
|
];
|
|
108
108
|
await this.dialogService.prompt({
|
|
109
109
|
type: Severity.Info,
|
|
110
110
|
message: this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY ?
|
|
111
|
-
( localize(
|
|
112
|
-
( localize(
|
|
111
|
+
( localize(11318, "Do you want to allow untrusted files in this workspace?")) :
|
|
112
|
+
( localize(11319, "Do you want to allow untrusted files in this window?")),
|
|
113
113
|
buttons: [
|
|
114
114
|
{
|
|
115
|
-
label: ( localize(
|
|
115
|
+
label: ( localize(11320, "&&Open")),
|
|
116
116
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Open, !!checkboxChecked)
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
label: ( localize(
|
|
119
|
+
label: ( localize(11321, "Open in &&Restricted Mode")),
|
|
120
120
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.OpenInNewWindow, !!checkboxChecked)
|
|
121
121
|
}
|
|
122
122
|
],
|
|
@@ -124,7 +124,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
124
124
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(WorkspaceTrustUriResponse.Cancel)
|
|
125
125
|
},
|
|
126
126
|
checkbox: {
|
|
127
|
-
label: ( localize(
|
|
127
|
+
label: ( localize(11322, "Remember my decision for all workspaces")),
|
|
128
128
|
checked: false
|
|
129
129
|
},
|
|
130
130
|
custom: {
|
|
@@ -136,19 +136,19 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
136
136
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
137
137
|
await this.workspaceTrustManagementService.workspaceResolved;
|
|
138
138
|
const message = this.useWorkspaceLanguage ?
|
|
139
|
-
( localize(
|
|
140
|
-
( localize(
|
|
139
|
+
( localize(11323, "Do you trust the authors of the files in this workspace?")) :
|
|
140
|
+
( localize(11324, "Do you trust the authors of the files in this folder?"));
|
|
141
141
|
const defaultDetails = ( localize(
|
|
142
|
-
|
|
142
|
+
11325,
|
|
143
143
|
"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."
|
|
144
144
|
));
|
|
145
145
|
const details = requestOptions?.message ?? defaultDetails;
|
|
146
146
|
const buttons = requestOptions?.buttons ?? [
|
|
147
|
-
{ label: this.useWorkspaceLanguage ? ( localize(
|
|
148
|
-
{ label: ( localize(
|
|
147
|
+
{ label: this.useWorkspaceLanguage ? ( localize(11326, "&&Trust Workspace & Continue")) : ( localize(11327, "&&Trust Folder & Continue")), type: 'ContinueWithTrust' },
|
|
148
|
+
{ label: ( localize(11328, "&&Manage")), type: 'Manage' }
|
|
149
149
|
];
|
|
150
150
|
if (!( buttons.some(b => b.type === 'Cancel'))) {
|
|
151
|
-
buttons.push({ label: ( localize(
|
|
151
|
+
buttons.push({ label: ( localize(11329, "Cancel")), type: 'Cancel' });
|
|
152
152
|
}
|
|
153
153
|
const { result } = await this.dialogService.prompt({
|
|
154
154
|
type: Severity.Info,
|
|
@@ -158,7 +158,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
158
158
|
markdownDetails: [
|
|
159
159
|
{ markdown: ( new MarkdownString(details)) },
|
|
160
160
|
{ markdown: ( new MarkdownString(( localize(
|
|
161
|
-
|
|
161
|
+
11330,
|
|
162
162
|
"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."
|
|
163
163
|
)))) }
|
|
164
164
|
]
|
|
@@ -259,12 +259,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
259
259
|
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
260
260
|
const { confirmed } = await this.dialogService.confirm({
|
|
261
261
|
type: Severity.Info,
|
|
262
|
-
message: ( localize(
|
|
262
|
+
message: ( localize(11331, "Do you trust the authors of the files in this folder?")),
|
|
263
263
|
detail: ( localize(
|
|
264
|
-
|
|
264
|
+
11332,
|
|
265
265
|
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
266
266
|
)),
|
|
267
|
-
cancelButton: ( localize(
|
|
267
|
+
cancelButton: ( localize(11333, 'No')),
|
|
268
268
|
custom: { icon: Codicon.shield }
|
|
269
269
|
});
|
|
270
270
|
await this.workspaceTrustManagementService.setUrisTrust(( addedFoldersTrustInfo.map(i => i.uri)), confirmed);
|
|
@@ -292,30 +292,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
292
292
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
293
293
|
}
|
|
294
294
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
295
|
-
( localize(
|
|
296
|
-
( localize(
|
|
295
|
+
( localize(11323, "Do you trust the authors of the files in this workspace?")) :
|
|
296
|
+
( localize(11324, "Do you trust the authors of the files in this folder?")));
|
|
297
297
|
let checkboxText;
|
|
298
298
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
299
299
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
300
300
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
301
301
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
302
302
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
303
|
-
checkboxText = ( localize(
|
|
303
|
+
checkboxText = ( localize(11334, "Trust the authors of all files in the parent folder '{0}'", name));
|
|
304
304
|
}
|
|
305
|
-
this.doShowModal(title, { label: trustOption ?? ( localize(
|
|
305
|
+
this.doShowModal(title, { label: trustOption ?? ( localize(11335, "&&Yes, I trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(11336, "Trust folder and enable all features")) : ( localize(11337, "Trust workspace and enable all features")) }, { label: dontTrustOption ?? ( localize(11338, "&&No, I don't trust the authors")), sublabel: isSingleFolderWorkspace ? ( localize(11339, "Browse folder in restricted mode")) : ( localize(11340, "Browse workspace in restricted mode")) }, [
|
|
306
306
|
!isSingleFolderWorkspace ?
|
|
307
307
|
( localize(
|
|
308
|
-
|
|
308
|
+
11341,
|
|
309
309
|
"{0} provides features that may automatically execute files in this workspace.",
|
|
310
310
|
this.productService.nameShort
|
|
311
311
|
)) :
|
|
312
312
|
( localize(
|
|
313
|
-
|
|
313
|
+
11342,
|
|
314
314
|
"{0} provides features that may automatically execute files in this folder.",
|
|
315
315
|
this.productService.nameShort
|
|
316
316
|
)),
|
|
317
317
|
learnMoreString ?? ( localize(
|
|
318
|
-
|
|
318
|
+
11343,
|
|
319
319
|
"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."
|
|
320
320
|
)),
|
|
321
321
|
!isEmptyWindow ?
|
|
@@ -433,11 +433,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
433
433
|
}
|
|
434
434
|
const actions = [
|
|
435
435
|
{
|
|
436
|
-
label: ( localize(
|
|
436
|
+
label: ( localize(11344, "Manage")),
|
|
437
437
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
438
438
|
},
|
|
439
439
|
{
|
|
440
|
-
label: ( localize(
|
|
440
|
+
label: ( localize(11345, "Learn More")),
|
|
441
441
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
442
442
|
}
|
|
443
443
|
];
|
|
@@ -458,17 +458,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
458
458
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
459
459
|
case WorkbenchState.EMPTY:
|
|
460
460
|
return localize(
|
|
461
|
-
|
|
461
|
+
11346,
|
|
462
462
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
463
463
|
);
|
|
464
464
|
case WorkbenchState.FOLDER:
|
|
465
465
|
return localize(
|
|
466
|
-
|
|
466
|
+
11347,
|
|
467
467
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
468
468
|
);
|
|
469
469
|
case WorkbenchState.WORKSPACE:
|
|
470
470
|
return localize(
|
|
471
|
-
|
|
471
|
+
11348,
|
|
472
472
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
473
473
|
);
|
|
474
474
|
}
|
|
@@ -477,17 +477,17 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
477
477
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
478
478
|
case WorkbenchState.EMPTY:
|
|
479
479
|
return localize(
|
|
480
|
-
|
|
480
|
+
11349,
|
|
481
481
|
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
482
482
|
);
|
|
483
483
|
case WorkbenchState.FOLDER:
|
|
484
484
|
return localize(
|
|
485
|
-
|
|
485
|
+
11350,
|
|
486
486
|
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
487
487
|
);
|
|
488
488
|
case WorkbenchState.WORKSPACE:
|
|
489
489
|
return localize(
|
|
490
|
-
|
|
490
|
+
11351,
|
|
491
491
|
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
492
492
|
);
|
|
493
493
|
}
|
|
@@ -505,12 +505,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
505
505
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
506
506
|
case WorkbenchState.EMPTY: {
|
|
507
507
|
ariaLabel = ( localize(
|
|
508
|
-
|
|
508
|
+
11352,
|
|
509
509
|
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
510
510
|
));
|
|
511
511
|
toolTip = {
|
|
512
512
|
value: ( localize(
|
|
513
|
-
|
|
513
|
+
11353,
|
|
514
514
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
515
515
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
516
516
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -522,12 +522,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
522
522
|
}
|
|
523
523
|
case WorkbenchState.FOLDER: {
|
|
524
524
|
ariaLabel = ( localize(
|
|
525
|
-
|
|
525
|
+
11354,
|
|
526
526
|
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
527
527
|
));
|
|
528
528
|
toolTip = {
|
|
529
529
|
value: ( localize(
|
|
530
|
-
|
|
530
|
+
11355,
|
|
531
531
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
532
532
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
533
533
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -539,12 +539,12 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
539
539
|
}
|
|
540
540
|
case WorkbenchState.WORKSPACE: {
|
|
541
541
|
ariaLabel = ( localize(
|
|
542
|
-
|
|
542
|
+
11356,
|
|
543
543
|
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
544
544
|
));
|
|
545
545
|
toolTip = {
|
|
546
546
|
value: ( localize(
|
|
547
|
-
|
|
547
|
+
11357,
|
|
548
548
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
549
549
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
550
550
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -556,8 +556,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
return {
|
|
559
|
-
name: ( localize(
|
|
560
|
-
text: `$(shield) ${( localize(
|
|
559
|
+
name: ( localize(11358, "Workspace Trust")),
|
|
560
|
+
text: `$(shield) ${( localize(11359, "Restricted Mode"))}`,
|
|
561
561
|
ariaLabel: ariaLabel,
|
|
562
562
|
tooltip: toolTip,
|
|
563
563
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -571,7 +571,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
571
571
|
}
|
|
572
572
|
if (!trusted && !this.statusbarEntryAccessor.value) {
|
|
573
573
|
const entry = this.getRestrictedModeStatusbarEntry();
|
|
574
|
-
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, StatusbarAlignment.LEFT,
|
|
574
|
+
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, StatusbarAlignment.LEFT, { location: { id: 'status.host', priority: Number.POSITIVE_INFINITY }, alignment: StatusbarAlignment.RIGHT });
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
};
|
|
@@ -607,16 +607,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
607
607
|
}
|
|
608
608
|
( Registry.as(EditorExtensions.EditorFactory))
|
|
609
609
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
610
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(
|
|
610
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localize(11360, "Workspace Trust Editor"))), [
|
|
611
611
|
( new SyncDescriptor(WorkspaceTrustEditorInput))
|
|
612
612
|
]);
|
|
613
613
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
614
|
-
const WORKSPACES_CATEGORY = ( localize2(
|
|
614
|
+
const WORKSPACES_CATEGORY = ( localize2(11361, 'Workspaces'));
|
|
615
615
|
registerAction2(class extends Action2 {
|
|
616
616
|
constructor() {
|
|
617
617
|
super({
|
|
618
618
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
619
|
-
title: ( localize2(
|
|
619
|
+
title: ( localize2(11362, "Configure Workspace Trust Settings")),
|
|
620
620
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
621
621
|
category: WORKSPACES_CATEGORY,
|
|
622
622
|
f1: true
|
|
@@ -630,7 +630,7 @@ registerAction2(class extends Action2 {
|
|
|
630
630
|
constructor() {
|
|
631
631
|
super({
|
|
632
632
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
633
|
-
title: ( localize2(
|
|
633
|
+
title: ( localize2(11363, "Manage Workspace Trust")),
|
|
634
634
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
635
635
|
category: WORKSPACES_CATEGORY,
|
|
636
636
|
f1: true,
|
|
@@ -652,7 +652,7 @@ registerAction2(class extends Action2 {
|
|
|
652
652
|
type: 'boolean',
|
|
653
653
|
default: true,
|
|
654
654
|
description: ( localize(
|
|
655
|
-
|
|
655
|
+
11364,
|
|
656
656
|
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
657
657
|
)),
|
|
658
658
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -661,37 +661,37 @@ registerAction2(class extends Action2 {
|
|
|
661
661
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
662
662
|
type: 'string',
|
|
663
663
|
default: 'once',
|
|
664
|
-
description: ( localize(
|
|
664
|
+
description: ( localize(11365, "Controls when the startup prompt to trust a workspace is shown.")),
|
|
665
665
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
666
666
|
scope: ConfigurationScope.APPLICATION,
|
|
667
667
|
enum: ['always', 'once', 'never'],
|
|
668
668
|
enumDescriptions: [
|
|
669
|
-
( localize(
|
|
670
|
-
( localize(
|
|
671
|
-
( localize(
|
|
669
|
+
( localize(11366, "Ask for trust every time an untrusted workspace is opened.")),
|
|
670
|
+
( localize(11367, "Ask for trust the first time an untrusted workspace is opened.")),
|
|
671
|
+
( localize(11368, "Do not ask for trust when an untrusted workspace is opened.")),
|
|
672
672
|
]
|
|
673
673
|
},
|
|
674
674
|
[WORKSPACE_TRUST_BANNER]: {
|
|
675
675
|
type: 'string',
|
|
676
676
|
default: 'untilDismissed',
|
|
677
|
-
description: ( localize(
|
|
677
|
+
description: ( localize(11369, "Controls when the restricted mode banner is shown.")),
|
|
678
678
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
679
679
|
scope: ConfigurationScope.APPLICATION,
|
|
680
680
|
enum: ['always', 'untilDismissed', 'never'],
|
|
681
681
|
enumDescriptions: [
|
|
682
|
-
( localize(
|
|
682
|
+
( localize(11370, "Show the banner every time an untrusted workspace is open.")),
|
|
683
683
|
( localize(
|
|
684
|
-
|
|
684
|
+
11371,
|
|
685
685
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
686
686
|
)),
|
|
687
|
-
( localize(
|
|
687
|
+
( localize(11372, "Do not show the banner when an untrusted workspace is open.")),
|
|
688
688
|
]
|
|
689
689
|
},
|
|
690
690
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
691
691
|
type: 'string',
|
|
692
692
|
default: 'prompt',
|
|
693
693
|
markdownDescription: ( localize(
|
|
694
|
-
|
|
694
|
+
11373,
|
|
695
695
|
"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}#`.",
|
|
696
696
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
697
697
|
)),
|
|
@@ -700,15 +700,15 @@ registerAction2(class extends Action2 {
|
|
|
700
700
|
enum: ['prompt', 'open', 'newWindow'],
|
|
701
701
|
enumDescriptions: [
|
|
702
702
|
( localize(
|
|
703
|
-
|
|
703
|
+
11374,
|
|
704
704
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
705
705
|
)),
|
|
706
706
|
( localize(
|
|
707
|
-
|
|
707
|
+
11375,
|
|
708
708
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
709
709
|
)),
|
|
710
710
|
( localize(
|
|
711
|
-
|
|
711
|
+
11376,
|
|
712
712
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
713
713
|
)),
|
|
714
714
|
]
|
|
@@ -717,7 +717,7 @@ registerAction2(class extends Action2 {
|
|
|
717
717
|
type: 'boolean',
|
|
718
718
|
default: true,
|
|
719
719
|
markdownDescription: ( localize(
|
|
720
|
-
|
|
720
|
+
11377,
|
|
721
721
|
"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.",
|
|
722
722
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
723
723
|
)),
|
|
@@ -7,7 +7,7 @@ import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs
|
|
|
7
7
|
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
8
8
|
import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables";
|
|
9
9
|
import { IWorkspaceTrustManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service";
|
|
10
|
-
import { EditorPane } from "@codingame/monaco-vscode-
|
|
10
|
+
import { EditorPane } from "@codingame/monaco-vscode-12c5f9eb-72d3-57ca-babd-5bef7aa9de3b-common/vscode/vs/workbench/browser/parts/editor/editorPane";
|
|
11
11
|
import { IEditorOpenContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
12
12
|
import { IExtensionsWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service";
|
|
13
13
|
import { IWorkbenchConfigurationService } from "@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common/vscode/vs/workbench/services/configuration/common/configuration.service";
|
|
@@ -25,7 +25,7 @@ import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/l
|
|
|
25
25
|
import { WorkbenchTable } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
26
26
|
import { Link } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/browser/link';
|
|
27
27
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
28
|
-
import { isVirtualResource, isVirtualWorkspace } from '@codingame/monaco-vscode-
|
|
28
|
+
import { isVirtualResource, isVirtualWorkspace } from '@codingame/monaco-vscode-7559b0be-bfa5-5fe6-b731-1973fe9fffa1-common/vscode/vs/platform/workspace/common/virtualWorkspace';
|
|
29
29
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
30
30
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
31
31
|
import { asCssVariable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
@@ -44,9 +44,9 @@ import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs
|
|
|
44
44
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
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
|
-
import { EditorPane } from '@codingame/monaco-vscode-
|
|
48
|
-
import { debugIconStartForeground } from '@codingame/monaco-vscode-
|
|
49
|
-
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from '@codingame/monaco-vscode-
|
|
47
|
+
import { EditorPane } from '@codingame/monaco-vscode-12c5f9eb-72d3-57ca-babd-5bef7aa9de3b-common/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
48
|
+
import { debugIconStartForeground } from '@codingame/monaco-vscode-1bb39316-6fbf-572e-ab6a-818a2496c14f-common/vscode/vs/workbench/contrib/debug/browser/debugColors';
|
|
49
|
+
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from '@codingame/monaco-vscode-7ba0af96-90c2-5e11-ad7f-befdbbf246c8-common/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-b1249c5b-1339-5278-b002-746f08105c6d-common/vscode/vs/workbench/services/configuration/common/configuration';
|
|
52
52
|
import { IWorkbenchConfigurationService } from '@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common/vscode/vs/workbench/services/configuration/common/configuration.service';
|
|
@@ -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(11378, 'Icon for workspace trust ion the banner.')));
|
|
70
|
+
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, ( localize(11379, 'Icon for the checkmark in the workspace trust editor.')));
|
|
71
|
+
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, ( localize(11380, 'Icon for the cross in the workspace trust editor.')));
|
|
72
|
+
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, ( localize(11381, 'Icon for the pick folder icon in the workspace trust editor.')));
|
|
73
|
+
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize(11382, 'Icon for the edit folder icon in the workspace trust editor.')));
|
|
74
|
+
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(11383, '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(11384, "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(11385, "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(11386, "{0}, trusted", this.labelService.getUriLabel(item.uri));
|
|
134
134
|
}
|
|
135
135
|
return localize(
|
|
136
|
-
|
|
136
|
+
11387,
|
|
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(11388, "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(11389, "Add Folder")), ...defaultButtonStyles }));
|
|
157
|
+
addButton.label = ( localize(11389, "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(11390, "Trust Folder")),
|
|
165
|
+
title: ( localize(11391, "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
|
+
11392,
|
|
247
247
|
"You trust the following folders, their subfolders, and workspace files."
|
|
248
248
|
)) :
|
|
249
|
-
( localize(
|
|
249
|
+
( localize(11393, "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
|
+
11394,
|
|
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
|
+
11395,
|
|
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(11396, "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(11390, "Trust Folder")),
|
|
325
|
+
title: ( localize(11391, "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(11397, "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(11398, "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(11399, "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(11400, "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(11401, "This window is trusted");
|
|
667
667
|
}
|
|
668
668
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
669
669
|
case WorkbenchState.EMPTY:
|
|
670
|
-
return localize(
|
|
670
|
+
return localize(11402, "You trust this window");
|
|
671
671
|
case WorkbenchState.FOLDER:
|
|
672
|
-
return localize(
|
|
672
|
+
return localize(11403, "You trust this folder");
|
|
673
673
|
case WorkbenchState.WORKSPACE:
|
|
674
|
-
return localize(
|
|
674
|
+
return localize(11404, "You trust this workspace");
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
return localize(
|
|
677
|
+
return localize(11405, "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(11406, "In a Trusted Window")) : ( localize(11407, "In Restricted Mode"));
|
|
688
688
|
subTitle = trusted ? ( localize(
|
|
689
|
-
|
|
689
|
+
11408,
|
|
690
690
|
"You trust the authors of the files in the current window. All features are enabled:"
|
|
691
691
|
)) :
|
|
692
692
|
( localize(
|
|
693
|
-
|
|
693
|
+
11409,
|
|
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(11410, "In a Trusted Folder")) : ( localize(11407, "In Restricted Mode"));
|
|
700
700
|
subTitle = trusted ? ( localize(
|
|
701
|
-
|
|
701
|
+
11411,
|
|
702
702
|
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
703
703
|
)) :
|
|
704
704
|
( localize(
|
|
705
|
-
|
|
705
|
+
11412,
|
|
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(11413, "In a Trusted Workspace")) : ( localize(11407, "In Restricted Mode"));
|
|
712
712
|
subTitle = trusted ? ( localize(
|
|
713
|
-
|
|
713
|
+
11414,
|
|
714
714
|
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
715
715
|
)) :
|
|
716
716
|
( localize(
|
|
717
|
-
|
|
717
|
+
11415,
|
|
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
|
+
11416,
|
|
742
742
|
"All features are enabled because trust has been granted to the workspace."
|
|
743
743
|
)) :
|
|
744
744
|
( localize(
|
|
745
|
-
|
|
745
|
+
11417,
|
|
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
|
+
11418,
|
|
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(11419, "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(11388, "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(11420, "Tasks are allowed to run")),
|
|
845
|
+
( localize(11421, "Debugging is enabled")),
|
|
846
|
+
( localize(11422, "All enabled extensions are activated"))
|
|
847
847
|
] :
|
|
848
848
|
[
|
|
849
|
-
( localize(
|
|
850
|
-
( localize(
|
|
851
|
-
( localize(
|
|
852
|
-
( localize(
|
|
849
|
+
( localize(11420, "Tasks are allowed to run")),
|
|
850
|
+
( localize(11421, "Debugging is enabled")),
|
|
851
|
+
( localize(11423, "All workspace settings are applied")),
|
|
852
|
+
( localize(11422, "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(11424, "Tasks are not allowed to run")),
|
|
860
|
+
( localize(11425, "Debugging is disabled")),
|
|
861
861
|
fixBadLocalizedLinks(( localize(
|
|
862
|
-
|
|
862
|
+
11426,
|
|
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(11424, "Tasks are not allowed to run")),
|
|
870
|
+
( localize(11425, "Debugging is disabled")),
|
|
871
871
|
fixBadLocalizedLinks(numSettings ? ( localize(
|
|
872
|
-
|
|
872
|
+
11427,
|
|
873
873
|
"[{0} workspace settings]({1}) are not applied",
|
|
874
874
|
numSettings,
|
|
875
875
|
'command:settings.filterUntrusted'
|
|
876
|
-
)) : ( localize(
|
|
876
|
+
)) : ( localize(11428, "Workspace settings requiring trust are not applied"))),
|
|
877
877
|
fixBadLocalizedLinks(( localize(
|
|
878
|
-
|
|
878
|
+
11426,
|
|
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(11429, "Keyboard Shortcut: {0}", keybinding.getAriaLabel()));
|
|
909
909
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
910
910
|
if (e) {
|
|
911
911
|
EventHelper.stop(e, true);
|
|
@@ -915,31 +915,31 @@ 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 = this.rerenderDisposables.add(( new Action('workspace.trust.button.action.grant', ( localize(11430, "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] }];
|
|
922
922
|
if (this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
923
923
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceService.getWorkspace());
|
|
924
924
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
925
925
|
const trustMessageElement = append(parent, $('.trust-message-box'));
|
|
926
926
|
trustMessageElement.innerText = ( localize(
|
|
927
|
-
|
|
927
|
+
11431,
|
|
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 = this.rerenderDisposables.add(( new Action('workspace.trust.button.action.grantParent', ( localize(11432, "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] });
|
|
935
935
|
}
|
|
936
936
|
this.createButtonRow(parent, trustActions);
|
|
937
937
|
}
|
|
938
938
|
addDontTrustButtonToElement(parent) {
|
|
939
939
|
this.createButtonRow(parent, [{
|
|
940
|
-
action: ( new Action('workspace.trust.button.action.deny', ( localize(
|
|
940
|
+
action: this.rerenderDisposables.add(( new Action('workspace.trust.button.action.deny', ( localize(11433, "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]
|
|
944
944
|
}]);
|
|
945
945
|
}
|
|
@@ -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
|
+
11434,
|
|
954
954
|
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
955
955
|
)) : ( localize(
|
|
956
|
-
|
|
957
|
-
"This folder is trusted via the bolded entries in the
|
|
956
|
+
11435,
|
|
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(11436, "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(12470, '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(12471, "Workspace Trust");
|
|
31
31
|
}
|
|
32
32
|
getIcon() {
|
|
33
33
|
return WorkspaceTrustEditorIcon;
|