Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/vs/editor/common/standaloneStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export namespace AccessibilityHelpNLS {
export const showAccessibilityHelpAction = nls.localize("showAccessibilityHelpAction", "Show Accessibility Help");
export const listSignalSounds = nls.localize("listSignalSoundsCommand", "Run the command: List Signal Sounds for an overview of all sounds and their current status.");
export const listAlerts = nls.localize("listAnnouncementsCommand", "Run the command: List Signal Announcements for an overview of announcements and their current status.");
export const announceCursorPosition = nls.localize("announceCursorPosition", "Run the command: Announce Cursor Position{0} to hear the current line and column.", '<keybinding:editor.action.announceCursorPosition>');
export const quickChat = nls.localize("quickChatCommand", "Toggle quick chat{0} to open or close a chat session.", '<keybinding:workbench.action.quickchat.toggle>');
export const startInlineChat = nls.localize("startInlineChatCommand", "Start inline chat{0} to create an in editor chat session.", '<keybinding:inlineChat.start>');
export const startDebugging = nls.localize('debug.startDebugging', "The Debug: Start Debugging command{0} will start a debug session.", '<keybinding:workbench.action.debug.start>');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class EditorAccessibilityHelpProvider extends Disposable implements IAccessibleV

content.push(AccessibilityHelpNLS.listSignalSounds);
content.push(AccessibilityHelpNLS.listAlerts);
content.push(AccessibilityHelpNLS.announceCursorPosition);


const chatCommandInfo = getChatCommandInfo(this._keybindingService, this._contextKeyService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import { Action2, registerAction2 } from '../../../../../platform/actions/common
import { accessibilityHelpIsShown } from '../../../accessibility/browser/accessibilityConfiguration.js';
import { KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';
import { KeyCode, KeyMod } from '../../../../../base/common/keyCodes.js';
import { alert } from '../../../../../base/browser/ui/aria/aria.js';
import { AccessibilityHelpNLS } from '../../../../../editor/common/standaloneStrings.js';
import { ICodeEditorService } from '../../../../../editor/browser/services/codeEditorService.js';
import { alert } from '../../../../../base/browser/ui/aria/aria.js';

class ToggleScreenReaderMode extends Action2 {

Expand Down Expand Up @@ -48,3 +49,35 @@ class ToggleScreenReaderMode extends Action2 {
}

registerAction2(ToggleScreenReaderMode);

class AnnounceCursorPosition extends Action2 {
constructor() {
super({
id: 'editor.action.announceCursorPosition',
title: nls.localize2('announceCursorPosition', "Announce Cursor Position"),
f1: true,
metadata: {
description: nls.localize2('announceCursorPosition.description', "Announce the current cursor position (line and column) via screen reader.")
},
keybinding: {
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyG,
weight: KeybindingWeight.WorkbenchContrib + 10
}
});
}

async run(accessor: ServicesAccessor): Promise<void> {
const codeEditorService = accessor.get(ICodeEditorService);
const editor = codeEditorService.getFocusedCodeEditor();
if (!editor) {
return;
}
const position = editor.getPosition();
if (!position) {
return;
}
alert(nls.localize('screenReader.lineColPosition', "Line {0}, Column {1}", position.lineNumber, position.column));
}
}

registerAction2(AnnounceCursorPosition);
Loading