@codingame/monaco-vscode-accessibility-service-override 24.2.0 → 25.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 +2 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.js +6 -6
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +26 -26
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/commands.js +9 -9
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +42 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-accessibility-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - accessibility service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "25.0.0",
|
|
19
19
|
"marked": "14.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
@@ -40,22 +40,22 @@ let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
|
40
40
|
}
|
|
41
41
|
showScreenReaderNotification() {
|
|
42
42
|
this.screenReaderNotification = this.notificationService.prompt(Severity.Info, ( localize(
|
|
43
|
-
|
|
43
|
+
4376,
|
|
44
44
|
"Screen reader usage detected. Do you want to enable {0} to optimize the editor for screen reader usage?",
|
|
45
45
|
'editor.accessibilitySupport'
|
|
46
46
|
)), [{
|
|
47
|
-
label: ( localize(
|
|
47
|
+
label: ( localize(4377, "Yes")),
|
|
48
48
|
run: () => {
|
|
49
49
|
this.configurationService.updateValue('editor.accessibilitySupport', 'on', ConfigurationTarget.USER);
|
|
50
50
|
}
|
|
51
51
|
}, {
|
|
52
|
-
label: ( localize(
|
|
52
|
+
label: ( localize(4378, "No")),
|
|
53
53
|
run: () => {
|
|
54
54
|
this.configurationService.updateValue('editor.accessibilitySupport', 'off', ConfigurationTarget.USER);
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
label: ( localize(
|
|
58
|
+
label: ( localize(4379, "Learn More")),
|
|
59
59
|
run: () => {
|
|
60
60
|
this.openerService.open('https://code.visualstudio.com/docs/editor/accessibility#_screen-readers');
|
|
61
61
|
}
|
|
@@ -68,9 +68,9 @@ let AccessibilityStatus = class AccessibilityStatus extends Disposable {
|
|
|
68
68
|
updateScreenReaderModeElement(visible) {
|
|
69
69
|
if (visible) {
|
|
70
70
|
if (!this.screenReaderModeElement.value) {
|
|
71
|
-
const text = ( localize(
|
|
71
|
+
const text = ( localize(4380, "Screen Reader Optimized"));
|
|
72
72
|
this.screenReaderModeElement.value = this.statusbarService.addEntry({
|
|
73
|
-
name: ( localize(
|
|
73
|
+
name: ( localize(4381, "Screen Reader Mode")),
|
|
74
74
|
text,
|
|
75
75
|
ariaLabel: text,
|
|
76
76
|
command: 'showEditorScreenReaderNotification',
|
|
@@ -22,7 +22,7 @@ import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
22
22
|
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
23
23
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
24
24
|
import { IChatCodeBlockContextProviderService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
25
|
-
import { ICodeBlockActionContext } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/codeBlockPart";
|
|
25
|
+
import { ICodeBlockActionContext } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart";
|
|
26
26
|
import { AccessibilityVerbositySettingId } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration";
|
|
27
27
|
export type AccesibleViewContentProvider = AccessibleContentProvider | ExtensionContentProvider;
|
|
28
28
|
export declare class AccessibleView extends Disposable implements ITextModelContentProvider {
|
|
@@ -384,8 +384,8 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
384
384
|
const disposables = this._register(( new DisposableStore()));
|
|
385
385
|
const quickPick = disposables.add(this._quickInputService.createQuickPick());
|
|
386
386
|
quickPick.items = items;
|
|
387
|
-
quickPick.title = ( localize(
|
|
388
|
-
quickPick.placeholder = ( localize(
|
|
387
|
+
quickPick.title = ( localize(4382, 'Configure keybindings'));
|
|
388
|
+
quickPick.placeholder = ( localize(4383, 'Select a command ID to configure a keybinding for it'));
|
|
389
389
|
quickPick.show();
|
|
390
390
|
disposables.add(quickPick.onDidAccept(async () => {
|
|
391
391
|
const item = quickPick.selectedItems[0];
|
|
@@ -425,7 +425,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
if (label) {
|
|
428
|
-
symbols.push({ markdownToParse: label, label: ( localize(
|
|
428
|
+
symbols.push({ markdownToParse: label, label: ( localize(4384, "({0}) {1}", token.type, label)), ariaLabel: ( localize(4385, "({0}) {1}", token.type, label)), firstListItem });
|
|
429
429
|
firstListItem = undefined;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
@@ -458,7 +458,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
458
458
|
}
|
|
459
459
|
this._configurationService.updateValue(this._currentProvider?.verbositySettingKey, false);
|
|
460
460
|
alert(( localize(
|
|
461
|
-
|
|
461
|
+
4386,
|
|
462
462
|
'{0} accessibility verbosity is now disabled',
|
|
463
463
|
this._currentProvider.verbositySettingKey
|
|
464
464
|
)));
|
|
@@ -537,17 +537,17 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
537
537
|
const hasActions = this._accessibleViewSupportsNavigation.get() || this._accessibleViewVerbosityEnabled.get() || this._accessibleViewGoToSymbolSupported.get() || provider.actions?.length;
|
|
538
538
|
if (verbose && !showAccessibleViewHelp && hasActions) {
|
|
539
539
|
actionsHint = provider.options.position ? ( localize(
|
|
540
|
-
|
|
540
|
+
4387,
|
|
541
541
|
'Explore actions such as disabling this hint (Shift+Tab), use Escape to exit this dialog.'
|
|
542
|
-
)) : ( localize(
|
|
542
|
+
)) : ( localize(4388, 'Explore actions such as disabling this hint (Shift+Tab).'));
|
|
543
543
|
}
|
|
544
|
-
let ariaLabel = provider.options.type === AccessibleViewType.Help ? ( localize(
|
|
544
|
+
let ariaLabel = provider.options.type === AccessibleViewType.Help ? ( localize(4389, "Accessibility Help")) : ( localize(4390, "Accessible View"));
|
|
545
545
|
this._title.textContent = ariaLabel;
|
|
546
546
|
if (actionsHint && provider.options.type === AccessibleViewType.View) {
|
|
547
|
-
ariaLabel = ( localize(
|
|
547
|
+
ariaLabel = ( localize(4391, "Accessible View, {0}", actionsHint));
|
|
548
548
|
}
|
|
549
549
|
else if (actionsHint) {
|
|
550
|
-
ariaLabel = ( localize(
|
|
550
|
+
ariaLabel = ( localize(4392, "Accessibility Help, {0}", actionsHint));
|
|
551
551
|
}
|
|
552
552
|
if (isWindows && widgetIsFocused) {
|
|
553
553
|
ariaLabel = '';
|
|
@@ -624,7 +624,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
624
624
|
return disposableStore;
|
|
625
625
|
}
|
|
626
626
|
_updateToolbar(providedActions, type) {
|
|
627
|
-
this._toolbar.setAriaLabel(type === AccessibleViewType.Help ? ( localize(
|
|
627
|
+
this._toolbar.setAriaLabel(type === AccessibleViewType.Help ? ( localize(4393, 'Accessibility Help')) : ( localize(4394, "Accessible View")));
|
|
628
628
|
const toolbarMenu = this._register(this._menuService.createMenu(MenuId.AccessibleView, this._contextKeyService));
|
|
629
629
|
const menuActions = getFlatActionBarActions(toolbarMenu.getActions({}));
|
|
630
630
|
if (providedActions) {
|
|
@@ -726,9 +726,9 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
726
726
|
_accessibleViewHelpDialogContent(providerHasSymbols) {
|
|
727
727
|
const navigationHint = this._navigationHint();
|
|
728
728
|
const goToSymbolHint = this._goToSymbolHint(providerHasSymbols);
|
|
729
|
-
const toolbarHint = ( localize(
|
|
729
|
+
const toolbarHint = ( localize(4395, "Navigate to the toolbar (Shift+Tab)."));
|
|
730
730
|
const chatHints = this._getChatHints();
|
|
731
|
-
let hint = ( localize(
|
|
731
|
+
let hint = ( localize(4396, "In the accessible view, you can:\n"));
|
|
732
732
|
if (navigationHint) {
|
|
733
733
|
hint += ' - ' + navigationHint + '\n';
|
|
734
734
|
}
|
|
@@ -748,24 +748,24 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
748
748
|
return;
|
|
749
749
|
}
|
|
750
750
|
return [( localize(
|
|
751
|
-
|
|
751
|
+
4397,
|
|
752
752
|
" - Insert the code block at the cursor{0}.",
|
|
753
753
|
'<keybinding:workbench.action.chat.insertCodeBlock>'
|
|
754
754
|
)),
|
|
755
755
|
( localize(
|
|
756
|
-
|
|
756
|
+
4398,
|
|
757
757
|
" - Insert the code block into a new file{0}.",
|
|
758
758
|
'<keybinding:workbench.action.chat.insertIntoNewFile>'
|
|
759
759
|
)),
|
|
760
760
|
( localize(
|
|
761
|
-
|
|
761
|
+
4399,
|
|
762
762
|
" - Run the code block in the terminal{0}.\n",
|
|
763
763
|
'<keybinding:workbench.action.chat.runInTerminal>'
|
|
764
764
|
))].join('\n');
|
|
765
765
|
}
|
|
766
766
|
_navigationHint() {
|
|
767
767
|
return localize(
|
|
768
|
-
|
|
768
|
+
4400,
|
|
769
769
|
"Show the next item{0} or previous item{1}.",
|
|
770
770
|
`<keybinding:${AccessibilityCommandId.ShowNext}`,
|
|
771
771
|
`<keybinding:${AccessibilityCommandId.ShowPrevious}>`
|
|
@@ -774,7 +774,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
774
774
|
_disableVerbosityHint(provider) {
|
|
775
775
|
if (provider.options.type === AccessibleViewType.Help && this._verbosityEnabled()) {
|
|
776
776
|
return localize(
|
|
777
|
-
|
|
777
|
+
4401,
|
|
778
778
|
"\nDisable accessibility verbosity for this feature{0}.",
|
|
779
779
|
`<keybinding:${AccessibilityCommandId.DisableVerbosityHint}>`
|
|
780
780
|
);
|
|
@@ -786,7 +786,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
786
786
|
return;
|
|
787
787
|
}
|
|
788
788
|
return localize(
|
|
789
|
-
|
|
789
|
+
4402,
|
|
790
790
|
'Go to a symbol{0}.',
|
|
791
791
|
`<keybinding:${AccessibilityCommandId.GoToSymbol}>`
|
|
792
792
|
);
|
|
@@ -795,7 +795,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
795
795
|
const configureKb = this._keybindingService.lookupKeybinding(AccessibilityCommandId.AccessibilityHelpConfigureKeybindings)?.getAriaLabel();
|
|
796
796
|
const keybindingToConfigureQuickPick = configureKb ? '(' + configureKb + ')' : 'by assigning a keybinding to the command Accessibility Help Configure Unassigned Keybindings.';
|
|
797
797
|
return localize(
|
|
798
|
-
|
|
798
|
+
4403,
|
|
799
799
|
'\nConfigure keybindings for commands that lack them {0}.',
|
|
800
800
|
keybindingToConfigureQuickPick
|
|
801
801
|
);
|
|
@@ -804,7 +804,7 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
804
804
|
const configureKb = this._keybindingService.lookupKeybinding(AccessibilityCommandId.AccessibilityHelpConfigureAssignedKeybindings)?.getAriaLabel();
|
|
805
805
|
const keybindingToConfigureQuickPick = configureKb ? '(' + configureKb + ')' : 'by assigning a keybinding to the command Accessibility Help Configure Assigned Keybindings.';
|
|
806
806
|
return localize(
|
|
807
|
-
|
|
807
|
+
4404,
|
|
808
808
|
'\nConfigure keybindings for commands that already have assignments {0}.',
|
|
809
809
|
keybindingToConfigureQuickPick
|
|
810
810
|
);
|
|
@@ -826,11 +826,11 @@ let AccessibleView = class AccessibleView extends Disposable {
|
|
|
826
826
|
return screenReaderModeHint;
|
|
827
827
|
}
|
|
828
828
|
_exitDialogHint(provider) {
|
|
829
|
-
return this._verbosityEnabled() && !provider.options.position ? ( localize(
|
|
829
|
+
return this._verbosityEnabled() && !provider.options.position ? ( localize(4405, '\nExit this dialog (Escape).')) : '';
|
|
830
830
|
}
|
|
831
831
|
_readMoreHint(provider) {
|
|
832
832
|
return provider.options.readMoreUrl ? ( localize(
|
|
833
|
-
|
|
833
|
+
4406,
|
|
834
834
|
"\nOpen a browser window with more information related to accessibility{0}.",
|
|
835
835
|
`<keybinding:${AccessibilityCommandId.AccessibilityHelpOpenHelpLink}>`
|
|
836
836
|
)) : '';
|
|
@@ -892,11 +892,11 @@ let AccessibleViewService = class AccessibleViewService extends Disposable {
|
|
|
892
892
|
const keybinding = this._keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibleView)?.getAriaLabel();
|
|
893
893
|
let hint = null;
|
|
894
894
|
if (keybinding) {
|
|
895
|
-
hint = ( localize(
|
|
895
|
+
hint = ( localize(4407, "Inspect this in the accessible view with {0}", keybinding));
|
|
896
896
|
}
|
|
897
897
|
else {
|
|
898
898
|
hint = ( localize(
|
|
899
|
-
|
|
899
|
+
4408,
|
|
900
900
|
"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."
|
|
901
901
|
));
|
|
902
902
|
}
|
|
@@ -938,8 +938,8 @@ let AccessibleViewSymbolQuickPick = class AccessibleViewSymbolQuickPick {
|
|
|
938
938
|
show(provider) {
|
|
939
939
|
const disposables = ( new DisposableStore());
|
|
940
940
|
const quickPick = disposables.add(this._quickInputService.createQuickPick());
|
|
941
|
-
quickPick.placeholder = ( localize(
|
|
942
|
-
quickPick.title = ( localize(
|
|
941
|
+
quickPick.placeholder = ( localize(4409, "Type to search symbols"));
|
|
942
|
+
quickPick.title = ( localize(4410, "Go to Symbol Accessible View"));
|
|
943
943
|
const picks = [];
|
|
944
944
|
const symbols = this._accessibleView.getSymbols();
|
|
945
945
|
if (!symbols) {
|
|
@@ -16,11 +16,11 @@ class ShowSignalSoundHelp extends Action2 {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super({
|
|
18
18
|
id: ShowSignalSoundHelp.ID,
|
|
19
|
-
title: ( localize2(
|
|
19
|
+
title: ( localize2(4423, "Help: List Signal Sounds")),
|
|
20
20
|
f1: true,
|
|
21
21
|
metadata: {
|
|
22
22
|
description: ( localize(
|
|
23
|
-
|
|
23
|
+
4424,
|
|
24
24
|
"List all accessibility sounds, noises, or audio cues and configure their settings"
|
|
25
25
|
))
|
|
26
26
|
}
|
|
@@ -38,7 +38,7 @@ class ShowSignalSoundHelp extends Action2 {
|
|
|
38
38
|
signal,
|
|
39
39
|
buttons: userGestureSignals.includes(signal) ? [{
|
|
40
40
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
41
|
-
tooltip: ( localize(
|
|
41
|
+
tooltip: ( localize(4425, 'Configure Sound')),
|
|
42
42
|
alwaysVisible: true
|
|
43
43
|
}] : []
|
|
44
44
|
}))).sort((a, b) => a.label.localeCompare(b.label));
|
|
@@ -74,7 +74,7 @@ class ShowSignalSoundHelp extends Action2 {
|
|
|
74
74
|
accessibilitySignalService.playSound(qp.activeItems[0].signal.sound.getSound(true), true, AcknowledgeDocCommentsToken);
|
|
75
75
|
}));
|
|
76
76
|
disposables.add(qp.onDidHide(() => disposables.dispose()));
|
|
77
|
-
qp.placeholder = ( localize(
|
|
77
|
+
qp.placeholder = ( localize(4426, 'Select a sound to play and configure'));
|
|
78
78
|
qp.canSelectMany = true;
|
|
79
79
|
await qp.show();
|
|
80
80
|
}
|
|
@@ -87,11 +87,11 @@ class ShowAccessibilityAnnouncementHelp extends Action2 {
|
|
|
87
87
|
constructor() {
|
|
88
88
|
super({
|
|
89
89
|
id: ShowAccessibilityAnnouncementHelp.ID,
|
|
90
|
-
title: ( localize2(
|
|
90
|
+
title: ( localize2(4427, "Help: List Signal Announcements")),
|
|
91
91
|
f1: true,
|
|
92
92
|
metadata: {
|
|
93
93
|
description: ( localize(
|
|
94
|
-
|
|
94
|
+
4428,
|
|
95
95
|
"List all accessibility announcements, alerts, braille messages, and configure their settings"
|
|
96
96
|
))
|
|
97
97
|
}
|
|
@@ -109,7 +109,7 @@ class ShowAccessibilityAnnouncementHelp extends Action2 {
|
|
|
109
109
|
signal,
|
|
110
110
|
buttons: userGestureSignals.includes(signal) ? [{
|
|
111
111
|
iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
|
|
112
|
-
tooltip: ( localize(
|
|
112
|
+
tooltip: ( localize(4429, 'Configure Announcement')),
|
|
113
113
|
alwaysVisible: true,
|
|
114
114
|
}] : []
|
|
115
115
|
}))).sort((a, b) => a.label.localeCompare(b.label));
|
|
@@ -142,8 +142,8 @@ class ShowAccessibilityAnnouncementHelp extends Action2 {
|
|
|
142
142
|
preferencesService.openUserSettings({ jsonEditor: true, revealSetting: { key: e.item.signal.settingsKey, edit: true } });
|
|
143
143
|
}));
|
|
144
144
|
disposables.add(qp.onDidHide(() => disposables.dispose()));
|
|
145
|
-
qp.placeholder = screenReaderOptimized ? ( localize(
|
|
146
|
-
|
|
145
|
+
qp.placeholder = screenReaderOptimized ? ( localize(4430, 'Select an announcement to configure')) : ( localize(
|
|
146
|
+
4431,
|
|
147
147
|
'Screen reader is not active, announcements are disabled by default.'
|
|
148
148
|
));
|
|
149
149
|
qp.canSelectMany = true;
|
package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement.js
CHANGED
|
@@ -36,7 +36,7 @@ let DiffEditorActiveAnnouncementContribution = class DiffEditorActiveAnnouncemen
|
|
|
36
36
|
}
|
|
37
37
|
this._onDidActiveEditorChangeListener = this._register(this._editorService.onDidActiveEditorChange(() => {
|
|
38
38
|
if (isDiffEditor(this._editorService.activeTextEditorControl)) {
|
|
39
|
-
this._accessibilityService.alert(( localize(
|
|
39
|
+
this._accessibilityService.alert(( localize(4432, "Diff editor")));
|
|
40
40
|
}
|
|
41
41
|
}));
|
|
42
42
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
3
|
import * as accessibility from './accessibility.css';
|
|
4
|
-
import { localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
|
+
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
5
|
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
6
6
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
7
|
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
@@ -9,18 +9,20 @@ import { Action2, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs
|
|
|
9
9
|
import { accessibilityHelpIsShown } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
10
10
|
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
11
11
|
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
12
|
-
import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
13
12
|
import { AccessibilityHelpNLS } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/standaloneStrings';
|
|
13
|
+
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
|
|
14
|
+
import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
15
|
+
import { CursorColumns } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/cursorColumns';
|
|
14
16
|
|
|
15
17
|
registerCss(accessibility);
|
|
16
18
|
class ToggleScreenReaderMode extends Action2 {
|
|
17
19
|
constructor() {
|
|
18
20
|
super({
|
|
19
21
|
id: 'editor.action.toggleScreenReaderAccessibilityMode',
|
|
20
|
-
title: ( localize2(
|
|
22
|
+
title: ( localize2(6141, "Toggle Screen Reader Accessibility Mode")),
|
|
21
23
|
metadata: {
|
|
22
24
|
description: ( localize2(
|
|
23
|
-
|
|
25
|
+
6142,
|
|
24
26
|
"Toggles an optimized mode for usage with screen readers, braille devices, and other assistive technologies."
|
|
25
27
|
)),
|
|
26
28
|
},
|
|
@@ -46,3 +48,39 @@ class ToggleScreenReaderMode extends Action2 {
|
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
registerAction2(ToggleScreenReaderMode);
|
|
51
|
+
class AnnounceCursorPosition extends Action2 {
|
|
52
|
+
constructor() {
|
|
53
|
+
super({
|
|
54
|
+
id: 'editor.action.announceCursorPosition',
|
|
55
|
+
title: ( localize2(6143, "Announce Cursor Position")),
|
|
56
|
+
f1: true,
|
|
57
|
+
metadata: {
|
|
58
|
+
description: ( localize2(
|
|
59
|
+
6144,
|
|
60
|
+
"Announce the current cursor position (line and column) via screen reader."
|
|
61
|
+
))
|
|
62
|
+
},
|
|
63
|
+
keybinding: {
|
|
64
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyG,
|
|
65
|
+
weight: KeybindingWeight.WorkbenchContrib + 10
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async run(accessor) {
|
|
70
|
+
const codeEditorService = accessor.get(ICodeEditorService);
|
|
71
|
+
const editor = codeEditorService.getFocusedCodeEditor();
|
|
72
|
+
if (!editor) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const position = editor.getPosition();
|
|
76
|
+
const model = editor.getModel();
|
|
77
|
+
if (!position || !model) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const tabSize = model.getOptions().tabSize;
|
|
81
|
+
const lineContent = model.getLineContent(position.lineNumber);
|
|
82
|
+
const visibleColumn = CursorColumns.visibleColumnFromColumn(lineContent, position.column, tabSize) + 1;
|
|
83
|
+
alert(( localize(6145, "Line {0}, Column {1}", position.lineNumber, visibleColumn)));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
registerAction2(AnnounceCursorPosition);
|