fix(language-service): look for type constructors on canonical symbol

This commit is contained in:
Chuck Jazdzewski 2017-04-14 09:48:32 -07:00 committed by Tobias Bosch
parent 0a3a9afe58
commit 2ddf3bcdd1
1 changed files with 3 additions and 2 deletions

View File

@ -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) {