Skip to content

Commit 668d0cf

Browse files
committed
status bar: use better default for ariaLabel, get the codicon name since it is well represented
microsoft#95360
1 parent 39a406d commit 668d0cf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/vs/workbench/api/browser/mainThreadStatusBar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { IAccessibilityInformation } from 'vs/platform/accessibility/common/acce
1515
export class MainThreadStatusBar implements MainThreadStatusBarShape {
1616

1717
private readonly entries: Map<number, { accessor: IStatusbarEntryAccessor, alignment: MainThreadStatusBarAlignment, priority: number }> = new Map();
18+
static readonly CODICON_REGEXP = /\$\((.*?)\)/g;
1819

1920
constructor(
2021
_extHostContext: IExtHostContext,
@@ -32,7 +33,7 @@ export class MainThreadStatusBar implements MainThreadStatusBarShape {
3233
if (accessibilityInformation) {
3334
ariaLabel = accessibilityInformation.label;
3435
} else {
35-
ariaLabel = text && text.indexOf('$(') === -1 ? text : tooltip || text;
36+
ariaLabel = text ? text.replace(MainThreadStatusBar.CODICON_REGEXP, (_match, codiconName) => codiconName) : '';
3637
}
3738
const entry: IStatusbarEntry = { text, tooltip, command, color, ariaLabel };
3839

0 commit comments

Comments
 (0)