fix(language-service): function.bind() should not be an error (#34041)

When performing diagnostic checks or completions, we should take into
account members and properties in the base class, if any. Otherwise, the
language service will produce a false error.

PR closes https://github.com/angular/vscode-ng-language-service/issues/93

PR Close #34041
This commit is contained in:
Keen Yee Liau
2019-11-25 14:23:32 -08:00
committed by Matias Niemelä
parent d25de63ac8
commit 7cd16b9e2c
2 changed files with 13 additions and 1 deletions

View File

@ -271,7 +271,11 @@ class TypeWrapper implements Symbol {
}
members(): SymbolTable {
return new SymbolTableWrapper(this.tsType.getProperties(), this.context);
// Should call getApparentProperties() instead of getProperties() because
// the former includes properties on the base class whereas the latter does
// not. This provides properties like .bind(), .call(), .apply(), etc for
// functions.
return new SymbolTableWrapper(this.tsType.getApparentProperties(), this.context);
}
signatures(): Signature[] { return signaturesOf(this.tsType, this.context); }