@@ -4628,7 +4628,8 @@ namespace ts {
46284628 const symbolFlags = symbol . flags ;
46294629 let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar ( symbol , symbolFlags , location ) ;
46304630 let hasAddedSymbolInfo : boolean ;
4631- const isThisExpression : boolean = location . kind === SyntaxKind . ThisKeyword && isExpression ( location ) ;
4631+ const isThisExpression = location . kind === SyntaxKind . ThisKeyword && isExpression ( location ) ;
4632+ const isConstructor = location . kind === SyntaxKind . ConstructorKeyword ;
46324633 let type : Type ;
46334634
46344635 // Class at constructor site need to be shown as constructor apart from property,method, vars
@@ -4639,7 +4640,12 @@ namespace ts {
46394640 }
46404641
46414642 let signature : Signature ;
4642- type = isThisExpression ? typeChecker . getTypeAtLocation ( location ) : typeChecker . getTypeOfSymbolAtLocation ( symbol , location ) ;
4643+ type = isThisExpression
4644+ ? typeChecker . getTypeAtLocation ( location )
4645+ : isConstructor
4646+ // For constructor, get type of the class.
4647+ ? typeChecker . getTypeOfSymbolAtLocation ( symbol . parent , location )
4648+ : typeChecker . getTypeOfSymbolAtLocation ( symbol , location ) ;
46434649 if ( type ) {
46444650 if ( location . parent && location . parent . kind === SyntaxKind . PropertyAccessExpression ) {
46454651 const right = ( < PropertyAccessExpression > location . parent ) . name ;
@@ -4737,9 +4743,7 @@ namespace ts {
47374743 if ( functionDeclaration . kind === SyntaxKind . Constructor ) {
47384744 // show (constructor) Type(...) signature
47394745 symbolKind = ScriptElementKind . constructorImplementationElement ;
4740- // For a constructor, `type` will be unknown.
4741- const showSymbol = symbol . declarations [ 0 ] . kind === SyntaxKind . Constructor ? symbol . parent : type . symbol ;
4742- addPrefixForAnyFunctionOrVar ( showSymbol , symbolKind ) ;
4746+ addPrefixForAnyFunctionOrVar ( type . symbol , symbolKind ) ;
47434747 }
47444748 else {
47454749 // (function/method) symbol(..signature)
0 commit comments