@codingame/monaco-vscode-workspace-trust-service-override 1.83.2 → 1.83.3
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 +64 -223
- package/vscode/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.js +90 -166
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +11 -9
- 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": "1.83.
|
|
3
|
+
"version": "1.83.3",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.83.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.83.3",
|
|
22
22
|
"monaco-editor": "0.44.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.e
|
|
|
2
2
|
import './media/workspaceTrustEditor.css.js';
|
|
3
3
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
4
4
|
import { Disposable, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
5
|
-
import {
|
|
5
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
6
6
|
import { registerAction2, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
7
7
|
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
8
8
|
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
@@ -83,40 +83,22 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
83
83
|
this._register(this.workspaceTrustRequestService.onDidInitiateOpenFilesTrustRequest(async () => {
|
|
84
84
|
const markdownDetails = [
|
|
85
85
|
this.workspaceContextService.getWorkbenchState() !== 1 ?
|
|
86
|
-
(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)) :
|
|
90
|
-
( localize(
|
|
91
|
-
'openLooseFileWindowDetails',
|
|
92
|
-
"You are trying to open untrusted files in a window which is trusted."
|
|
93
|
-
)),
|
|
94
|
-
( localize(
|
|
95
|
-
'openLooseFileLearnMore',
|
|
96
|
-
"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."
|
|
97
|
-
))
|
|
86
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'openLooseFileWorkspaceDetails', "You are trying to open untrusted files in a workspace which is trusted.") :
|
|
87
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'openLooseFileWindowDetails', "You are trying to open untrusted files in a window which is trusted."),
|
|
88
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'openLooseFileLearnMore', "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.")
|
|
98
89
|
];
|
|
99
90
|
await this.dialogService.prompt({
|
|
100
91
|
type: Severity.Info,
|
|
101
92
|
message: this.workspaceContextService.getWorkbenchState() !== 1 ?
|
|
102
|
-
(
|
|
103
|
-
|
|
104
|
-
"Do you want to allow untrusted files in this workspace?"
|
|
105
|
-
)) :
|
|
106
|
-
( localize(
|
|
107
|
-
'openLooseFileWindowMesssage',
|
|
108
|
-
"Do you want to allow untrusted files in this window?"
|
|
109
|
-
)),
|
|
93
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'openLooseFileWorkspaceMesssage', "Do you want to allow untrusted files in this workspace?") :
|
|
94
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'openLooseFileWindowMesssage', "Do you want to allow untrusted files in this window?"),
|
|
110
95
|
buttons: [
|
|
111
96
|
{
|
|
112
|
-
label: (
|
|
97
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'open', comment: ['&& denotes a mnemonic'] }, "&&Open"),
|
|
113
98
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(1 , !!checkboxChecked)
|
|
114
99
|
},
|
|
115
100
|
{
|
|
116
|
-
label: (
|
|
117
|
-
{ key: 'newWindow', comment: ['&& denotes a mnemonic'] },
|
|
118
|
-
"Open in &&Restricted Mode"
|
|
119
|
-
)),
|
|
101
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'newWindow', comment: ['&& denotes a mnemonic'] }, "Open in &&Restricted Mode"),
|
|
120
102
|
run: ({ checkboxChecked }) => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(2 , !!checkboxChecked)
|
|
121
103
|
}
|
|
122
104
|
],
|
|
@@ -124,10 +106,7 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
124
106
|
run: () => this.workspaceTrustRequestService.completeOpenFilesTrustRequest(3 )
|
|
125
107
|
},
|
|
126
108
|
checkbox: {
|
|
127
|
-
label: (
|
|
128
|
-
'openLooseFileWorkspaceCheckbox',
|
|
129
|
-
"Remember my decision for all workspaces"
|
|
130
|
-
)),
|
|
109
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'openLooseFileWorkspaceCheckbox', "Remember my decision for all workspaces"),
|
|
131
110
|
checked: false
|
|
132
111
|
},
|
|
133
112
|
custom: {
|
|
@@ -138,31 +117,16 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
138
117
|
}));
|
|
139
118
|
this._register(this.workspaceTrustRequestService.onDidInitiateWorkspaceTrustRequest(async (requestOptions) => {
|
|
140
119
|
const message = this.useWorkspaceLanguage ?
|
|
141
|
-
(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
)) :
|
|
145
|
-
( localize('folderTrust', "Do you trust the authors of the files in this folder?"));
|
|
146
|
-
const defaultDetails = ( localize(
|
|
147
|
-
'immediateTrustRequestMessage',
|
|
148
|
-
"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."
|
|
149
|
-
));
|
|
120
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspaceTrust', "Do you trust the authors of the files in this workspace?") :
|
|
121
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'folderTrust', "Do you trust the authors of the files in this folder?");
|
|
122
|
+
const defaultDetails = localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'immediateTrustRequestMessage', "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.");
|
|
150
123
|
const details = requestOptions?.message ?? defaultDetails;
|
|
151
124
|
const buttons = requestOptions?.buttons ?? [
|
|
152
|
-
{ label: this.useWorkspaceLanguage ? (
|
|
153
|
-
|
|
154
|
-
"&&Trust Workspace & Continue"
|
|
155
|
-
)) : ( localize(
|
|
156
|
-
{ key: 'grantFolderTrustButton', comment: ['&& denotes a mnemonic'] },
|
|
157
|
-
"&&Trust Folder & Continue"
|
|
158
|
-
)), type: 'ContinueWithTrust' },
|
|
159
|
-
{ label: ( localize(
|
|
160
|
-
{ key: 'manageWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] },
|
|
161
|
-
"&&Manage"
|
|
162
|
-
)), type: 'Manage' }
|
|
125
|
+
{ label: this.useWorkspaceLanguage ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'grantWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] }, "&&Trust Workspace & Continue") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'grantFolderTrustButton', comment: ['&& denotes a mnemonic'] }, "&&Trust Folder & Continue"), type: 'ContinueWithTrust' },
|
|
126
|
+
{ label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'manageWorkspaceTrustButton', comment: ['&& denotes a mnemonic'] }, "&&Manage"), type: 'Manage' }
|
|
163
127
|
];
|
|
164
128
|
if (!( buttons.some(b => b.type === 'Cancel'))) {
|
|
165
|
-
buttons.push({ label: (
|
|
129
|
+
buttons.push({ label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'cancelWorkspaceTrustButton', "Cancel"), type: 'Cancel' });
|
|
166
130
|
}
|
|
167
131
|
const { result } = await this.dialogService.prompt({
|
|
168
132
|
type: Severity.Info,
|
|
@@ -171,10 +135,9 @@ let WorkspaceTrustRequestHandler = class WorkspaceTrustRequestHandler extends Di
|
|
|
171
135
|
icon: Codicon.shield,
|
|
172
136
|
markdownDetails: [
|
|
173
137
|
{ markdown: ( new MarkdownString(details)) },
|
|
174
|
-
{ markdown: ( new MarkdownString(
|
|
175
|
-
'immediateTrustRequestLearnMore',
|
|
176
|
-
|
|
177
|
-
)))) }
|
|
138
|
+
{ markdown: ( new MarkdownString(
|
|
139
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'immediateTrustRequestLearnMore', "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.")
|
|
140
|
+
)) }
|
|
178
141
|
]
|
|
179
142
|
},
|
|
180
143
|
buttons: ( buttons.filter(b => b.type !== 'Cancel').map(button => {
|
|
@@ -273,15 +236,9 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
273
236
|
if (!( addedFoldersTrustInfo.map(info => info.trusted)).every(trusted => trusted)) {
|
|
274
237
|
const { confirmed } = await this.dialogService.confirm({
|
|
275
238
|
type: Severity.Info,
|
|
276
|
-
message: (
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
)),
|
|
280
|
-
detail: ( localize(
|
|
281
|
-
'addWorkspaceFolderDetail',
|
|
282
|
-
"You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"
|
|
283
|
-
)),
|
|
284
|
-
cancelButton: ( localize('no', 'No')),
|
|
239
|
+
message: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'addWorkspaceFolderMessage', "Do you trust the authors of the files in this folder?"),
|
|
240
|
+
detail: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'addWorkspaceFolderDetail', "You are adding files that are not currently trusted to a trusted workspace. Do you trust the authors of these new files?"),
|
|
241
|
+
cancelButton: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'no', 'No'),
|
|
285
242
|
custom: { icon: Codicon.shield }
|
|
286
243
|
});
|
|
287
244
|
await this.workspaceTrustManagementService.setUrisTrust(( addedFoldersTrustInfo.map(i => i.uri)), confirmed);
|
|
@@ -309,51 +266,21 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
309
266
|
console.warn('AI generated workspace trust dialog contents not available.');
|
|
310
267
|
}
|
|
311
268
|
const title = titleString ?? (this.useWorkspaceLanguage ?
|
|
312
|
-
(
|
|
313
|
-
|
|
314
|
-
"Do you trust the authors of the files in this workspace?"
|
|
315
|
-
)) :
|
|
316
|
-
( localize('folderTrust', "Do you trust the authors of the files in this folder?")));
|
|
269
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspaceTrust', "Do you trust the authors of the files in this workspace?") :
|
|
270
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'folderTrust', "Do you trust the authors of the files in this folder?"));
|
|
317
271
|
let checkboxText;
|
|
318
272
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceContextService.getWorkspace());
|
|
319
273
|
const isSingleFolderWorkspace = isSingleFolderWorkspaceIdentifier(workspaceIdentifier);
|
|
320
274
|
const isEmptyWindow = isEmptyWorkspaceIdentifier(workspaceIdentifier);
|
|
321
275
|
if (!isAiGeneratedWorkspace && this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
322
276
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
323
|
-
checkboxText = (
|
|
324
|
-
'checkboxString',
|
|
325
|
-
"Trust the authors of all files in the parent folder '{0}'",
|
|
326
|
-
name
|
|
327
|
-
));
|
|
277
|
+
checkboxText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'checkboxString', "Trust the authors of all files in the parent folder '{0}'", name);
|
|
328
278
|
}
|
|
329
|
-
this.doShowModal(title, { label: trustOption ?? (
|
|
330
|
-
{ key: 'trustOption', comment: ['&& denotes a mnemonic'] },
|
|
331
|
-
"&&Yes, I trust the authors"
|
|
332
|
-
)), sublabel: isSingleFolderWorkspace ? ( localize('trustFolderOptionDescription', "Trust folder and enable all features")) : ( localize(
|
|
333
|
-
'trustWorkspaceOptionDescription',
|
|
334
|
-
"Trust workspace and enable all features"
|
|
335
|
-
)) }, { label: dontTrustOption ?? ( localize(
|
|
336
|
-
{ key: 'dontTrustOption', comment: ['&& denotes a mnemonic'] },
|
|
337
|
-
"&&No, I don't trust the authors"
|
|
338
|
-
)), sublabel: isSingleFolderWorkspace ? ( localize('dontTrustFolderOptionDescription', "Browse folder in restricted mode")) : ( localize(
|
|
339
|
-
'dontTrustWorkspaceOptionDescription',
|
|
340
|
-
"Browse workspace in restricted mode"
|
|
341
|
-
)) }, [
|
|
279
|
+
this.doShowModal(title, { label: trustOption ?? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'trustOption', comment: ['&& denotes a mnemonic'] }, "&&Yes, I trust the authors"), sublabel: isSingleFolderWorkspace ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'trustFolderOptionDescription', "Trust folder and enable all features") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'trustWorkspaceOptionDescription', "Trust workspace and enable all features") }, { label: dontTrustOption ?? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'dontTrustOption', comment: ['&& denotes a mnemonic'] }, "&&No, I don't trust the authors"), sublabel: isSingleFolderWorkspace ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'dontTrustFolderOptionDescription', "Browse folder in restricted mode") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'dontTrustWorkspaceOptionDescription', "Browse workspace in restricted mode") }, [
|
|
342
280
|
!isSingleFolderWorkspace ?
|
|
343
|
-
(
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
this.productService.nameShort
|
|
347
|
-
)) :
|
|
348
|
-
( localize(
|
|
349
|
-
'folderStartupTrustDetails',
|
|
350
|
-
"{0} provides features that may automatically execute files in this folder.",
|
|
351
|
-
this.productService.nameShort
|
|
352
|
-
)),
|
|
353
|
-
learnMoreString ?? ( localize(
|
|
354
|
-
'startupTrustRequestLearnMore',
|
|
355
|
-
"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."
|
|
356
|
-
)),
|
|
281
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspaceStartupTrustDetails', "{0} provides features that may automatically execute files in this workspace.", this.productService.nameShort) :
|
|
282
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'folderStartupTrustDetails', "{0} provides features that may automatically execute files in this folder.", this.productService.nameShort),
|
|
283
|
+
learnMoreString ?? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'startupTrustRequestLearnMore', "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."),
|
|
357
284
|
!isEmptyWindow ?
|
|
358
285
|
`\`${this.labelService.getWorkspaceLabel(workspaceIdentifier, { verbose: 2 })}\`` : '',
|
|
359
286
|
], checkboxText);
|
|
@@ -469,11 +396,11 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
469
396
|
}
|
|
470
397
|
const actions = [
|
|
471
398
|
{
|
|
472
|
-
label: (
|
|
399
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerManage', "Manage"),
|
|
473
400
|
href: 'command:' + MANAGE_TRUST_COMMAND_ID
|
|
474
401
|
},
|
|
475
402
|
{
|
|
476
|
-
label: (
|
|
403
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerLearnMore', "Learn More"),
|
|
477
404
|
href: 'https://aka.ms/vscode-workspace-trust'
|
|
478
405
|
}
|
|
479
406
|
];
|
|
@@ -493,39 +420,21 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
493
420
|
getBannerItemAriaLabels() {
|
|
494
421
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
495
422
|
case 1 :
|
|
496
|
-
return (
|
|
497
|
-
'restrictedModeBannerAriaLabelWindow',
|
|
498
|
-
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions."
|
|
499
|
-
));
|
|
423
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerAriaLabelWindow', "Restricted Mode is intended for safe code browsing. Trust this window to enable all features. Use navigation keys to access banner actions.");
|
|
500
424
|
case 2 :
|
|
501
|
-
return (
|
|
502
|
-
'restrictedModeBannerAriaLabelFolder',
|
|
503
|
-
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions."
|
|
504
|
-
));
|
|
425
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerAriaLabelFolder', "Restricted Mode is intended for safe code browsing. Trust this folder to enable all features. Use navigation keys to access banner actions.");
|
|
505
426
|
case 3 :
|
|
506
|
-
return (
|
|
507
|
-
'restrictedModeBannerAriaLabelWorkspace',
|
|
508
|
-
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions."
|
|
509
|
-
));
|
|
427
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerAriaLabelWorkspace', "Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features. Use navigation keys to access banner actions.");
|
|
510
428
|
}
|
|
511
429
|
}
|
|
512
430
|
getBannerItemMessages() {
|
|
513
431
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
514
432
|
case 1 :
|
|
515
|
-
return (
|
|
516
|
-
'restrictedModeBannerMessageWindow',
|
|
517
|
-
"Restricted Mode is intended for safe code browsing. Trust this window to enable all features."
|
|
518
|
-
));
|
|
433
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerMessageWindow', "Restricted Mode is intended for safe code browsing. Trust this window to enable all features.");
|
|
519
434
|
case 2 :
|
|
520
|
-
return (
|
|
521
|
-
'restrictedModeBannerMessageFolder',
|
|
522
|
-
"Restricted Mode is intended for safe code browsing. Trust this folder to enable all features."
|
|
523
|
-
));
|
|
435
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerMessageFolder', "Restricted Mode is intended for safe code browsing. Trust this folder to enable all features.");
|
|
524
436
|
case 3 :
|
|
525
|
-
return (
|
|
526
|
-
'restrictedModeBannerMessageWorkspace',
|
|
527
|
-
"Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features."
|
|
528
|
-
));
|
|
437
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'restrictedModeBannerMessageWorkspace', "Restricted Mode is intended for safe code browsing. Trust this workspace to enable all features.");
|
|
529
438
|
}
|
|
530
439
|
}
|
|
531
440
|
get bannerSetting() {
|
|
@@ -546,54 +455,30 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
546
455
|
let toolTip;
|
|
547
456
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
548
457
|
case 1 : {
|
|
549
|
-
ariaLabel = trusted ? (
|
|
550
|
-
(
|
|
551
|
-
'status.ariaUntrustedWindow',
|
|
552
|
-
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
553
|
-
));
|
|
458
|
+
ariaLabel = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.ariaTrustedWindow', "This window is trusted.") :
|
|
459
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.ariaUntrustedWindow', "Restricted Mode: Some features are disabled because this window is not trusted.");
|
|
554
460
|
toolTip = trusted ? ariaLabel : {
|
|
555
|
-
value: (
|
|
556
|
-
{ key: 'status.tooltipUntrustedWindow2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `window is not trusted`. Do not change brackets and parentheses or {n}'] },
|
|
557
|
-
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
558
|
-
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
559
|
-
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
560
|
-
)),
|
|
461
|
+
value: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'status.tooltipUntrustedWindow2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `window is not trusted`. Do not change brackets and parentheses or {n}'] }, "Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).", `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`, `command:${MANAGE_TRUST_COMMAND_ID}`),
|
|
561
462
|
isTrusted: true,
|
|
562
463
|
supportThemeIcons: true
|
|
563
464
|
};
|
|
564
465
|
break;
|
|
565
466
|
}
|
|
566
467
|
case 2 : {
|
|
567
|
-
ariaLabel = trusted ? (
|
|
568
|
-
(
|
|
569
|
-
'status.ariaUntrustedFolder',
|
|
570
|
-
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
571
|
-
));
|
|
468
|
+
ariaLabel = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.ariaTrustedFolder', "This folder is trusted.") :
|
|
469
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.ariaUntrustedFolder', "Restricted Mode: Some features are disabled because this folder is not trusted.");
|
|
572
470
|
toolTip = trusted ? ariaLabel : {
|
|
573
|
-
value: (
|
|
574
|
-
{ key: 'status.tooltipUntrustedFolder2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `folder is not trusted`. Do not change brackets and parentheses or {n}'] },
|
|
575
|
-
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
576
|
-
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
577
|
-
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
578
|
-
)),
|
|
471
|
+
value: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'status.tooltipUntrustedFolder2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `folder is not trusted`. Do not change brackets and parentheses or {n}'] }, "Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).", `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`, `command:${MANAGE_TRUST_COMMAND_ID}`),
|
|
579
472
|
isTrusted: true,
|
|
580
473
|
supportThemeIcons: true
|
|
581
474
|
};
|
|
582
475
|
break;
|
|
583
476
|
}
|
|
584
477
|
case 3 : {
|
|
585
|
-
ariaLabel = trusted ? (
|
|
586
|
-
(
|
|
587
|
-
'status.ariaUntrustedWorkspace',
|
|
588
|
-
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
589
|
-
));
|
|
478
|
+
ariaLabel = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.ariaTrustedWorkspace', "This workspace is trusted.") :
|
|
479
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.ariaUntrustedWorkspace', "Restricted Mode: Some features are disabled because this workspace is not trusted.");
|
|
590
480
|
toolTip = trusted ? ariaLabel : {
|
|
591
|
-
value: (
|
|
592
|
-
{ key: 'status.tooltipUntrustedWorkspace2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `workspace is not trusted`. Do not change brackets and parentheses or {n}'] },
|
|
593
|
-
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
594
|
-
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
595
|
-
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
596
|
-
)),
|
|
481
|
+
value: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', { key: 'status.tooltipUntrustedWorkspace2', comment: ['[abc]({n}) are links. Only translate `features are disabled` and `workspace is not trusted`. Do not change brackets and parentheses or {n}'] }, "Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).", `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`, `command:${MANAGE_TRUST_COMMAND_ID}`),
|
|
597
482
|
isTrusted: true,
|
|
598
483
|
supportThemeIcons: true
|
|
599
484
|
};
|
|
@@ -601,7 +486,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
601
486
|
}
|
|
602
487
|
}
|
|
603
488
|
return {
|
|
604
|
-
name: (
|
|
489
|
+
name: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'status.WorkspaceTrust', "Workspace Trust"),
|
|
605
490
|
text: trusted ? `$(shield)` : `$(shield) ${text}`,
|
|
606
491
|
ariaLabel: ariaLabel,
|
|
607
492
|
tooltip: toolTip,
|
|
@@ -633,16 +518,16 @@ WorkspaceTrustUXHandler = ( __decorate([
|
|
|
633
518
|
], WorkspaceTrustUXHandler));
|
|
634
519
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustRequestHandler, 2 );
|
|
635
520
|
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(WorkspaceTrustUXHandler, 3 );
|
|
636
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, (
|
|
521
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspaceTrustEditor', "Workspace Trust Editor")), [
|
|
637
522
|
( new SyncDescriptor(WorkspaceTrustEditorInput))
|
|
638
523
|
]);
|
|
639
524
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
640
|
-
const WORKSPACES_CATEGORY = { value: (
|
|
525
|
+
const WORKSPACES_CATEGORY = { value: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspacesCategory', "Workspaces"), original: 'Workspaces' };
|
|
641
526
|
registerAction2(class extends Action2 {
|
|
642
527
|
constructor() {
|
|
643
528
|
super({
|
|
644
529
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
645
|
-
title: { original: 'Configure Workspace Trust Settings', value: (
|
|
530
|
+
title: { original: 'Configure Workspace Trust Settings', value: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'configureWorkspaceTrustSettings', "Configure Workspace Trust Settings") },
|
|
646
531
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
647
532
|
category: WORKSPACES_CATEGORY,
|
|
648
533
|
f1: true
|
|
@@ -656,7 +541,7 @@ registerAction2(class extends Action2 {
|
|
|
656
541
|
constructor() {
|
|
657
542
|
super({
|
|
658
543
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
659
|
-
title: { original: 'Manage Workspace Trust', value: (
|
|
544
|
+
title: { original: 'Manage Workspace Trust', value: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'manageWorkspaceTrust', "Manage Workspace Trust") },
|
|
660
545
|
precondition: ( ContextKeyExpr.and(WorkspaceTrustContext.IsEnabled, ( ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true)))),
|
|
661
546
|
category: WORKSPACES_CATEGORY,
|
|
662
547
|
f1: true,
|
|
@@ -677,97 +562,53 @@ registerAction2(class extends Action2 {
|
|
|
677
562
|
[WORKSPACE_TRUST_ENABLED]: {
|
|
678
563
|
type: 'boolean',
|
|
679
564
|
default: true,
|
|
680
|
-
description: (
|
|
681
|
-
'workspace.trust.description',
|
|
682
|
-
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
683
|
-
)),
|
|
565
|
+
description: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.description', "Controls whether or not Workspace Trust is enabled within VS Code."),
|
|
684
566
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
685
567
|
scope: 1 ,
|
|
686
568
|
},
|
|
687
569
|
[WORKSPACE_TRUST_STARTUP_PROMPT]: {
|
|
688
570
|
type: 'string',
|
|
689
571
|
default: 'once',
|
|
690
|
-
description: (
|
|
691
|
-
'workspace.trust.startupPrompt.description',
|
|
692
|
-
"Controls when the startup prompt to trust a workspace is shown."
|
|
693
|
-
)),
|
|
572
|
+
description: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.startupPrompt.description', "Controls when the startup prompt to trust a workspace is shown."),
|
|
694
573
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
695
574
|
scope: 1 ,
|
|
696
575
|
enum: ['always', 'once', 'never'],
|
|
697
576
|
enumDescriptions: [
|
|
698
|
-
(
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
)),
|
|
702
|
-
( localize(
|
|
703
|
-
'workspace.trust.startupPrompt.once',
|
|
704
|
-
"Ask for trust the first time an untrusted workspace is opened."
|
|
705
|
-
)),
|
|
706
|
-
( localize(
|
|
707
|
-
'workspace.trust.startupPrompt.never',
|
|
708
|
-
"Do not ask for trust when an untrusted workspace is opened."
|
|
709
|
-
)),
|
|
577
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.startupPrompt.always', "Ask for trust every time an untrusted workspace is opened."),
|
|
578
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.startupPrompt.once', "Ask for trust the first time an untrusted workspace is opened."),
|
|
579
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.startupPrompt.never', "Do not ask for trust when an untrusted workspace is opened."),
|
|
710
580
|
]
|
|
711
581
|
},
|
|
712
582
|
[WORKSPACE_TRUST_BANNER]: {
|
|
713
583
|
type: 'string',
|
|
714
584
|
default: 'untilDismissed',
|
|
715
|
-
description: (
|
|
716
|
-
'workspace.trust.banner.description',
|
|
717
|
-
"Controls when the restricted mode banner is shown."
|
|
718
|
-
)),
|
|
585
|
+
description: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.banner.description', "Controls when the restricted mode banner is shown."),
|
|
719
586
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
720
587
|
scope: 1 ,
|
|
721
588
|
enum: ['always', 'untilDismissed', 'never'],
|
|
722
589
|
enumDescriptions: [
|
|
723
|
-
(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
)),
|
|
727
|
-
( localize(
|
|
728
|
-
'workspace.trust.banner.untilDismissed',
|
|
729
|
-
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
730
|
-
)),
|
|
731
|
-
( localize(
|
|
732
|
-
'workspace.trust.banner.never',
|
|
733
|
-
"Do not show the banner when an untrusted workspace is open."
|
|
734
|
-
)),
|
|
590
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.banner.always', "Show the banner every time an untrusted workspace is open."),
|
|
591
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.banner.untilDismissed', "Show the banner when an untrusted workspace is opened until dismissed."),
|
|
592
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.banner.never', "Do not show the banner when an untrusted workspace is open."),
|
|
735
593
|
]
|
|
736
594
|
},
|
|
737
595
|
[WORKSPACE_TRUST_UNTRUSTED_FILES]: {
|
|
738
596
|
type: 'string',
|
|
739
597
|
default: 'prompt',
|
|
740
|
-
markdownDescription: (
|
|
741
|
-
'workspace.trust.untrustedFiles.description',
|
|
742
|
-
"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}#`.",
|
|
743
|
-
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
744
|
-
)),
|
|
598
|
+
markdownDescription: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.untrustedFiles.description', "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}#`.", WORKSPACE_TRUST_EMPTY_WINDOW),
|
|
745
599
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
746
600
|
scope: 1 ,
|
|
747
601
|
enum: ['prompt', 'open', 'newWindow'],
|
|
748
602
|
enumDescriptions: [
|
|
749
|
-
(
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
)),
|
|
753
|
-
( localize(
|
|
754
|
-
'workspace.trust.untrustedFiles.open',
|
|
755
|
-
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
756
|
-
)),
|
|
757
|
-
( localize(
|
|
758
|
-
'workspace.trust.untrustedFiles.newWindow',
|
|
759
|
-
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
760
|
-
)),
|
|
603
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.untrustedFiles.prompt', "Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."),
|
|
604
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.untrustedFiles.open', "Always allow untrusted files to be introduced to a trusted workspace without prompting."),
|
|
605
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.untrustedFiles.newWindow', "Always open untrusted files in a separate window in restricted mode without prompting."),
|
|
761
606
|
]
|
|
762
607
|
},
|
|
763
608
|
[WORKSPACE_TRUST_EMPTY_WINDOW]: {
|
|
764
609
|
type: 'boolean',
|
|
765
610
|
default: true,
|
|
766
|
-
markdownDescription: (
|
|
767
|
-
'workspace.trust.emptyWindow.description',
|
|
768
|
-
"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.",
|
|
769
|
-
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
770
|
-
)),
|
|
611
|
+
markdownDescription: localizeWithPath('vs/workbench/contrib/workspace/browser/workspace.contribution', 'workspace.trust.emptyWindow.description', "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.", WORKSPACE_TRUST_UNTRUSTED_FILES),
|
|
771
612
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
772
613
|
scope: 1
|
|
773
614
|
}
|
|
@@ -13,7 +13,7 @@ import { DisposableStore, Disposable } from 'monaco-editor/esm/vs/base/common/li
|
|
|
13
13
|
import { parseLinkedText } from 'monaco-editor/esm/vs/base/common/linkedText.js';
|
|
14
14
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
15
15
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
16
|
-
import {
|
|
16
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
17
17
|
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
18
18
|
import { IContextViewService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
19
19
|
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
@@ -50,18 +50,12 @@ import { basename, dirname } from 'monaco-editor/esm/vs/base/common/resources.js
|
|
|
50
50
|
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
51
51
|
|
|
52
52
|
var TrustedUriActionsColumnRenderer_1, TrustedUriPathColumnRenderer_1, TrustedUriHostColumnRenderer_1, WorkspaceTrustEditor_1;
|
|
53
|
-
const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, (
|
|
54
|
-
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, (
|
|
55
|
-
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, (
|
|
56
|
-
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
)));
|
|
60
|
-
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, ( localize('editIcon', 'Icon for the edit folder icon in the workspace trust editor.')));
|
|
61
|
-
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, ( localize(
|
|
62
|
-
'removeIcon',
|
|
63
|
-
'Icon for the remove folder icon in the workspace trust editor.'
|
|
64
|
-
)));
|
|
53
|
+
const shieldIcon = registerIcon('workspace-trust-banner', Codicon.shield, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'shieldIcon', 'Icon for workspace trust ion the banner.'));
|
|
54
|
+
const checkListIcon = registerIcon('workspace-trust-editor-check', Codicon.check, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'checkListIcon', 'Icon for the checkmark in the workspace trust editor.'));
|
|
55
|
+
const xListIcon = registerIcon('workspace-trust-editor-cross', Codicon.x, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'xListIcon', 'Icon for the cross in the workspace trust editor.'));
|
|
56
|
+
const folderPickerIcon = registerIcon('workspace-trust-editor-folder-picker', Codicon.folder, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'folderPickerIcon', 'Icon for the pick folder icon in the workspace trust editor.'));
|
|
57
|
+
const editIcon = registerIcon('workspace-trust-editor-edit-folder', Codicon.edit, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'editIcon', 'Icon for the edit folder icon in the workspace trust editor.'));
|
|
58
|
+
const removeIcon = registerIcon('workspace-trust-editor-remove-folder', Codicon.close, localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'removeIcon', 'Icon for the remove folder icon in the workspace trust editor.'));
|
|
65
59
|
let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposable {
|
|
66
60
|
constructor(container, instantiationService, workspaceService, workspaceTrustManagementService, uriService, labelService, fileDialogService) {
|
|
67
61
|
super();
|
|
@@ -85,14 +79,14 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
85
79
|
const addButtonBarElement = container.appendChild($('.trusted-uris-button-bar'));
|
|
86
80
|
this.table = this.instantiationService.createInstance(WorkbenchTable, 'WorkspaceTrust', tableElement, ( new TrustedUriTableVirtualDelegate()), [
|
|
87
81
|
{
|
|
88
|
-
label: (
|
|
82
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'hostColumnLabel', "Host"),
|
|
89
83
|
tooltip: '',
|
|
90
84
|
weight: 1,
|
|
91
85
|
templateId: TrustedUriHostColumnRenderer.TEMPLATE_ID,
|
|
92
86
|
project(row) { return row; }
|
|
93
87
|
},
|
|
94
88
|
{
|
|
95
|
-
label: (
|
|
89
|
+
label: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'pathColumnLabel', "Path"),
|
|
96
90
|
tooltip: '',
|
|
97
91
|
weight: 8,
|
|
98
92
|
templateId: TrustedUriPathColumnRenderer.TEMPLATE_ID,
|
|
@@ -120,20 +114,11 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
120
114
|
getAriaLabel: (item) => {
|
|
121
115
|
const hostLabel = getHostLabel(this.labelService, item);
|
|
122
116
|
if (hostLabel === undefined || hostLabel.length === 0) {
|
|
123
|
-
return (
|
|
124
|
-
'trustedFolderAriaLabel',
|
|
125
|
-
"{0}, trusted",
|
|
126
|
-
this.labelService.getUriLabel(item.uri)
|
|
127
|
-
));
|
|
117
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolderAriaLabel', "{0}, trusted", this.labelService.getUriLabel(item.uri));
|
|
128
118
|
}
|
|
129
|
-
return (
|
|
130
|
-
'trustedFolderWithHostAriaLabel',
|
|
131
|
-
"{0} on {1}, trusted",
|
|
132
|
-
this.labelService.getUriLabel(item.uri),
|
|
133
|
-
hostLabel
|
|
134
|
-
));
|
|
119
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolderWithHostAriaLabel', "{0} on {1}, trusted", this.labelService.getUriLabel(item.uri), hostLabel);
|
|
135
120
|
},
|
|
136
|
-
getWidgetAriaLabel: () => (
|
|
121
|
+
getWidgetAriaLabel: () => localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFoldersAndWorkspaces', "Trusted Folders & Workspaces")
|
|
137
122
|
}
|
|
138
123
|
});
|
|
139
124
|
this._register(this.table.onDidOpen(item => {
|
|
@@ -142,16 +127,16 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
142
127
|
}
|
|
143
128
|
}));
|
|
144
129
|
const buttonBar = this._register(( new ButtonBar(addButtonBarElement)));
|
|
145
|
-
const addButton = this._register(buttonBar.addButton({ title: (
|
|
146
|
-
addButton.label = (
|
|
130
|
+
const addButton = this._register(buttonBar.addButton({ title: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'addButton', "Add Folder"), ...defaultButtonStyles }));
|
|
131
|
+
addButton.label = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'addButton', "Add Folder");
|
|
147
132
|
this._register(addButton.onDidClick(async () => {
|
|
148
133
|
const uri = await this.fileDialogService.showOpenDialog({
|
|
149
134
|
canSelectFiles: false,
|
|
150
135
|
canSelectFolders: true,
|
|
151
136
|
canSelectMany: false,
|
|
152
137
|
defaultUri: this.currentWorkspaceUri,
|
|
153
|
-
openLabel: (
|
|
154
|
-
title: (
|
|
138
|
+
openLabel: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustUri', "Trust Folder"),
|
|
139
|
+
title: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'selectTrustedUri', "Select Folder To Trust")
|
|
155
140
|
});
|
|
156
141
|
if (uri) {
|
|
157
142
|
this.workspaceTrustManagementService.setUrisTrust(uri, true);
|
|
@@ -231,14 +216,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
231
216
|
const entries = this.trustedUriEntries;
|
|
232
217
|
this.container.classList.toggle('empty', entries.length === 0);
|
|
233
218
|
this.descriptionElement.innerText = entries.length ?
|
|
234
|
-
(
|
|
235
|
-
|
|
236
|
-
"You trust the following folders, their subfolders, and workspace files."
|
|
237
|
-
)) :
|
|
238
|
-
( localize(
|
|
239
|
-
'noTrustedFoldersDescriptions',
|
|
240
|
-
"You haven't trusted any folders or workspace files yet."
|
|
241
|
-
));
|
|
219
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFoldersDescription', "You trust the following folders, their subfolders, and workspace files.") :
|
|
220
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'noTrustedFoldersDescriptions', "You haven't trusted any folders or workspace files yet.");
|
|
242
221
|
this.table.splice(0, Number.POSITIVE_INFINITY, this.trustedUriEntries);
|
|
243
222
|
this.layout();
|
|
244
223
|
}
|
|
@@ -251,32 +230,19 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
251
230
|
if (segments.length === 0 && path.startsWith(posix.sep)) {
|
|
252
231
|
return {
|
|
253
232
|
type: 2 ,
|
|
254
|
-
content: (
|
|
255
|
-
{ key: 'trustAll', comment: ['The {0} will be a host name where repositories are hosted.'] },
|
|
256
|
-
"You will trust all repositories on {0}.",
|
|
257
|
-
getHostLabel(this.labelService, item)
|
|
258
|
-
))
|
|
233
|
+
content: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'trustAll', comment: ['The {0} will be a host name where repositories are hosted.'] }, "You will trust all repositories on {0}.", getHostLabel(this.labelService, item))
|
|
259
234
|
};
|
|
260
235
|
}
|
|
261
236
|
if (segments.length === 1) {
|
|
262
237
|
return {
|
|
263
238
|
type: 2 ,
|
|
264
|
-
content: (
|
|
265
|
-
{ key: 'trustOrg', comment: ['The {0} will be an organization or user name.', 'The {1} will be a host name where repositories are hosted.'] },
|
|
266
|
-
"You will trust all repositories and forks under '{0}' on {1}.",
|
|
267
|
-
segments[0],
|
|
268
|
-
getHostLabel(this.labelService, item)
|
|
269
|
-
))
|
|
239
|
+
content: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'trustOrg', comment: ['The {0} will be an organization or user name.', 'The {1} will be a host name where repositories are hosted.'] }, "You will trust all repositories and forks under '{0}' on {1}.", segments[0], getHostLabel(this.labelService, item))
|
|
270
240
|
};
|
|
271
241
|
}
|
|
272
242
|
if (segments.length > 2) {
|
|
273
243
|
return {
|
|
274
244
|
type: 3 ,
|
|
275
|
-
content: (
|
|
276
|
-
'invalidTrust',
|
|
277
|
-
"You cannot trust individual folders within a repository.",
|
|
278
|
-
path
|
|
279
|
-
))
|
|
245
|
+
content: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'invalidTrust', "You cannot trust individual folders within a repository.", path)
|
|
280
246
|
};
|
|
281
247
|
}
|
|
282
248
|
}
|
|
@@ -312,8 +278,8 @@ let WorkspaceTrustedUrisTable = class WorkspaceTrustedUrisTable extends Disposab
|
|
|
312
278
|
canSelectFolders: true,
|
|
313
279
|
canSelectMany: false,
|
|
314
280
|
defaultUri: item.uri,
|
|
315
|
-
openLabel: (
|
|
316
|
-
title: (
|
|
281
|
+
openLabel: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustUri', "Trust Folder"),
|
|
282
|
+
title: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'selectTrustedUri', "Select Folder To Trust")
|
|
317
283
|
});
|
|
318
284
|
if (uri) {
|
|
319
285
|
this.acceptEdit(item, uri[0]);
|
|
@@ -379,7 +345,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
379
345
|
class: ThemeIcon.asClassName(editIcon),
|
|
380
346
|
enabled: true,
|
|
381
347
|
id: 'editTrustedUri',
|
|
382
|
-
tooltip: (
|
|
348
|
+
tooltip: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'editTrustedUri', "Edit Path"),
|
|
383
349
|
run: () => {
|
|
384
350
|
this.table.edit(item, false);
|
|
385
351
|
}
|
|
@@ -390,7 +356,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
390
356
|
class: ThemeIcon.asClassName(folderPickerIcon),
|
|
391
357
|
enabled: true,
|
|
392
358
|
id: 'pickerTrustedUri',
|
|
393
|
-
tooltip: (
|
|
359
|
+
tooltip: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'pickerTrustedUri', "Open File Picker"),
|
|
394
360
|
run: () => {
|
|
395
361
|
this.table.edit(item, true);
|
|
396
362
|
}
|
|
@@ -401,7 +367,7 @@ let TrustedUriActionsColumnRenderer = class TrustedUriActionsColumnRenderer {
|
|
|
401
367
|
class: ThemeIcon.asClassName(removeIcon),
|
|
402
368
|
enabled: true,
|
|
403
369
|
id: 'deleteTrustedUri',
|
|
404
|
-
tooltip: (
|
|
370
|
+
tooltip: localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'deleteTrustedUri', "Delete Path"),
|
|
405
371
|
run: async () => {
|
|
406
372
|
await this.table.delete(item);
|
|
407
373
|
}
|
|
@@ -518,7 +484,7 @@ TrustedUriPathColumnRenderer = TrustedUriPathColumnRenderer_1 = ( __decorate([
|
|
|
518
484
|
( __param(1, IContextViewService))
|
|
519
485
|
], TrustedUriPathColumnRenderer));
|
|
520
486
|
function getHostLabel(labelService, item) {
|
|
521
|
-
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : (
|
|
487
|
+
return item.uri.authority ? labelService.getHostLabel(item.uri.scheme, item.uri.authority) : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'localAuthority', "Local");
|
|
522
488
|
}
|
|
523
489
|
let TrustedUriHostColumnRenderer = class TrustedUriHostColumnRenderer {
|
|
524
490
|
static { TrustedUriHostColumnRenderer_1 = this; }
|
|
@@ -650,18 +616,18 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
650
616
|
getHeaderTitleText(trusted) {
|
|
651
617
|
if (trusted) {
|
|
652
618
|
if (this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
653
|
-
return (
|
|
619
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedUnsettableWindow', "This window is trusted");
|
|
654
620
|
}
|
|
655
621
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
656
622
|
case 1 :
|
|
657
|
-
return (
|
|
623
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedHeaderWindow', "You trust this window");
|
|
658
624
|
case 2 :
|
|
659
|
-
return (
|
|
625
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedHeaderFolder', "You trust this folder");
|
|
660
626
|
case 3 :
|
|
661
|
-
return (
|
|
627
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedHeaderWorkspace', "You trust this workspace");
|
|
662
628
|
}
|
|
663
629
|
}
|
|
664
|
-
return (
|
|
630
|
+
return localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedHeader', "You are in Restricted Mode");
|
|
665
631
|
}
|
|
666
632
|
getHeaderTitleIconClassNames(trusted) {
|
|
667
633
|
return ThemeIcon.asClassNameArray(shieldIcon);
|
|
@@ -671,39 +637,21 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
671
637
|
let subTitle = '';
|
|
672
638
|
switch (this.workspaceService.getWorkbenchState()) {
|
|
673
639
|
case 1 : {
|
|
674
|
-
title = trusted ? (
|
|
675
|
-
subTitle = trusted ? (
|
|
676
|
-
'
|
|
677
|
-
"You trust the authors of the files in the current window. All features are enabled:"
|
|
678
|
-
)) :
|
|
679
|
-
( localize(
|
|
680
|
-
'untrustedWindowSubtitle',
|
|
681
|
-
"You do not trust the authors of the files in the current window. The following features are disabled:"
|
|
682
|
-
));
|
|
640
|
+
title = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWindow', "In a Trusted Window") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspace', "In Restricted Mode");
|
|
641
|
+
subTitle = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWindowSubtitle', "You trust the authors of the files in the current window. All features are enabled:") :
|
|
642
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWindowSubtitle', "You do not trust the authors of the files in the current window. The following features are disabled:");
|
|
683
643
|
break;
|
|
684
644
|
}
|
|
685
645
|
case 2 : {
|
|
686
|
-
title = trusted ? (
|
|
687
|
-
subTitle = trusted ? (
|
|
688
|
-
'
|
|
689
|
-
"You trust the authors of the files in the current folder. All features are enabled:"
|
|
690
|
-
)) :
|
|
691
|
-
( localize(
|
|
692
|
-
'untrustedFolderSubtitle',
|
|
693
|
-
"You do not trust the authors of the files in the current folder. The following features are disabled:"
|
|
694
|
-
));
|
|
646
|
+
title = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolder', "In a Trusted Folder") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspace', "In Restricted Mode");
|
|
647
|
+
subTitle = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFolderSubtitle', "You trust the authors of the files in the current folder. All features are enabled:") :
|
|
648
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedFolderSubtitle', "You do not trust the authors of the files in the current folder. The following features are disabled:");
|
|
695
649
|
break;
|
|
696
650
|
}
|
|
697
651
|
case 3 : {
|
|
698
|
-
title = trusted ? (
|
|
699
|
-
subTitle = trusted ? (
|
|
700
|
-
'
|
|
701
|
-
"You trust the authors of the files in the current workspace. All features are enabled:"
|
|
702
|
-
)) :
|
|
703
|
-
( localize(
|
|
704
|
-
'untrustedWorkspaceSubtitle',
|
|
705
|
-
"You do not trust the authors of the files in the current workspace. The following features are disabled:"
|
|
706
|
-
));
|
|
652
|
+
title = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWorkspace', "In a Trusted Workspace") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspace', "In Restricted Mode");
|
|
653
|
+
subTitle = trusted ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedWorkspaceSubtitle', "You trust the authors of the files in the current workspace. All features are enabled:") :
|
|
654
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspaceSubtitle', "You do not trust the authors of the files in the current workspace. The following features are disabled:");
|
|
707
655
|
break;
|
|
708
656
|
}
|
|
709
657
|
}
|
|
@@ -724,21 +672,10 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
724
672
|
this.headerDescription.innerText = '';
|
|
725
673
|
const headerDescriptionText = append(this.headerDescription, $('div'));
|
|
726
674
|
headerDescriptionText.innerText = isWorkspaceTrusted ?
|
|
727
|
-
(
|
|
728
|
-
|
|
729
|
-
"All features are enabled because trust has been granted to the workspace."
|
|
730
|
-
)) :
|
|
731
|
-
( localize(
|
|
732
|
-
'untrustedDescription',
|
|
733
|
-
"{0} is in a restricted mode intended for safe code browsing.",
|
|
734
|
-
this.productService.nameShort
|
|
735
|
-
));
|
|
675
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedDescription', "All features are enabled because trust has been granted to the workspace.") :
|
|
676
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedDescription', "{0} is in a restricted mode intended for safe code browsing.", this.productService.nameShort);
|
|
736
677
|
const headerDescriptionActions = append(this.headerDescription, $('div'));
|
|
737
|
-
const headerDescriptionActionsText = (
|
|
738
|
-
{ key: 'workspaceTrustEditorHeaderActions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
|
|
739
|
-
"[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).",
|
|
740
|
-
`command:workbench.trust.configure`
|
|
741
|
-
));
|
|
678
|
+
const headerDescriptionActionsText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'workspaceTrustEditorHeaderActions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[Configure your settings]({0}) or [learn more](https://aka.ms/vscode-workspace-trust).", `command:workbench.trust.configure`);
|
|
742
679
|
for (const node of parseLinkedText(headerDescriptionActionsText).nodes) {
|
|
743
680
|
if (typeof node === 'string') {
|
|
744
681
|
append(headerDescriptionActions, document.createTextNode(node));
|
|
@@ -748,7 +685,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
748
685
|
}
|
|
749
686
|
}
|
|
750
687
|
this.headerContainer.className = this.getHeaderContainerClass(isWorkspaceTrusted);
|
|
751
|
-
this.rootElement.setAttribute('aria-label', `${(
|
|
688
|
+
this.rootElement.setAttribute('aria-label', `${localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'root element label', "Manage Workspace Trust")}: ${this.headerContainer.innerText}`);
|
|
752
689
|
const restrictedSettings = this.configurationService.restrictedSettings;
|
|
753
690
|
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
754
691
|
const settingsRequiringTrustedWorkspaceCount = restrictedSettings.default.filter(key => {
|
|
@@ -813,7 +750,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
813
750
|
createConfigurationElement(parent) {
|
|
814
751
|
this.configurationContainer = append(parent, $('.workspace-trust-settings', { tabIndex: '0' }));
|
|
815
752
|
const configurationTitle = append(this.configurationContainer, $('.workspace-trusted-folders-title'));
|
|
816
|
-
configurationTitle.innerText = (
|
|
753
|
+
configurationTitle.innerText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedFoldersAndWorkspaces', "Trusted Folders & Workspaces");
|
|
817
754
|
this.workspaceTrustedUrisTable = this._register(this.instantiationService.createInstance(WorkspaceTrustedUrisTable, this.configurationContainer));
|
|
818
755
|
}
|
|
819
756
|
createAffectedFeaturesElement(parent) {
|
|
@@ -828,48 +765,30 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
828
765
|
this.renderLimitationsHeaderElement(this.trustedContainer, trustedTitle, trustedSubTitle);
|
|
829
766
|
const trustedContainerItems = this.workspaceService.getWorkbenchState() === 1 ?
|
|
830
767
|
[
|
|
831
|
-
(
|
|
832
|
-
(
|
|
833
|
-
(
|
|
768
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedTasks', "Tasks are allowed to run"),
|
|
769
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedDebugging', "Debugging is enabled"),
|
|
770
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedExtensions', "All enabled extensions are activated")
|
|
834
771
|
] :
|
|
835
772
|
[
|
|
836
|
-
(
|
|
837
|
-
(
|
|
838
|
-
(
|
|
839
|
-
(
|
|
773
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedTasks', "Tasks are allowed to run"),
|
|
774
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedDebugging', "Debugging is enabled"),
|
|
775
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedSettings', "All workspace settings are applied"),
|
|
776
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedExtensions', "All enabled extensions are activated")
|
|
840
777
|
];
|
|
841
778
|
this.renderLimitationsListElement(this.trustedContainer, trustedContainerItems, ThemeIcon.asClassNameArray(checkListIcon));
|
|
842
779
|
const [untrustedTitle, untrustedSubTitle] = this.getFeaturesHeaderText(false);
|
|
843
780
|
this.renderLimitationsHeaderElement(this.untrustedContainer, untrustedTitle, untrustedSubTitle);
|
|
844
781
|
const untrustedContainerItems = this.workspaceService.getWorkbenchState() === 1 ?
|
|
845
782
|
[
|
|
846
|
-
(
|
|
847
|
-
(
|
|
848
|
-
fixBadLocalizedLinks((
|
|
849
|
-
{ key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
|
|
850
|
-
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
851
|
-
numExtensions,
|
|
852
|
-
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
853
|
-
)))
|
|
783
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedTasks', "Tasks are not allowed to run"),
|
|
784
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedDebugging', "Debugging is disabled"),
|
|
785
|
+
fixBadLocalizedLinks(localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[{0} extensions]({1}) are disabled or have limited functionality", numExtensions, `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`))
|
|
854
786
|
] :
|
|
855
787
|
[
|
|
856
|
-
(
|
|
857
|
-
(
|
|
858
|
-
fixBadLocalizedLinks(numSettings ? (
|
|
859
|
-
|
|
860
|
-
"[{0} workspace settings]({1}) are not applied",
|
|
861
|
-
numSettings,
|
|
862
|
-
'command:settings.filterUntrusted'
|
|
863
|
-
)) : ( localize(
|
|
864
|
-
'no untrustedSettings',
|
|
865
|
-
"Workspace settings requiring trust are not applied"
|
|
866
|
-
))),
|
|
867
|
-
fixBadLocalizedLinks(( localize(
|
|
868
|
-
{ key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] },
|
|
869
|
-
"[{0} extensions]({1}) are disabled or have limited functionality",
|
|
870
|
-
numExtensions,
|
|
871
|
-
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`
|
|
872
|
-
)))
|
|
788
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedTasks', "Tasks are not allowed to run"),
|
|
789
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedDebugging', "Debugging is disabled"),
|
|
790
|
+
fixBadLocalizedLinks(numSettings ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'untrustedSettings', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[{0} workspace settings]({1}) are not applied", numSettings, 'command:settings.filterUntrusted') : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'no untrustedSettings', "Workspace settings requiring trust are not applied")),
|
|
791
|
+
fixBadLocalizedLinks(localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', { key: 'untrustedExtensions', comment: ['Please ensure the markdown link syntax is not broken up with whitespace [text block](link block)'] }, "[{0} extensions]({1}) are disabled or have limited functionality", numExtensions, `command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`))
|
|
873
792
|
];
|
|
874
793
|
this.renderLimitationsListElement(this.untrustedContainer, untrustedContainerItems, ThemeIcon.asClassNameArray(xListIcon));
|
|
875
794
|
if (this.workspaceTrustManagementService.isWorkspaceTrusted()) {
|
|
@@ -895,7 +814,7 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
895
814
|
button.label = action.label;
|
|
896
815
|
button.enabled = enabled !== undefined ? enabled : action.enabled;
|
|
897
816
|
button.description = keybinding.getLabel();
|
|
898
|
-
button.element.ariaLabel = action.label + ', ' + (
|
|
817
|
+
button.element.ariaLabel = action.label + ', ' + localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'keyboardShortcut', "Keyboard Shortcut: {0}", keybinding.getAriaLabel());
|
|
899
818
|
this.rerenderDisposables.add(button.onDidClick(e => {
|
|
900
819
|
if (e) {
|
|
901
820
|
EventHelper.stop(e, true);
|
|
@@ -905,31 +824,45 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
905
824
|
}
|
|
906
825
|
}
|
|
907
826
|
addTrustButtonToElement(parent) {
|
|
908
|
-
const trustAction = ( new Action(
|
|
909
|
-
|
|
910
|
-
|
|
827
|
+
const trustAction = ( new Action(
|
|
828
|
+
'workspace.trust.button.action.grant',
|
|
829
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustButton', "Trust"),
|
|
830
|
+
undefined,
|
|
831
|
+
true,
|
|
832
|
+
async () => {
|
|
833
|
+
await this.workspaceTrustManagementService.setWorkspaceTrust(true);
|
|
834
|
+
}
|
|
835
|
+
));
|
|
911
836
|
const trustActions = [{ action: trustAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0] }];
|
|
912
837
|
if (this.workspaceTrustManagementService.canSetParentFolderTrust()) {
|
|
913
838
|
const workspaceIdentifier = toWorkspaceIdentifier(this.workspaceService.getWorkspace());
|
|
914
839
|
const name = basename(dirname(workspaceIdentifier.uri));
|
|
915
840
|
const trustMessageElement = append(parent, $('.trust-message-box'));
|
|
916
|
-
trustMessageElement.innerText = (
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
841
|
+
trustMessageElement.innerText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustMessage', "Trust the authors of all files in the current folder or its parent '{0}'.", name);
|
|
842
|
+
const trustParentAction = ( new Action(
|
|
843
|
+
'workspace.trust.button.action.grantParent',
|
|
844
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustParentButton', "Trust Parent"),
|
|
845
|
+
undefined,
|
|
846
|
+
true,
|
|
847
|
+
async () => {
|
|
848
|
+
await this.workspaceTrustManagementService.setParentFolderTrust(true);
|
|
849
|
+
}
|
|
920
850
|
));
|
|
921
|
-
const trustParentAction = ( new Action('workspace.trust.button.action.grantParent', ( localize('trustParentButton', "Trust Parent")), undefined, true, async () => {
|
|
922
|
-
await this.workspaceTrustManagementService.setParentFolderTrust(true);
|
|
923
|
-
}));
|
|
924
851
|
trustActions.push({ action: trustParentAction, keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Shift+Enter' : 'Ctrl+Shift+Enter')[0] });
|
|
925
852
|
}
|
|
926
853
|
this.createButtonRow(parent, trustActions);
|
|
927
854
|
}
|
|
928
855
|
addDontTrustButtonToElement(parent) {
|
|
929
856
|
this.createButtonRow(parent, [{
|
|
930
|
-
action: ( new Action(
|
|
931
|
-
|
|
932
|
-
|
|
857
|
+
action: ( new Action(
|
|
858
|
+
'workspace.trust.button.action.deny',
|
|
859
|
+
localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'dontTrustButton', "Don't Trust"),
|
|
860
|
+
undefined,
|
|
861
|
+
true,
|
|
862
|
+
async () => {
|
|
863
|
+
await this.workspaceTrustManagementService.setWorkspaceTrust(false);
|
|
864
|
+
}
|
|
865
|
+
)),
|
|
933
866
|
keybinding: this.keybindingService.resolveUserBinding(isMacintosh ? 'Cmd+Enter' : 'Ctrl+Enter')[0]
|
|
934
867
|
}]);
|
|
935
868
|
}
|
|
@@ -939,19 +872,10 @@ let WorkspaceTrustEditor = class WorkspaceTrustEditor extends EditorPane {
|
|
|
939
872
|
}
|
|
940
873
|
const textElement = append(parent, $('.workspace-trust-untrusted-description'));
|
|
941
874
|
if (!this.workspaceTrustManagementService.isWorkspaceTrustForced()) {
|
|
942
|
-
textElement.innerText = this.workspaceService.getWorkbenchState() === 3 ? (
|
|
943
|
-
'untrustedWorkspaceReason',
|
|
944
|
-
"This workspace is trusted via the bolded entries in the trusted folders below."
|
|
945
|
-
)) : ( localize(
|
|
946
|
-
'untrustedFolderReason',
|
|
947
|
-
"This folder is trusted via the bolded entries in the the trusted folders below."
|
|
948
|
-
));
|
|
875
|
+
textElement.innerText = this.workspaceService.getWorkbenchState() === 3 ? localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedWorkspaceReason', "This workspace is trusted via the bolded entries in the trusted folders below.") : localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'untrustedFolderReason', "This folder is trusted via the bolded entries in the the trusted folders below.");
|
|
949
876
|
}
|
|
950
877
|
else {
|
|
951
|
-
textElement.innerText = (
|
|
952
|
-
'trustedForcedReason',
|
|
953
|
-
"This window is trusted by nature of the workspace that is opened."
|
|
954
|
-
));
|
|
878
|
+
textElement.innerText = localizeWithPath('vs/workbench/contrib/workspace/browser/workspaceTrustEditor', 'trustedForcedReason', "This window is trusted by nature of the workspace that is opened.");
|
|
955
879
|
}
|
|
956
880
|
}
|
|
957
881
|
renderLimitationsHeaderElement(parent, headerText, subtitleText) {
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
2
2
|
import { RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
3
3
|
|
|
4
4
|
const WorkspaceTrustContext = {
|
|
5
|
-
IsEnabled: ( new RawContextKey(
|
|
6
|
-
'
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
IsEnabled: ( new RawContextKey(
|
|
6
|
+
'isWorkspaceTrustEnabled',
|
|
7
|
+
false,
|
|
8
|
+
localizeWithPath('vs/workbench/contrib/workspace/common/workspace', 'workspaceTrustEnabledCtx', "Whether the workspace trust feature is enabled.")
|
|
9
|
+
)),
|
|
10
|
+
IsTrusted: ( new RawContextKey(
|
|
11
|
+
'isWorkspaceTrusted',
|
|
12
|
+
false,
|
|
13
|
+
localizeWithPath('vs/workbench/contrib/workspace/common/workspace', 'workspaceTrustedCtx', "Whether the current workspace has been trusted by the user.")
|
|
14
|
+
))
|
|
13
15
|
};
|
|
14
16
|
const MANAGE_TRUST_COMMAND_ID = 'workbench.trust.manage';
|
|
15
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
2
2
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
3
|
-
import {
|
|
3
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
4
4
|
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
5
5
|
|
|
6
6
|
class WorkspaceTrustEditorInput extends EditorInput {
|
|
@@ -22,7 +22,7 @@ class WorkspaceTrustEditorInput extends EditorInput {
|
|
|
22
22
|
return super.matches(otherInput) || otherInput instanceof WorkspaceTrustEditorInput;
|
|
23
23
|
}
|
|
24
24
|
getName() {
|
|
25
|
-
return (
|
|
25
|
+
return localizeWithPath('vs/workbench/services/workspaces/browser/workspaceTrustEditorInput', 'workspaceTrustEditorInputName', "Workspace Trust");
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|