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 {