@codingame/monaco-vscode-workspace-trust-service-override 4.5.2 → 5.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workspace-trust-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@5.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -9,7 +9,6 @@ import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs
|
|
|
9
9
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
10
|
import 'vscode/vscode/vs/platform/notification/common/notification';
|
|
11
11
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
12
|
-
import { workspaceTrustToString } from '../../../../platform/workspace/common/workspaceTrust.js';
|
|
13
12
|
import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
14
13
|
import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
15
14
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
@@ -515,22 +514,20 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
515
514
|
}
|
|
516
515
|
return result;
|
|
517
516
|
}
|
|
518
|
-
|
|
519
|
-
const text = workspaceTrustToString(trusted);
|
|
517
|
+
getRestrictedModeStatusbarEntry() {
|
|
520
518
|
let ariaLabel = '';
|
|
521
519
|
let toolTip;
|
|
522
520
|
switch (this.workspaceContextService.getWorkbenchState()) {
|
|
523
521
|
case 1 : {
|
|
524
|
-
ariaLabel =
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
toolTip = trusted ? ariaLabel : {
|
|
522
|
+
ariaLabel = ( localizeWithPath(
|
|
523
|
+
_moduleId,
|
|
524
|
+
37,
|
|
525
|
+
"Restricted Mode: Some features are disabled because this window is not trusted."
|
|
526
|
+
));
|
|
527
|
+
toolTip = {
|
|
531
528
|
value: ( localizeWithPath(
|
|
532
529
|
_moduleId,
|
|
533
|
-
|
|
530
|
+
38,
|
|
534
531
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [window is not trusted]({1}).",
|
|
535
532
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
536
533
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -541,16 +538,15 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
541
538
|
break;
|
|
542
539
|
}
|
|
543
540
|
case 2 : {
|
|
544
|
-
ariaLabel =
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
toolTip = trusted ? ariaLabel : {
|
|
541
|
+
ariaLabel = ( localizeWithPath(
|
|
542
|
+
_moduleId,
|
|
543
|
+
39,
|
|
544
|
+
"Restricted Mode: Some features are disabled because this folder is not trusted."
|
|
545
|
+
));
|
|
546
|
+
toolTip = {
|
|
551
547
|
value: ( localizeWithPath(
|
|
552
548
|
_moduleId,
|
|
553
|
-
|
|
549
|
+
40,
|
|
554
550
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [folder is not trusted]({1}).",
|
|
555
551
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
556
552
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -561,16 +557,15 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
561
557
|
break;
|
|
562
558
|
}
|
|
563
559
|
case 3 : {
|
|
564
|
-
ariaLabel =
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
toolTip = trusted ? ariaLabel : {
|
|
560
|
+
ariaLabel = ( localizeWithPath(
|
|
561
|
+
_moduleId,
|
|
562
|
+
41,
|
|
563
|
+
"Restricted Mode: Some features are disabled because this workspace is not trusted."
|
|
564
|
+
));
|
|
565
|
+
toolTip = {
|
|
571
566
|
value: ( localizeWithPath(
|
|
572
567
|
_moduleId,
|
|
573
|
-
|
|
568
|
+
42,
|
|
574
569
|
"Running in Restricted Mode\n\nSome [features are disabled]({0}) because this [workspace is not trusted]({1}).",
|
|
575
570
|
`command:${LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID}`,
|
|
576
571
|
`command:${MANAGE_TRUST_COMMAND_ID}`
|
|
@@ -582,8 +577,8 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
582
577
|
}
|
|
583
578
|
}
|
|
584
579
|
return {
|
|
585
|
-
name: ( localizeWithPath(_moduleId,
|
|
586
|
-
text:
|
|
580
|
+
name: ( localizeWithPath(_moduleId, 43, "Workspace Trust")),
|
|
581
|
+
text: `$(shield) ${( localizeWithPath(_moduleId, 44, "Restricted Mode"))}`,
|
|
587
582
|
ariaLabel: ariaLabel,
|
|
588
583
|
tooltip: toolTip,
|
|
589
584
|
command: MANAGE_TRUST_COMMAND_ID,
|
|
@@ -596,7 +591,7 @@ let WorkspaceTrustUXHandler = class WorkspaceTrustUXHandler extends Disposable {
|
|
|
596
591
|
return;
|
|
597
592
|
}
|
|
598
593
|
if (!trusted && !this.statusbarEntryAccessor.value) {
|
|
599
|
-
const entry = this.
|
|
594
|
+
const entry = this.getRestrictedModeStatusbarEntry();
|
|
600
595
|
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, 0 , 0.99 * Number.MAX_VALUE );
|
|
601
596
|
}
|
|
602
597
|
}
|
|
@@ -633,16 +628,16 @@ class WorkspaceTrustEditorInputSerializer {
|
|
|
633
628
|
}
|
|
634
629
|
( (Registry.as(EditorExtensions.EditorFactory)))
|
|
635
630
|
.registerEditorSerializer(WorkspaceTrustEditorInput.ID, WorkspaceTrustEditorInputSerializer);
|
|
636
|
-
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localizeWithPath(_moduleId,
|
|
631
|
+
( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(WorkspaceTrustEditor, WorkspaceTrustEditor.ID, ( localizeWithPath(_moduleId, 45, "Workspace Trust Editor"))), [
|
|
637
632
|
( (new SyncDescriptor(WorkspaceTrustEditorInput)))
|
|
638
633
|
]);
|
|
639
634
|
const CONFIGURE_TRUST_COMMAND_ID = 'workbench.trust.configure';
|
|
640
|
-
const WORKSPACES_CATEGORY = ( localize2WithPath(_moduleId,
|
|
635
|
+
const WORKSPACES_CATEGORY = ( localize2WithPath(_moduleId, 46, 'Workspaces'));
|
|
641
636
|
registerAction2(class extends Action2 {
|
|
642
637
|
constructor() {
|
|
643
638
|
super({
|
|
644
639
|
id: CONFIGURE_TRUST_COMMAND_ID,
|
|
645
|
-
title: ( localize2WithPath(_moduleId,
|
|
640
|
+
title: ( localize2WithPath(_moduleId, 47, "Configure Workspace Trust Settings")),
|
|
646
641
|
precondition: ( (ContextKeyExpr.and(
|
|
647
642
|
WorkspaceTrustContext.IsEnabled,
|
|
648
643
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -659,7 +654,7 @@ registerAction2(class extends Action2 {
|
|
|
659
654
|
constructor() {
|
|
660
655
|
super({
|
|
661
656
|
id: MANAGE_TRUST_COMMAND_ID,
|
|
662
|
-
title: ( localize2WithPath(_moduleId,
|
|
657
|
+
title: ( localize2WithPath(_moduleId, 48, "Manage Workspace Trust")),
|
|
663
658
|
precondition: ( (ContextKeyExpr.and(
|
|
664
659
|
WorkspaceTrustContext.IsEnabled,
|
|
665
660
|
(ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true))
|
|
@@ -685,7 +680,7 @@ registerAction2(class extends Action2 {
|
|
|
685
680
|
default: true,
|
|
686
681
|
description: ( localizeWithPath(
|
|
687
682
|
_moduleId,
|
|
688
|
-
|
|
683
|
+
49,
|
|
689
684
|
"Controls whether or not Workspace Trust is enabled within VS Code."
|
|
690
685
|
)),
|
|
691
686
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -696,7 +691,7 @@ registerAction2(class extends Action2 {
|
|
|
696
691
|
default: 'once',
|
|
697
692
|
description: ( localizeWithPath(
|
|
698
693
|
_moduleId,
|
|
699
|
-
|
|
694
|
+
50,
|
|
700
695
|
"Controls when the startup prompt to trust a workspace is shown."
|
|
701
696
|
)),
|
|
702
697
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
@@ -705,17 +700,17 @@ registerAction2(class extends Action2 {
|
|
|
705
700
|
enumDescriptions: [
|
|
706
701
|
( localizeWithPath(
|
|
707
702
|
_moduleId,
|
|
708
|
-
|
|
703
|
+
51,
|
|
709
704
|
"Ask for trust every time an untrusted workspace is opened."
|
|
710
705
|
)),
|
|
711
706
|
( localizeWithPath(
|
|
712
707
|
_moduleId,
|
|
713
|
-
|
|
708
|
+
52,
|
|
714
709
|
"Ask for trust the first time an untrusted workspace is opened."
|
|
715
710
|
)),
|
|
716
711
|
( localizeWithPath(
|
|
717
712
|
_moduleId,
|
|
718
|
-
|
|
713
|
+
53,
|
|
719
714
|
"Do not ask for trust when an untrusted workspace is opened."
|
|
720
715
|
)),
|
|
721
716
|
]
|
|
@@ -723,24 +718,24 @@ registerAction2(class extends Action2 {
|
|
|
723
718
|
[WORKSPACE_TRUST_BANNER]: {
|
|
724
719
|
type: 'string',
|
|
725
720
|
default: 'untilDismissed',
|
|
726
|
-
description: ( localizeWithPath(_moduleId,
|
|
721
|
+
description: ( localizeWithPath(_moduleId, 54, "Controls when the restricted mode banner is shown.")),
|
|
727
722
|
tags: [WORKSPACE_TRUST_SETTING_TAG],
|
|
728
723
|
scope: 1 ,
|
|
729
724
|
enum: ['always', 'untilDismissed', 'never'],
|
|
730
725
|
enumDescriptions: [
|
|
731
726
|
( localizeWithPath(
|
|
732
727
|
_moduleId,
|
|
733
|
-
|
|
728
|
+
55,
|
|
734
729
|
"Show the banner every time an untrusted workspace is open."
|
|
735
730
|
)),
|
|
736
731
|
( localizeWithPath(
|
|
737
732
|
_moduleId,
|
|
738
|
-
|
|
733
|
+
56,
|
|
739
734
|
"Show the banner when an untrusted workspace is opened until dismissed."
|
|
740
735
|
)),
|
|
741
736
|
( localizeWithPath(
|
|
742
737
|
_moduleId,
|
|
743
|
-
|
|
738
|
+
57,
|
|
744
739
|
"Do not show the banner when an untrusted workspace is open."
|
|
745
740
|
)),
|
|
746
741
|
]
|
|
@@ -750,7 +745,7 @@ registerAction2(class extends Action2 {
|
|
|
750
745
|
default: 'prompt',
|
|
751
746
|
markdownDescription: ( localizeWithPath(
|
|
752
747
|
_moduleId,
|
|
753
|
-
|
|
748
|
+
58,
|
|
754
749
|
"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}#`.",
|
|
755
750
|
WORKSPACE_TRUST_EMPTY_WINDOW
|
|
756
751
|
)),
|
|
@@ -760,17 +755,17 @@ registerAction2(class extends Action2 {
|
|
|
760
755
|
enumDescriptions: [
|
|
761
756
|
( localizeWithPath(
|
|
762
757
|
_moduleId,
|
|
763
|
-
|
|
758
|
+
59,
|
|
764
759
|
"Ask how to handle untrusted files for each workspace. Once untrusted files are introduced to a trusted workspace, you will not be prompted again."
|
|
765
760
|
)),
|
|
766
761
|
( localizeWithPath(
|
|
767
762
|
_moduleId,
|
|
768
|
-
|
|
763
|
+
60,
|
|
769
764
|
"Always allow untrusted files to be introduced to a trusted workspace without prompting."
|
|
770
765
|
)),
|
|
771
766
|
( localizeWithPath(
|
|
772
767
|
_moduleId,
|
|
773
|
-
|
|
768
|
+
61,
|
|
774
769
|
"Always open untrusted files in a separate window in restricted mode without prompting."
|
|
775
770
|
)),
|
|
776
771
|
]
|
|
@@ -780,7 +775,7 @@ registerAction2(class extends Action2 {
|
|
|
780
775
|
default: true,
|
|
781
776
|
markdownDescription: ( localizeWithPath(
|
|
782
777
|
_moduleId,
|
|
783
|
-
|
|
778
|
+
62,
|
|
784
779
|
"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.",
|
|
785
780
|
WORKSPACE_TRUST_UNTRUSTED_FILES
|
|
786
781
|
)),
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
-
|
|
3
|
-
const _moduleId = "vs/platform/workspace/common/workspaceTrust";
|
|
4
|
-
function workspaceTrustToString(trustState) {
|
|
5
|
-
if (trustState) {
|
|
6
|
-
return ( localizeWithPath(_moduleId, 0, "Trusted"));
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
return ( localizeWithPath(_moduleId, 1, "Restricted Mode"));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { workspaceTrustToString };
|