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 Tobias Bosch
parent 7165eb15bd
commit 5a88d2f68b
1 changed files with 6 additions and 1 deletions

View File

@ -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; }