From 2ddf3bcdd142b7d06c94775332db8ab6c94b09f1 Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Fri, 14 Apr 2017 09:48:32 -0700 Subject: [PATCH] fix(language-service): look for type constructors on canonical symbol --- packages/language-service/src/typescript_host.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/language-service/src/typescript_host.ts b/packages/language-service/src/typescript_host.ts index 7106f69f13..dc5af0b247 100644 --- a/packages/language-service/src/typescript_host.ts +++ b/packages/language-service/src/typescript_host.ts @@ -700,8 +700,9 @@ class TypeScriptSymbolQuery implements SymbolQuery { return spanAt(this.source, line, column); } - private getTemplateRefContextType(type: ts.Symbol): ts.Symbol|undefined { - const constructor = type.members && type.members !['__constructor']; + private getTemplateRefContextType(typeSymbol: ts.Symbol): ts.Symbol|undefined { + const type = this.checker.getTypeOfSymbolAtLocation(typeSymbol, this.source); + const constructor = type.symbol && type.symbol.members && type.symbol.members['__constructor']; if (constructor) { const constructorDeclaration = constructor.declarations ![0] as ts.ConstructorTypeNode; for (const parameter of constructorDeclaration.parameters) {