@@ -2384,34 +2384,34 @@ module ts {
2384
2384
var totalParts : SymbolDisplayPart [ ] = [ ] ;
2385
2385
2386
2386
if ( symbol . flags & SymbolFlags . Class ) {
2387
- totalParts . push ( new SymbolDisplayPart ( "class" , SymbolDisplayPartKind . keyword , undefined ) ) ;
2388
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2387
+ totalParts . push ( keywordPart ( SyntaxKind . ClassKeyword ) ) ;
2388
+ totalParts . push ( spacePart ( ) ) ;
2389
2389
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2390
2390
}
2391
2391
else if ( symbol . flags & SymbolFlags . Interface ) {
2392
- totalParts . push ( new SymbolDisplayPart ( "interface" , SymbolDisplayPartKind . keyword , undefined ) ) ;
2393
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2392
+ totalParts . push ( keywordPart ( SyntaxKind . InterfaceKeyword ) ) ;
2393
+ totalParts . push ( spacePart ( ) ) ;
2394
2394
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2395
2395
}
2396
2396
else if ( symbol . flags & SymbolFlags . Enum ) {
2397
- totalParts . push ( new SymbolDisplayPart ( "enum" , SymbolDisplayPartKind . keyword , undefined ) ) ;
2398
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2397
+ totalParts . push ( keywordPart ( SyntaxKind . EnumKeyword ) ) ;
2398
+ totalParts . push ( spacePart ( ) ) ;
2399
2399
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2400
2400
}
2401
2401
else if ( symbol . flags & SymbolFlags . Module ) {
2402
- totalParts . push ( new SymbolDisplayPart ( "module" , SymbolDisplayPartKind . keyword , undefined ) ) ;
2403
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2402
+ totalParts . push ( keywordPart ( SyntaxKind . ModuleKeyword ) ) ;
2403
+ totalParts . push ( spacePart ( ) ) ;
2404
2404
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , sourceFile ) ) ;
2405
2405
}
2406
2406
else if ( symbol . flags & SymbolFlags . TypeParameter ) {
2407
- totalParts . push ( new SymbolDisplayPart ( "(" , SymbolDisplayPartKind . punctuation , undefined ) ) ;
2407
+ totalParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
2408
2408
totalParts . push ( new SymbolDisplayPart ( "type parameter" , SymbolDisplayPartKind . text , undefined ) ) ;
2409
- totalParts . push ( new SymbolDisplayPart ( ")" , SymbolDisplayPartKind . punctuation , undefined ) ) ;
2410
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2409
+ totalParts . push ( punctuationPart ( SyntaxKind . CloseParenToken ) ) ;
2410
+ totalParts . push ( spacePart ( ) ) ;
2411
2411
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol ) ) ;
2412
2412
}
2413
2413
else {
2414
- totalParts . push ( new SymbolDisplayPart ( "(" , SymbolDisplayPartKind . punctuation , undefined ) ) ;
2414
+ totalParts . push ( punctuationPart ( SyntaxKind . OpenParenToken ) ) ;
2415
2415
var text : string ;
2416
2416
2417
2417
if ( symbol . flags & SymbolFlags . Property ) { text = "property" }
@@ -2425,8 +2425,8 @@ module ts {
2425
2425
}
2426
2426
2427
2427
totalParts . push ( new SymbolDisplayPart ( text , SymbolDisplayPartKind . text , undefined ) ) ;
2428
- totalParts . push ( new SymbolDisplayPart ( ")" , SymbolDisplayPartKind . punctuation , undefined ) ) ;
2429
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2428
+ totalParts . push ( punctuationPart ( SyntaxKind . CloseParenToken ) ) ;
2429
+ totalParts . push ( spacePart ( ) ) ;
2430
2430
2431
2431
totalParts . push . apply ( totalParts , typeInfoResolver . symbolToDisplayParts ( symbol , getContainerNode ( node ) ) ) ;
2432
2432
@@ -2436,8 +2436,8 @@ module ts {
2436
2436
symbol . flags & SymbolFlags . Variable ) {
2437
2437
2438
2438
if ( type ) {
2439
- totalParts . push ( new SymbolDisplayPart ( ":" , SymbolDisplayPartKind . punctuation , undefined ) ) ;
2440
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2439
+ totalParts . push ( punctuationPart ( SyntaxKind . ColonToken ) ) ;
2440
+ totalParts . push ( spacePart ( ) ) ;
2441
2441
totalParts . push . apply ( totalParts , typeInfoResolver . typeToDisplayParts ( type , getContainerNode ( node ) ) ) ;
2442
2442
}
2443
2443
}
@@ -2452,9 +2452,9 @@ module ts {
2452
2452
if ( declaration . kind === SyntaxKind . EnumMember ) {
2453
2453
var constantValue = typeInfoResolver . getEnumMemberValue ( < EnumMember > declaration ) ;
2454
2454
if ( constantValue !== undefined ) {
2455
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2456
- totalParts . push ( new SymbolDisplayPart ( "=" , SymbolDisplayPartKind . operator , undefined ) ) ;
2457
- totalParts . push ( new SymbolDisplayPart ( " " , SymbolDisplayPartKind . space , undefined ) ) ;
2455
+ totalParts . push ( spacePart ( ) ) ;
2456
+ totalParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
2457
+ totalParts . push ( spacePart ( ) ) ;
2458
2458
totalParts . push ( new SymbolDisplayPart ( constantValue . toString ( ) , SymbolDisplayPartKind . numericLiteral , undefined ) ) ;
2459
2459
}
2460
2460
}
0 commit comments