提交 e44ed6aa 编写于 作者: R rebornix

Re #92342, accessibility provider for comments panel

上级 c22cc2b3
......@@ -21,6 +21,7 @@ import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/l
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IColorMapping } from 'vs/platform/theme/common/styler';
import { basename } from 'vs/base/common/resources';
export const COMMENTS_VIEW_ID = 'workbench.panel.comments';
export const COMMENTS_VIEW_TITLE = 'Comments';
......@@ -181,6 +182,27 @@ export class CommentsList extends WorkbenchAsyncDataTree<any, any> {
renderers,
dataSource,
{
accessibilityProvider: {
getAriaLabel(element: any): string {
if (element instanceof CommentsModel) {
return nls.localize('rootCommentsLabel', "Comments for current workspace");
}
if (element instanceof ResourceWithCommentThreads) {
return nls.localize('resourceWithCommentThreadsLabel', "Comments in {0}, full path {1}", basename(element.resource), element.resource.fsPath);
}
if (element instanceof CommentNode) {
return nls.localize('resourceWithCommentLabel',
"Comment from ${0} at line {1} column {2} in {3}, source: {4}",
element.comment.userName,
element.range.startLineNumber,
element.range.startColumn,
basename(element.resource),
element.comment.body.value
);
}
return '';
}
},
ariaLabel: COMMENTS_VIEW_TITLE,
keyboardSupport: true,
identityProvider: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册