From 5a88d2f68bbcafac60c3783aa6b1e0d956f0a1bf Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Fri, 14 Apr 2017 15:28:27 -0700 Subject: [PATCH] fix(language-service): only use canonical symbols Language service was treating some alias TypeScript symbols as if they where the canonical symbol. If the symbol in scope is an alias of another symbol the symbol should be converted to the canonical symbol. --- packages/language-service/src/typescript_host.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/language-service/src/typescript_host.ts b/packages/language-service/src/typescript_host.ts index 84344ce630..aae10dd75c 100644 --- a/packages/language-service/src/typescript_host.ts +++ b/packages/language-service/src/typescript_host.ts @@ -811,10 +811,15 @@ class TypeWrapper implements Symbol { } class SymbolWrapper implements Symbol { + private symbol: ts.Symbol; private _tsType: ts.Type; private _members: SymbolTable; - constructor(private symbol: ts.Symbol, private context: TypeContext) {} + constructor(symbol: ts.Symbol, private context: TypeContext) { + this.symbol = symbol && context && (symbol.flags & ts.SymbolFlags.Alias) ? + context.checker.getAliasedSymbol(symbol) : + symbol; + } get name(): string { return this.symbol.name; }