@@ -11,7 +11,7 @@ import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelega
11
11
import { ITreeNode , ITreeRenderer , ITreeFilter } from 'vs/base/browser/ui/tree/tree' ;
12
12
import { createMatches , FuzzyScore } from 'vs/base/common/filters' ;
13
13
import { 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' ;
15
15
import { OutlineElement , OutlineGroup , OutlineModel } from 'vs/editor/contrib/documentSymbols/browser/outlineModel' ;
16
16
import { localize } from 'vs/nls' ;
17
17
import { IconLabel , IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel' ;
@@ -49,7 +49,7 @@ export class DocumentSymbolAccessibilityProvider implements IListAccessibilityPr
49
49
if ( element instanceof OutlineGroup ) {
50
50
return element . label ;
51
51
} else {
52
- return element . symbol . name ;
52
+ return getAriaLabelForSymbol ( element . symbol . name , element . symbol . kind ) ;
53
53
}
54
54
}
55
55
}
@@ -138,7 +138,7 @@ export class DocumentSymbolRenderer implements ITreeRenderer<OutlineElement, Fuz
138
138
matches : createMatches ( node . filterData ) ,
139
139
labelEscapeNewLines : true ,
140
140
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 ] )
142
142
} ;
143
143
if ( this . _configurationService . getValue ( OutlineConfigKeys . icons ) ) {
144
144
// add styles for the icons
@@ -195,34 +195,7 @@ export class DocumentSymbolRenderer implements ITreeRenderer<OutlineElement, Fuz
195
195
}
196
196
}
197
197
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
+
226
199
227
200
disposeTemplate ( _template : DocumentSymbolTemplate ) : void {
228
201
_template . iconLabel . dispose ( ) ;
0 commit comments