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.
This commit is contained in:
Chuck Jazdzewski
2017-04-14 15:28:27 -07:00
committed by Miško Hevery
parent 88b2ab09ea
commit eff6216319

View File

@ -807,10 +807,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; }