@codingame/monaco-vscode-debug-service-override 7.1.0 → 8.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.
Files changed (39) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +21 -25
  3. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +155 -174
  4. package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +32 -9
  5. package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +16 -25
  6. package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +7 -9
  7. package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +2 -3
  8. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +25 -26
  9. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +3 -4
  10. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +5 -13
  11. package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +9 -10
  12. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +38 -73
  13. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +69 -129
  14. package/vscode/src/vs/workbench/contrib/debug/browser/debugSettingMigration.js +19 -0
  15. package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +4 -5
  16. package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +20 -25
  17. package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +6 -7
  18. package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +7 -13
  19. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +8 -9
  20. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +5 -6
  21. package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +4 -5
  22. package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +8 -14
  23. package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +7 -9
  24. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +52 -23
  25. package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibilityHelp.js +104 -0
  26. package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibleView.js +122 -0
  27. package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +7 -9
  28. package/vscode/src/vs/workbench/contrib/debug/browser/runAndDebugAccessibilityHelp.js +128 -0
  29. package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +8 -16
  30. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +25 -32
  31. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +13 -14
  32. package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +12 -17
  33. package/vscode/src/vs/workbench/contrib/debug/common/debugAccessibilityAnnouncer.js +47 -0
  34. package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +4 -5
  35. package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +6 -9
  36. package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +63 -98
  37. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +15 -25
  38. package/vscode/src/vs/workbench/contrib/debug/common/replAccessibilityAnnouncer.js +33 -0
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +3 -4
@@ -24,7 +24,7 @@ import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/service
24
24
  import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
25
25
  import { ITextResourcePropertiesService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
26
26
  import { SuggestController } from 'vscode/vscode/vs/editor/contrib/suggest/browser/suggestController';
27
- import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
27
+ import { localize, localize2 } from 'vscode/vscode/vs/nls';
28
28
  import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
29
29
  import { MenuId, registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
30
30
  import { IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions.service';
@@ -64,7 +64,7 @@ import { FocusSessionActionViewItem } from './debugActionViewItems.js';
64
64
  import { debugConsoleEvaluationPrompt, debugConsoleClearAll } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
65
65
  import { LinkDetector } from './linkDetector.js';
66
66
  import { ReplFilter } from './replFilter.js';
67
- import { ReplDelegate, ReplVariablesRenderer, ReplOutputElementRenderer, ReplEvaluationInputsRenderer, ReplGroupRenderer, ReplEvaluationResultsRenderer, ReplRawObjectsRenderer, ReplDataSource, ReplAccessibilityProvider } from './replViewer.js';
67
+ import { ReplDelegate, ReplDataSource, ReplVariablesRenderer, ReplOutputElementRenderer, ReplEvaluationInputsRenderer, ReplGroupRenderer, ReplEvaluationResultsRenderer, ReplRawObjectsRenderer, ReplAccessibilityProvider } from './replViewer.js';
68
68
  import { DEBUG_SCHEME, CONTEXT_MULTI_SESSION_REPL, State, CONTEXT_IN_DEBUG_REPL, REPL_VIEW_ID, CONTEXT_DEBUG_STATE, getStateLabel } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
69
69
  import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug.service';
70
70
  import { Variable } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugModel';
@@ -74,9 +74,10 @@ import { registerNavigableContainer } from 'vscode/vscode/vs/workbench/browser/a
74
74
  import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
75
75
  import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
76
76
  import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
77
+ import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
78
+ import { AccessibilityCommandId } from 'vscode/vscode/vs/workbench/contrib/accessibility/common/accessibilityCommands';
77
79
 
78
80
  var Repl_1, ReplOptions_1;
79
- const _moduleId = "vs/workbench/contrib/debug/browser/repl";
80
81
  const $ = $$1;
81
82
  const HISTORY_STORAGE_KEY = 'debug.repl.history';
82
83
  const FILTER_HISTORY_STORAGE_KEY = 'debug.repl.filterHistory';
@@ -96,7 +97,7 @@ let Repl = class Repl extends FilterViewPane {
96
97
  super({
97
98
  ...options,
98
99
  filterOptions: {
99
- placeholder: ( localizeWithPath(_moduleId, 0, "Filter (e.g. text, !exclude, \\escape)")),
100
+ placeholder: ( localize(6027, "Filter (e.g. text, !exclude, \\escape)")),
100
101
  text: filterText,
101
102
  history: JSON.parse(storageService.get(FILTER_HISTORY_STORAGE_KEY, StorageScope.WORKSPACE, '[]')),
102
103
  }
@@ -104,8 +105,10 @@ let Repl = class Repl extends FilterViewPane {
104
105
  this.debugService = debugService;
105
106
  this.storageService = storageService;
106
107
  this.modelService = modelService;
108
+ this.configurationService = configurationService;
107
109
  this.textResourcePropertiesService = textResourcePropertiesService;
108
110
  this.editorService = editorService;
111
+ this.keybindingService = keybindingService;
109
112
  this.languageFeaturesService = languageFeaturesService;
110
113
  this.logService = logService;
111
114
  this.previousTreeScrollHeight = 0;
@@ -441,6 +444,15 @@ let Repl = class Repl extends FilterViewPane {
441
444
  getReplInput() {
442
445
  return this.replInput;
443
446
  }
447
+ getReplDataSource() {
448
+ return this.replDataSource;
449
+ }
450
+ getFocusedElement() {
451
+ return this.tree?.getFocus()?.[0];
452
+ }
453
+ focusTree() {
454
+ this.tree?.domFocus();
455
+ }
444
456
  focus() {
445
457
  super.focus();
446
458
  setTimeout(() => this.replInput.focus(), 0);
@@ -484,7 +496,7 @@ let Repl = class Repl extends FilterViewPane {
484
496
  await autoExpandElements(session.getReplElements());
485
497
  }
486
498
  const { total, filtered } = this.getFilterStats();
487
- this.filterWidget.updateBadge(total === filtered || total === 0 ? undefined : ( localizeWithPath(_moduleId, 1, "Showing {0} of {1}", filtered, total)));
499
+ this.filterWidget.updateBadge(total === filtered || total === 0 ? undefined : ( localize(6028, "Showing {0} of {1}", filtered, total)));
488
500
  }, Repl_1.REFRESH_DELAY))
489
501
  );
490
502
  }
@@ -525,6 +537,7 @@ let Repl = class Repl extends FilterViewPane {
525
537
  const wordWrap = this.configurationService.getValue('debug').console.wordWrap;
526
538
  this.treeContainer.classList.toggle('word-wrap', wordWrap);
527
539
  const linkDetector = this.instantiationService.createInstance(LinkDetector);
540
+ this.replDataSource = ( (new ReplDataSource()));
528
541
  const tree = this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'DebugRepl', this.treeContainer, this.replDelegate, [
529
542
  this.instantiationService.createInstance(ReplVariablesRenderer, linkDetector),
530
543
  this.instantiationService.createInstance(ReplOutputElementRenderer, linkDetector),
@@ -532,9 +545,7 @@ let Repl = class Repl extends FilterViewPane {
532
545
  this.instantiationService.createInstance(ReplGroupRenderer, linkDetector),
533
546
  ( (new ReplEvaluationResultsRenderer(linkDetector, this.hoverService))),
534
547
  ( (new ReplRawObjectsRenderer(linkDetector, this.hoverService))),
535
- ],
536
- (
537
- (new ReplDataSource())), {
548
+ ], this.replDataSource, {
538
549
  filter: this.filter,
539
550
  accessibilityProvider: ( (new ReplAccessibilityProvider())),
540
551
  identityProvider,
@@ -585,7 +596,7 @@ let Repl = class Repl extends FilterViewPane {
585
596
  options.suggest = { showStatusBar: true };
586
597
  const config = this.configurationService.getValue('debug');
587
598
  options.acceptSuggestionOnEnter = config.console.acceptSuggestionOnEnter === 'on' ? 'on' : 'off';
588
- options.ariaLabel = ( localizeWithPath(_moduleId, 2, "Debug Console"));
599
+ options.ariaLabel = this.getAriaLabel();
589
600
  this.replInput = this.scopedInstantiationService.createInstance(CodeEditorWidget, this.replInputContainer, options, getSimpleCodeEditorWidgetOptions());
590
601
  this._register(this.replInput.onDidChangeModelContent(() => {
591
602
  const model = this.replInput.getModel();
@@ -603,6 +614,24 @@ let Repl = class Repl extends FilterViewPane {
603
614
  this._register(addStandardDisposableListener(this.replInputContainer, EventType.FOCUS, () => this.replInputContainer.classList.add('synthetic-focus')));
604
615
  this._register(addStandardDisposableListener(this.replInputContainer, EventType.BLUR, () => this.replInputContainer.classList.remove('synthetic-focus')));
605
616
  }
617
+ getAriaLabel() {
618
+ let ariaLabel = ( localize(6029, "Debug Console"));
619
+ if (!this.configurationService.getValue(AccessibilityVerbositySettingId.Debug)) {
620
+ return ariaLabel;
621
+ }
622
+ const keybinding = this.keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getAriaLabel();
623
+ if (keybinding) {
624
+ ariaLabel = ( localize(6030, "{0}, use ({1}) for accessibility help", ariaLabel, keybinding));
625
+ }
626
+ else {
627
+ ariaLabel = ( localize(
628
+ 6031,
629
+ "{0}, run the command Open Accessibility Help which is currently not triggerable via keybinding.",
630
+ ariaLabel
631
+ ));
632
+ }
633
+ return ariaLabel;
634
+ }
606
635
  onContextMenu(e) {
607
636
  const actions = [];
608
637
  createAndFillInContextMenuActions(this.menu, { arg: e.element, shouldForwardArgs: false }, actions);
@@ -636,7 +665,7 @@ let Repl = class Repl extends FilterViewPane {
636
665
  },
637
666
  renderOptions: {
638
667
  after: {
639
- contentText: ( localizeWithPath(_moduleId, 3, "Please start a debug session to evaluate expressions")),
668
+ contentText: ( localize(6032, "Please start a debug session to evaluate expressions")),
640
669
  color: transparentForeground ? ( (transparentForeground.toString())) : undefined
641
670
  }
642
671
  }
@@ -749,8 +778,8 @@ class AcceptReplInputAction extends EditorAction {
749
778
  constructor() {
750
779
  super({
751
780
  id: 'repl.action.acceptInput',
752
- label: ( localizeWithPath(_moduleId, 4, "REPL Accept Input")),
753
- alias: 'REPL Accept Input',
781
+ label: ( localize(6033, "Debug Console: Accept Input")),
782
+ alias: 'Debug Console: Accept Input',
754
783
  precondition: CONTEXT_IN_DEBUG_REPL,
755
784
  kbOpts: {
756
785
  kbExpr: EditorContextKeys.textInputFocus,
@@ -769,8 +798,8 @@ class FilterReplAction extends EditorAction {
769
798
  constructor() {
770
799
  super({
771
800
  id: 'repl.action.filter',
772
- label: ( localizeWithPath(_moduleId, 5, "REPL Focus Content to Filter")),
773
- alias: 'REPL Filter',
801
+ label: ( localize(6034, "Debug Console: Focus Filter")),
802
+ alias: 'Debug Console: Focus Filter',
774
803
  precondition: CONTEXT_IN_DEBUG_REPL,
775
804
  kbOpts: {
776
805
  kbExpr: EditorContextKeys.textInputFocus,
@@ -788,7 +817,7 @@ class ReplCopyAllAction extends EditorAction {
788
817
  constructor() {
789
818
  super({
790
819
  id: 'repl.action.copyAll',
791
- label: ( localizeWithPath(_moduleId, 6, "Debug: Console Copy All")),
820
+ label: ( localize(6035, "Debug: Console Copy All")),
792
821
  alias: 'Debug Console Copy All',
793
822
  precondition: CONTEXT_IN_DEBUG_REPL,
794
823
  });
@@ -824,7 +853,7 @@ registerAction2(class extends ViewAction {
824
853
  super({
825
854
  id: selectReplCommandId,
826
855
  viewId: REPL_VIEW_ID,
827
- title: ( localizeWithPath(_moduleId, 7, "Select Debug Console")),
856
+ title: ( localize(6036, "Select Debug Console")),
828
857
  f1: false,
829
858
  menu: {
830
859
  id: MenuId.ViewTitle,
@@ -856,9 +885,9 @@ registerAction2(class extends ViewAction {
856
885
  super({
857
886
  id: 'workbench.debug.panel.action.clearReplAction',
858
887
  viewId: REPL_VIEW_ID,
859
- title: ( localize2WithPath(_moduleId, 8, 'Clear Console')),
888
+ title: ( localize2(6037, 'Clear Console')),
860
889
  metadata: {
861
- description: ( localize2WithPath(_moduleId, 9, 'Clears all program output from your debug REPL'))
890
+ description: ( localize2(6038, 'Clears all program output from your debug REPL'))
862
891
  },
863
892
  f1: true,
864
893
  icon: debugConsoleClearAll,
@@ -884,7 +913,7 @@ registerAction2(class extends ViewAction {
884
913
  constructor() {
885
914
  super({
886
915
  id: 'debug.collapseRepl',
887
- title: ( localizeWithPath(_moduleId, 10, "Collapse All")),
916
+ title: ( localize(6039, "Collapse All")),
888
917
  viewId: REPL_VIEW_ID,
889
918
  menu: {
890
919
  id: MenuId.DebugConsoleContext,
@@ -902,7 +931,7 @@ registerAction2(class extends ViewAction {
902
931
  constructor() {
903
932
  super({
904
933
  id: 'debug.replPaste',
905
- title: ( localizeWithPath(_moduleId, 11, "Paste")),
934
+ title: ( localize(6040, "Paste")),
906
935
  viewId: REPL_VIEW_ID,
907
936
  precondition: ( (CONTEXT_DEBUG_STATE.notEqualsTo(getStateLabel(State.Inactive)))),
908
937
  menu: {
@@ -932,7 +961,7 @@ registerAction2(class extends ViewAction {
932
961
  constructor() {
933
962
  super({
934
963
  id: 'workbench.debug.action.copyAll',
935
- title: ( localizeWithPath(_moduleId, 12, "Copy All")),
964
+ title: ( localize(6041, "Copy All")),
936
965
  viewId: REPL_VIEW_ID,
937
966
  menu: {
938
967
  id: MenuId.DebugConsoleContext,
@@ -950,7 +979,7 @@ registerAction2(class extends Action2 {
950
979
  constructor() {
951
980
  super({
952
981
  id: 'debug.replCopy',
953
- title: ( localizeWithPath(_moduleId, 13, "Copy")),
982
+ title: ( localize(6042, "Copy")),
954
983
  menu: {
955
984
  id: MenuId.DebugConsoleContext,
956
985
  group: '2_cutcopypaste',
@@ -989,4 +1018,4 @@ registerAction2(class extends Action2 {
989
1018
  }
990
1019
  });
991
1020
 
992
- export { Repl };
1021
+ export { Repl, getReplView };
@@ -0,0 +1,104 @@
1
+ import { AccessibleViewType, AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
2
+ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
3
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
+ import { getReplView } from './repl.js';
5
+ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
6
+ import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
7
+ import { localize } from 'vscode/vscode/vs/nls';
8
+ import { AccessibilityHelpNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
9
+
10
+ class ReplAccessibilityHelp {
11
+ constructor() {
12
+ this.priority = 120;
13
+ this.name = 'replHelp';
14
+ this.when = ( (ContextKeyExpr.equals('focusedView', 'workbench.panel.repl.view')));
15
+ this.type = AccessibleViewType.Help;
16
+ }
17
+ getProvider(accessor) {
18
+ const viewsService = accessor.get(IViewsService);
19
+ const replView = getReplView(viewsService);
20
+ if (!replView) {
21
+ return undefined;
22
+ }
23
+ return (
24
+ (new ReplAccessibilityHelpProvider(replView))
25
+ );
26
+ }
27
+ }
28
+ class ReplAccessibilityHelpProvider extends Disposable {
29
+ constructor(_replView) {
30
+ super();
31
+ this._replView = _replView;
32
+ this.id = AccessibleViewProviderId.ReplHelp;
33
+ this.verbositySettingKey = AccessibilityVerbositySettingId.Debug;
34
+ this.options = { type: AccessibleViewType.Help };
35
+ this._treeHadFocus = false;
36
+ this._treeHadFocus = !!_replView.getFocusedElement();
37
+ }
38
+ onClose() {
39
+ if (this._treeHadFocus) {
40
+ return this._replView.focusTree();
41
+ }
42
+ this._replView.getReplInput().focus();
43
+ }
44
+ provideContent() {
45
+ return [
46
+ ( localize(
47
+ 6079,
48
+ "The debug console is a Read-Eval-Print-Loop that allows you to evaluate expressions and run commands and can be focused with{0}.",
49
+ '<keybinding:workbench.panel.repl.view.focus>'
50
+ )),
51
+ ( localize(
52
+ 6080,
53
+ "The debug console output can be navigated to from the input field with the Focus Previous Widget command{0}.",
54
+ '<keybinding:widgetNavigation.focusPrevious>'
55
+ )),
56
+ ( localize(
57
+ 6081,
58
+ "The debug console input can be navigated to from the output with the Focus Next Widget command{0}.",
59
+ '<keybinding:widgetNavigation.focusNext>'
60
+ )),
61
+ ( localize(
62
+ 6082,
63
+ "The debug console output history can be navigated with the up and down arrow keys."
64
+ )),
65
+ ( localize(
66
+ 6083,
67
+ "The Open Accessible View command{0} will allow character by character navigation of the console output.",
68
+ '<keybinding:editor.action.accessibleView>'
69
+ )),
70
+ ( localize(
71
+ 6084,
72
+ "The Show Run and Debug view command{0} will open the Run and Debug view.",
73
+ '<keybinding:workbench.view.debug>'
74
+ )),
75
+ AccessibilityHelpNLS.setBreakpoint,
76
+ ( localize(
77
+ 6085,
78
+ "The setting `debug.expandLazyVariables` controls whether variables are evaluated automatically. This is enabled by default when using a screen reader."
79
+ )),
80
+ ( localize(
81
+ 6086,
82
+ "The Debug: Continue command{0} will continue execution until the next breakpoint.",
83
+ '<keybinding:workbench.action.debug.continue>'
84
+ )),
85
+ ( localize(
86
+ 6087,
87
+ "The Debug: Step Into command{0} will step into the next function call.",
88
+ '<keybinding:workbench.action.debug.stepInto>'
89
+ )),
90
+ ( localize(
91
+ 6088,
92
+ "The Debug: Step Over command{0} will step over the current function call.",
93
+ '<keybinding:workbench.action.debug.stepOver>'
94
+ )),
95
+ ( localize(
96
+ 6089,
97
+ "The Debug: Step Out command{0} will step out of the current function call.",
98
+ '<keybinding:workbench.action.debug.stepOut>'
99
+ )),
100
+ ].join('\n');
101
+ }
102
+ }
103
+
104
+ export { ReplAccessibilityHelp };
@@ -0,0 +1,122 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { AccessibleViewType, AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
3
+ import { IAccessibleViewService } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView.service';
4
+ import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
5
+ import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug.service';
6
+ import { getReplView } from './repl.js';
7
+ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
8
+ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
9
+ import { Emitter } from 'vscode/vscode/vs/base/common/event';
10
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
11
+ import { Position } from 'vscode/vscode/vs/editor/common/core/position';
12
+
13
+ class ReplAccessibleView {
14
+ constructor() {
15
+ this.priority = 70;
16
+ this.name = 'debugConsole';
17
+ this.when = ( ContextKeyExpr.equals('focusedView', 'workbench.panel.repl.view'));
18
+ this.type = AccessibleViewType.View;
19
+ }
20
+ getProvider(accessor) {
21
+ const viewsService = accessor.get(IViewsService);
22
+ const debugService = accessor.get(IDebugService);
23
+ const accessibleViewService = accessor.get(IAccessibleViewService);
24
+ const replView = getReplView(viewsService);
25
+ if (!replView) {
26
+ return undefined;
27
+ }
28
+ const focusedElement = replView.getFocusedElement();
29
+ return ( new ReplOutputAccessibleViewProvider(replView, focusedElement, debugService, accessibleViewService));
30
+ }
31
+ }
32
+ let ReplOutputAccessibleViewProvider = class ReplOutputAccessibleViewProvider extends Disposable {
33
+ constructor(_replView, _focusedElement, _debugService, _accessibleViewService) {
34
+ super();
35
+ this._replView = _replView;
36
+ this._focusedElement = _focusedElement;
37
+ this._debugService = _debugService;
38
+ this._accessibleViewService = _accessibleViewService;
39
+ this.id = AccessibleViewProviderId.Repl;
40
+ this._onDidChangeContent = this._register(( new Emitter()));
41
+ this.onDidChangeContent = this._onDidChangeContent.event;
42
+ this._onDidResolveChildren = this._register(( new Emitter()));
43
+ this.onDidResolveChildren = this._onDidResolveChildren.event;
44
+ this.verbositySettingKey = AccessibilityVerbositySettingId.Debug;
45
+ this.options = {
46
+ type: AccessibleViewType.View
47
+ };
48
+ this._elementPositionMap = ( new Map());
49
+ this._treeHadFocus = false;
50
+ this._treeHadFocus = !!_focusedElement;
51
+ }
52
+ provideContent() {
53
+ const viewModel = this._debugService.getViewModel();
54
+ const focusedDebugSession = viewModel?.focusedSession;
55
+ if (!focusedDebugSession) {
56
+ return 'No debug session is active.';
57
+ }
58
+ const elements = focusedDebugSession.getReplElements();
59
+ if (!elements.length) {
60
+ return 'No output in the debug console.';
61
+ }
62
+ if (!this._content) {
63
+ this._updateContent(elements);
64
+ }
65
+ return this._content ?? ( elements.map(e => ( e.toString(true)))).join('\n');
66
+ }
67
+ onClose() {
68
+ this._content = undefined;
69
+ this._elementPositionMap.clear();
70
+ if (this._treeHadFocus) {
71
+ return this._replView.focusTree();
72
+ }
73
+ this._replView.getReplInput().focus();
74
+ }
75
+ onOpen() {
76
+ this._register(this.onDidResolveChildren(() => {
77
+ this._onDidChangeContent.fire();
78
+ queueMicrotask(() => {
79
+ if (this._focusedElement) {
80
+ const position = this._elementPositionMap.get(this._focusedElement.getId());
81
+ if (position) {
82
+ this._accessibleViewService.setPosition(position, true);
83
+ }
84
+ }
85
+ });
86
+ }));
87
+ }
88
+ async _updateContent(elements) {
89
+ const dataSource = this._replView.getReplDataSource();
90
+ if (!dataSource) {
91
+ return;
92
+ }
93
+ let line = 1;
94
+ const content = [];
95
+ for (const e of elements) {
96
+ content.push(( e.toString()).replace(/\n/g, ''));
97
+ this._elementPositionMap.set(e.getId(), ( new Position(line, 1)));
98
+ line++;
99
+ if (dataSource.hasChildren(e)) {
100
+ const childContent = [];
101
+ const children = await dataSource.getChildren(e);
102
+ for (const child of children) {
103
+ const id = child.getId();
104
+ if (!( this._elementPositionMap.has(id))) {
105
+ this._elementPositionMap.set(id, ( new Position(line, 1)));
106
+ }
107
+ childContent.push(' ' + ( child.toString()));
108
+ line++;
109
+ }
110
+ content.push(childContent.join('\n'));
111
+ }
112
+ }
113
+ this._content = content.join('\n');
114
+ this._onDidResolveChildren.fire();
115
+ }
116
+ };
117
+ ReplOutputAccessibleViewProvider = ( __decorate([
118
+ ( __param(2, IDebugService)),
119
+ ( __param(3, IAccessibleViewService))
120
+ ], ReplOutputAccessibleViewProvider));
121
+
122
+ export { ReplAccessibleView };
@@ -9,7 +9,7 @@ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
9
  import { basename } from 'vscode/vscode/vs/base/common/path';
10
10
  import Severity$1 from 'vscode/vscode/vs/base/common/severity';
11
11
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
12
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
12
+ import { localize } from 'vscode/vscode/vs/nls';
13
13
  import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
14
14
  import { IContextViewService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
15
15
  import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
@@ -26,7 +26,6 @@ import { ReplVariableElement, ReplEvaluationResult, ReplOutputElement, ReplEvalu
26
26
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
27
27
 
28
28
  var ReplGroupRenderer_1, ReplOutputElementRenderer_1, ReplVariablesRenderer_1;
29
- const _moduleId = "vs/workbench/contrib/debug/browser/replViewer";
30
29
  const $ = $$1;
31
30
  class ReplEvaluationInputsRenderer {
32
31
  static { this.ID = 'replEvaluationInput'; }
@@ -301,26 +300,25 @@ class ReplDataSource {
301
300
  }
302
301
  class ReplAccessibilityProvider {
303
302
  getWidgetAriaLabel() {
304
- return ( localizeWithPath(_moduleId, 0, "Debug Console"));
303
+ return ( localize(10247, "Debug Console"));
305
304
  }
306
305
  getAriaLabel(element) {
307
306
  if (element instanceof Variable) {
308
- return ( localizeWithPath(_moduleId, 1, "Variable {0}, value {1}", element.name, element.value));
307
+ return ( localize(10248, "Variable {0}, value {1}", element.name, element.value));
309
308
  }
310
309
  if (element instanceof ReplOutputElement || element instanceof ReplEvaluationInput || element instanceof ReplEvaluationResult) {
311
- return element.value + (element instanceof ReplOutputElement && element.count > 1 ? ( localizeWithPath(_moduleId, 2, ", occurred {0} times", element.count)) : '');
310
+ return element.value + (element instanceof ReplOutputElement && element.count > 1 ? ( localize(10249, ", occurred {0} times", element.count)) : '');
312
311
  }
313
312
  if (element instanceof RawObjectReplElement) {
314
- return ( localizeWithPath(
315
- _moduleId,
316
- 3,
313
+ return ( localize(
314
+ 10250,
317
315
  "Debug console variable {0}, value {1}",
318
316
  element.name,
319
317
  element.value
320
318
  ));
321
319
  }
322
320
  if (element instanceof ReplGroup) {
323
- return ( localizeWithPath(_moduleId, 4, "Debug console group {0}", element.name));
321
+ return ( localize(10251, "Debug console group {0}", element.name));
324
322
  }
325
323
  return '';
326
324
  }
@@ -0,0 +1,128 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { AccessibleViewType, AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
3
+ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
4
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
+ import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
6
+ import { localize } from 'vscode/vscode/vs/nls';
7
+ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
8
+ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
9
+ import { AccessibilityHelpNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
10
+
11
+ class RunAndDebugAccessibilityHelp {
12
+ constructor() {
13
+ this.priority = 120;
14
+ this.name = 'runAndDebugHelp';
15
+ this.when = ( (ContextKeyExpr.equals('activeViewlet', 'workbench.view.debug')));
16
+ this.type = AccessibleViewType.Help;
17
+ }
18
+ getProvider(accessor) {
19
+ return (
20
+ (new RunAndDebugAccessibilityHelpProvider(accessor.get(ICommandService), accessor.get(IViewsService)))
21
+ );
22
+ }
23
+ }
24
+ let RunAndDebugAccessibilityHelpProvider = class RunAndDebugAccessibilityHelpProvider extends Disposable {
25
+ constructor(_commandService, _viewsService) {
26
+ super();
27
+ this._commandService = _commandService;
28
+ this._viewsService = _viewsService;
29
+ this.id = AccessibleViewProviderId.RunAndDebug;
30
+ this.verbositySettingKey = AccessibilityVerbositySettingId.Debug;
31
+ this.options = { type: AccessibleViewType.Help };
32
+ this._focusedView = this._viewsService.getFocusedViewName();
33
+ }
34
+ onClose() {
35
+ switch (this._focusedView) {
36
+ case 'Watch':
37
+ this._commandService.executeCommand('workbench.debug.action.focusWatchView');
38
+ break;
39
+ case 'Variables':
40
+ this._commandService.executeCommand('workbench.debug.action.focusVariablesView');
41
+ break;
42
+ case 'Call Stack':
43
+ this._commandService.executeCommand('workbench.debug.action.focusCallStackView');
44
+ break;
45
+ case 'Breakpoints':
46
+ this._commandService.executeCommand('workbench.debug.action.focusBreakpointsView');
47
+ break;
48
+ default:
49
+ this._commandService.executeCommand('workbench.view.debug');
50
+ }
51
+ }
52
+ provideContent() {
53
+ return [
54
+ ( localize(
55
+ 6090,
56
+ "The Show Run and Debug view command{0} will open the current view.",
57
+ '<keybinding:workbench.view.debug>'
58
+ )),
59
+ ( localize(
60
+ 6091,
61
+ "The Debug: Start Debugging command{0} will start a debug session.",
62
+ '<keybinding:workbench.action.debug.start>'
63
+ )),
64
+ AccessibilityHelpNLS.setBreakpoint,
65
+ ( localize(6092, "Once debugging, the following commands will be available:")),
66
+ ( localize(
67
+ 6093,
68
+ "- Debug: Continue command{0} will continue execution until the next breakpoint.",
69
+ '<keybinding:workbench.action.debug.continue>'
70
+ )),
71
+ ( localize(
72
+ 6094,
73
+ "- Debug: Step Into command{0} will step into the next function call.",
74
+ '<keybinding:workbench.action.debug.stepInto>'
75
+ )),
76
+ ( localize(
77
+ 6095,
78
+ "- Debug: Step Over command{0} will step over the current function call.",
79
+ '<keybinding:workbench.action.debug.stepOver>'
80
+ )),
81
+ ( localize(
82
+ 6096,
83
+ "- Debug: Step Out command{0} will step out of the current function call.",
84
+ '<keybinding:workbench.action.debug.stepOut>'
85
+ )),
86
+ ( localize(
87
+ 6097,
88
+ 'The debug viewlet is comprised of several views that can be focused with the following commands or navigated to via tab then arrow keys:'
89
+ )),
90
+ ( localize(
91
+ 6098,
92
+ "- Debug: Focus Breakpoints View command{0} will focus the breakpoints view.",
93
+ '<keybinding:workbench.debug.action.focusBreakpointsView>'
94
+ )),
95
+ ( localize(
96
+ 6099,
97
+ "- Debug: Focus Call Stack View command{0} will focus the call stack view.",
98
+ '<keybinding:workbench.debug.action.focusCallStackView>'
99
+ )),
100
+ ( localize(
101
+ 6100,
102
+ "- Debug: Focus Variables View command{0} will focus the variables view.",
103
+ '<keybinding:workbench.debug.action.focusVariablesView>'
104
+ )),
105
+ ( localize(
106
+ 6101,
107
+ "- Debug: Focus Watch View command{0} will focus the watch view.",
108
+ '<keybinding:workbench.debug.action.focusWatchView>'
109
+ )),
110
+ ( localize(
111
+ 6102,
112
+ "The debug console is a Read-Eval-Print-Loop that allows you to evaluate expressions and run commands and can be focused with{0}.",
113
+ '<keybinding:workbench.panel.repl.view.focus>'
114
+ )),
115
+ ( localize(
116
+ 6103,
117
+ "The setting {0} controls whether watch variable changes are announced.",
118
+ 'accessibility.debugWatchVariableAnnouncements'
119
+ )),
120
+ ].join('\n');
121
+ }
122
+ };
123
+ RunAndDebugAccessibilityHelpProvider = ( (__decorate([
124
+ ( (__param(0, ICommandService))),
125
+ ( (__param(1, IViewsService)))
126
+ ], RunAndDebugAccessibilityHelpProvider)));
127
+
128
+ export { RunAndDebugAccessibilityHelp };