Skip to content

Commit bac433a

Browse files
committed
make it a function
1 parent b84241e commit bac433a

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/vs/editor/common/languages.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,10 @@ export namespace SymbolKinds {
11891189
}
11901190
return icon;
11911191
}
1192+
1193+
export function asAriaLabel(label: string, kind: SymbolKind): string {
1194+
return `${label} Symbol: ${SymbolKinds.toIcon(kind).id.replaceAll('symbol-', '')} `;
1195+
}
11921196
}
11931197

11941198
export interface DocumentSymbol {

src/vs/monaco.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7459,6 +7459,8 @@ declare namespace monaco.languages {
74597459
Deprecated = 1
74607460
}
74617461

7462+
function asAriaLabel(label: string, kind: SymbolKind): string;
7463+
74627464
export interface DocumentSymbol {
74637465
name: string;
74647466
detail: string;

src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class DocumentSymbolAccessibilityProvider implements IListAccessibilityPr
4949
if (element instanceof OutlineGroup) {
5050
return element.label;
5151
} else {
52-
return `${element.symbol.name} Symbol: ${SymbolKinds.toIcon(element.symbol.kind).id.replaceAll('symbol-', '')} `;
52+
return SymbolKinds.asAriaLabel(element.symbol.name, element.symbol.kind);
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)