From c7a70567072f4a53cd5bae7aecc3e7c7e1c802d9 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Fri, 22 Sep 2023 08:38:01 -0700 Subject: [PATCH] fix #193500 --- .../contrib/comments/browser/commentsController.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentsController.ts b/src/vs/workbench/contrib/comments/browser/commentsController.ts index 412aa072ba2..c7fb47476c8 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsController.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsController.ts @@ -43,6 +43,7 @@ import { CommentContextKeys } from 'vs/workbench/contrib/comments/common/comment import { AccessibilityVerbositySettingId } from 'vs/workbench/contrib/accessibility/browser/accessibilityConfiguration'; import { AccessibilityCommandId } from 'vs/workbench/contrib/accessibility/common/accessibilityCommands'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; export const ID = 'editor.contrib.review'; @@ -384,7 +385,8 @@ export class CommentController implements IEditorContribution { @IConfigurationService private readonly configurationService: IConfigurationService, @IContextKeyService contextKeyService: IContextKeyService, @IEditorService private readonly editorService: IEditorService, - @IKeybindingService private readonly keybindingService: IKeybindingService + @IKeybindingService private readonly keybindingService: IKeybindingService, + @IAccessibilityService private readonly accessibilityService: IAccessibilityService ) { this._commentInfos = []; this._commentWidgets = []; @@ -725,6 +727,14 @@ export class CommentController implements IEditorContribution { this.editor.setPosition(position); this.editor.revealLineInCenterIfOutsideViewport(position.lineNumber); } + if (this.accessibilityService.isScreenReaderOptimized()) { + const commentRangeStart = range?.getStartPosition().lineNumber; + const commentRangeEnd = range?.getEndPosition().lineNumber; + if (commentRangeStart && commentRangeEnd) { + const oneLine = commentRangeStart === commentRangeEnd; + oneLine ? status(nls.localize('commentRange', "Line {0}", commentRangeStart)) : status(nls.localize('commentRangeStart', "Lines {0} to {1}", commentRangeStart, commentRangeEnd)); + } + } } public nextCommentingRange(): void {