@@ -2255,26 +2255,63 @@ module ts {
2255
2255
return undefined ;
2256
2256
}
2257
2257
2258
+ // Having all this logic here is pretty unclean. Consider moving to the roslyn model
2259
+ // where all symbol display logic is encapsulated into visitors and options.
2258
2260
var totalParts : SymbolDisplayPart [ ] = [ ] ;
2261
+ var addType = false ;
2262
+
2259
2263
if ( symbol . flags & SymbolFlags . Class ) {
2260
2264
totalParts . push ( { text : "class" , kind : SymbolDisplayPartKind . keyword , symbol : undefined } ) ;
2265
+ totalParts . push ( { text : " " , kind : SymbolDisplayPartKind . space , symbol : undefined } ) ;
2261
2266
}
2262
2267
else if ( symbol . flags & SymbolFlags . Interface ) {
2263
2268
totalParts . push ( { text : "interface" , kind : SymbolDisplayPartKind . keyword , symbol : undefined } ) ;
2269
+ totalParts . push ( { text : " " , kind : SymbolDisplayPartKind . space , symbol : undefined } ) ;
2264
2270
}
2265
2271
else if ( symbol . flags & SymbolFlags . Enum ) {
2266
2272
totalParts . push ( { text : "enum" , kind : SymbolDisplayPartKind . keyword , symbol : undefined } ) ;
2273
+ totalParts . push ( { text : " " , kind : SymbolDisplayPartKind . space , symbol : undefined } ) ;
2267
2274
}
2268
2275
else if ( symbol . flags & SymbolFlags . Module ) {
2269
2276
totalParts . push ( { text : "module" , kind : SymbolDisplayPartKind . keyword , symbol : undefined } ) ;
2277
+ totalParts . push ( { text : " " , kind : SymbolDisplayPartKind . space , symbol : undefined } ) ;
2278
+ }
2279
+ else if ( symbol . flags & SymbolFlags . TypeParameter ) {
2280
+ }
2281
+ else {
2282
+ addType = true ;
2283
+ totalParts . push ( { text : "(" , kind : SymbolDisplayPartKind . punctuation , symbol : undefined } ) ;
2284
+ var text : string ;
2285
+
2286
+ if ( symbol . flags & SymbolFlags . Property ) { text = "property" }
2287
+ else if ( symbol . flags & SymbolFlags . EnumMember ) { text = "enum member" }
2288
+ else if ( symbol . flags & SymbolFlags . Function ) { text = "function" }
2289
+ else if ( symbol . flags & SymbolFlags . Variable ) { text = "variable" }
2290
+ else if ( symbol . flags & SymbolFlags . Method ) { text = "method" }
2291
+
2292
+ if ( ! text ) {
2293
+ return undefined ;
2294
+ }
2295
+
2296
+ totalParts . push ( { text : text , kind : SymbolDisplayPartKind . text , symbol : undefined } ) ;
2297
+ totalParts . push ( { text : ")" , kind : SymbolDisplayPartKind . punctuation , symbol : undefined } ) ;
2298
+ totalParts . push ( { text : " " , kind : SymbolDisplayPartKind . space , symbol : undefined } ) ;
2270
2299
}
2271
2300
2272
- totalParts . push ( { text : " " , kind : SymbolDisplayPartKind . space , symbol : undefined } ) ;
2273
2301
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , getContainerNode ( node ) ) ) ;
2274
2302
2275
- var type = typeInfoResolver . getTypeOfSymbol ( symbol ) ;
2276
- if ( type ) {
2277
- totalParts . push . apply ( totalParts , typeInfoResolver . typeToDisplayParts ( type ) ) ;
2303
+ if ( symbol . flags & SymbolFlags . Property ||
2304
+ symbol . flags & SymbolFlags . EnumMember ||
2305
+ symbol . flags & SymbolFlags . Variable ) {
2306
+
2307
+ totalParts . push ( { text : "." , kind : SymbolDisplayPartKind . punctuation , symbol : undefined } ) ;
2308
+ }
2309
+
2310
+ if ( addType ) {
2311
+ var type = typeInfoResolver . getTypeOfSymbol ( symbol ) ;
2312
+ if ( type ) {
2313
+ totalParts . push . apply ( totalParts , typeInfoResolver . typeToDisplayParts ( type ) ) ;
2314
+ }
2278
2315
}
2279
2316
2280
2317
return new QuickInfo (
0 commit comments