@@ -2404,31 +2404,34 @@ module ts {
2404
2404
2405
2405
var documentationParts = getSymbolDocumentationDisplayParts ( symbol ) ;
2406
2406
2407
+ // TODO: handle union properties appropriately when merging with master
2408
+ var symbolFlags = typeInfoResolver . getRootSymbols ( symbol ) [ 0 ] . flags ;
2409
+
2407
2410
// Having all this logic here is pretty unclean. Consider moving to the roslyn model
2408
2411
// where all symbol display logic is encapsulated into visitors and options.
2409
2412
var totalParts : SymbolDisplayPart [ ] = [ ] ;
2410
2413
2411
- if ( symbol . flags & SymbolFlags . Class ) {
2414
+ if ( symbolFlags & SymbolFlags . Class ) {
2412
2415
totalParts . push ( keywordPart ( SyntaxKind . ClassKeyword ) ) ;
2413
2416
totalParts . push ( spacePart ( ) ) ;
2414
2417
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2415
2418
}
2416
- else if ( symbol . flags & SymbolFlags . Interface ) {
2419
+ else if ( symbolFlags & SymbolFlags . Interface ) {
2417
2420
totalParts . push ( keywordPart ( SyntaxKind . InterfaceKeyword ) ) ;
2418
2421
totalParts . push ( spacePart ( ) ) ;
2419
2422
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2420
2423
}
2421
- else if ( symbol . flags & SymbolFlags . Enum ) {
2424
+ else if ( symbolFlags & SymbolFlags . Enum ) {
2422
2425
totalParts . push ( keywordPart ( SyntaxKind . EnumKeyword ) ) ;
2423
2426
totalParts . push ( spacePart ( ) ) ;
2424
2427
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2425
2428
}
2426
- else if ( symbol . flags & SymbolFlags . Module ) {
2429
+ else if ( symbolFlags & SymbolFlags . Module ) {
2427
2430
totalParts . push ( keywordPart ( SyntaxKind . ModuleKeyword ) ) ;
2428
2431
totalParts . push ( spacePart ( ) ) ;
2429
2432
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2430
2433
}
2431
- else if ( symbol . flags & SymbolFlags . TypeParameter ) {
2434
+ else if ( symbolFlags & SymbolFlags . TypeParameter ) {
2432
2435
totalParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
2433
2436
totalParts . push ( new SymbolDisplayPart ( "type parameter" , SymbolDisplayPartKind . text , undefined ) ) ;
2434
2437
totalParts . push ( punctuationPart ( SyntaxKind . CloseParenToken ) ) ;
@@ -2439,11 +2442,11 @@ module ts {
2439
2442
totalParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
2440
2443
var text : string ;
2441
2444
2442
- if ( symbol . flags & SymbolFlags . Property ) { text = "property" }
2443
- else if ( symbol . flags & SymbolFlags . EnumMember ) { text = "enum member" }
2444
- else if ( symbol . flags & SymbolFlags . Function ) { text = "function" }
2445
- else if ( symbol . flags & SymbolFlags . Variable ) { text = "variable" }
2446
- else if ( symbol . flags & SymbolFlags . Method ) { text = "method" }
2445
+ if ( symbolFlags & SymbolFlags . Property ) { text = "property" }
2446
+ else if ( symbolFlags & SymbolFlags . EnumMember ) { text = "enum member" }
2447
+ else if ( symbolFlags & SymbolFlags . Function ) { text = "function" }
2448
+ else if ( symbolFlags & SymbolFlags . Variable ) { text = "variable" }
2449
+ else if ( symbolFlags & SymbolFlags . Method ) { text = "method" }
2447
2450
2448
2451
if ( ! text ) {
2449
2452
return undefined ;
@@ -2457,22 +2460,22 @@ module ts {
2457
2460
2458
2461
var type = typeInfoResolver . getTypeOfSymbol ( symbol ) ;
2459
2462
2460
- if ( symbol . flags & SymbolFlags . Property ||
2461
- symbol . flags & SymbolFlags . Variable ) {
2463
+ if ( symbolFlags & SymbolFlags . Property ||
2464
+ symbolFlags & SymbolFlags . Variable ) {
2462
2465
2463
2466
if ( type ) {
2464
2467
totalParts . push ( punctuationPart ( SyntaxKind . ColonToken ) ) ;
2465
2468
totalParts . push ( spacePart ( ) ) ;
2466
2469
totalParts . push . apply ( totalParts , typeInfoResolver . typeToDisplayParts ( type , getContainerNode ( node ) ) ) ;
2467
2470
}
2468
2471
}
2469
- else if ( symbol . flags & SymbolFlags . Function ||
2470
- symbol . flags & SymbolFlags . Method ) {
2472
+ else if ( symbolFlags & SymbolFlags . Function ||
2473
+ symbolFlags & SymbolFlags . Method ) {
2471
2474
if ( type ) {
2472
2475
totalParts . push . apply ( totalParts , typeInfoResolver . typeToDisplayParts ( type , getContainerNode ( node ) ) ) ;
2473
2476
}
2474
2477
}
2475
- else if ( symbol . flags & SymbolFlags . EnumMember ) {
2478
+ else if ( symbolFlags & SymbolFlags . EnumMember ) {
2476
2479
var declaration = symbol . declarations [ 0 ] ;
2477
2480
if ( declaration . kind === SyntaxKind . EnumMember ) {
2478
2481
var constantValue = typeInfoResolver . getEnumMemberValue ( < EnumMember > declaration ) ;
0 commit comments