@@ -4628,7 +4628,8 @@ namespace ts {
4628
4628
const symbolFlags = symbol . flags ;
4629
4629
let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar ( symbol , symbolFlags , location ) ;
4630
4630
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 ;
4632
4633
let type : Type ;
4633
4634
4634
4635
// Class at constructor site need to be shown as constructor apart from property,method, vars
@@ -4639,7 +4640,12 @@ namespace ts {
4639
4640
}
4640
4641
4641
4642
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 ) ;
4643
4649
if ( type ) {
4644
4650
if ( location . parent && location . parent . kind === SyntaxKind . PropertyAccessExpression ) {
4645
4651
const right = ( < PropertyAccessExpression > location . parent ) . name ;
@@ -4737,9 +4743,7 @@ namespace ts {
4737
4743
if ( functionDeclaration . kind === SyntaxKind . Constructor ) {
4738
4744
// show (constructor) Type(...) signature
4739
4745
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 ) ;
4743
4747
}
4744
4748
else {
4745
4749
// (function/method) symbol(..signature)
0 commit comments