@@ -11,7 +11,7 @@ import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelega
1111import { ITreeNode , ITreeRenderer , ITreeFilter } from 'vs/base/browser/ui/tree/tree' ;
1212import { createMatches , FuzzyScore } from 'vs/base/common/filters' ;
1313import { Range } from 'vs/editor/common/core/range' ;
14- import { SymbolKind , SymbolKinds , SymbolTag } from 'vs/editor/common/languages' ;
14+ import { SymbolKind , SymbolKinds , SymbolTag , getAriaLabelForSymbol , symbolKindNames } from 'vs/editor/common/languages' ;
1515import { OutlineElement , OutlineGroup , OutlineModel } from 'vs/editor/contrib/documentSymbols/browser/outlineModel' ;
1616import { localize } from 'vs/nls' ;
1717import { IconLabel , IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel' ;
@@ -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 ;
52+ return getAriaLabelForSymbol ( element . symbol . name , element . symbol . kind ) ;
5353 }
5454 }
5555}
@@ -138,7 +138,7 @@ export class DocumentSymbolRenderer implements ITreeRenderer<OutlineElement, Fuz
138138 matches : createMatches ( node . filterData ) ,
139139 labelEscapeNewLines : true ,
140140 extraClasses,
141- title : localize ( 'title.template' , "{0} ({1})" , element . symbol . name , DocumentSymbolRenderer . _symbolKindNames [ element . symbol . kind ] )
141+ title : localize ( 'title.template' , "{0} ({1})" , element . symbol . name , symbolKindNames [ element . symbol . kind ] )
142142 } ;
143143 if ( this . _configurationService . getValue ( OutlineConfigKeys . icons ) ) {
144144 // add styles for the icons
@@ -195,34 +195,7 @@ export class DocumentSymbolRenderer implements ITreeRenderer<OutlineElement, Fuz
195195 }
196196 }
197197
198- private static _symbolKindNames : { [ symbol : number ] : string } = {
199- [ SymbolKind . Array ] : localize ( 'Array' , "array" ) ,
200- [ SymbolKind . Boolean ] : localize ( 'Boolean' , "boolean" ) ,
201- [ SymbolKind . Class ] : localize ( 'Class' , "class" ) ,
202- [ SymbolKind . Constant ] : localize ( 'Constant' , "constant" ) ,
203- [ SymbolKind . Constructor ] : localize ( 'Constructor' , "constructor" ) ,
204- [ SymbolKind . Enum ] : localize ( 'Enum' , "enumeration" ) ,
205- [ SymbolKind . EnumMember ] : localize ( 'EnumMember' , "enumeration member" ) ,
206- [ SymbolKind . Event ] : localize ( 'Event' , "event" ) ,
207- [ SymbolKind . Field ] : localize ( 'Field' , "field" ) ,
208- [ SymbolKind . File ] : localize ( 'File' , "file" ) ,
209- [ SymbolKind . Function ] : localize ( 'Function' , "function" ) ,
210- [ SymbolKind . Interface ] : localize ( 'Interface' , "interface" ) ,
211- [ SymbolKind . Key ] : localize ( 'Key' , "key" ) ,
212- [ SymbolKind . Method ] : localize ( 'Method' , "method" ) ,
213- [ SymbolKind . Module ] : localize ( 'Module' , "module" ) ,
214- [ SymbolKind . Namespace ] : localize ( 'Namespace' , "namespace" ) ,
215- [ SymbolKind . Null ] : localize ( 'Null' , "null" ) ,
216- [ SymbolKind . Number ] : localize ( 'Number' , "number" ) ,
217- [ SymbolKind . Object ] : localize ( 'Object' , "object" ) ,
218- [ SymbolKind . Operator ] : localize ( 'Operator' , "operator" ) ,
219- [ SymbolKind . Package ] : localize ( 'Package' , "package" ) ,
220- [ SymbolKind . Property ] : localize ( 'Property' , "property" ) ,
221- [ SymbolKind . String ] : localize ( 'String' , "string" ) ,
222- [ SymbolKind . Struct ] : localize ( 'Struct' , "struct" ) ,
223- [ SymbolKind . TypeParameter ] : localize ( 'TypeParameter' , "type parameter" ) ,
224- [ SymbolKind . Variable ] : localize ( 'Variable' , "variable" ) ,
225- } ;
198+
226199
227200 disposeTemplate ( _template : DocumentSymbolTemplate ) : void {
228201 _template . iconLabel . dispose ( ) ;
0 commit comments