feat(language-service): improve non-callable error message (#35271)

This commit improves the context of a non-callable function error
message by providing the affected call target and its non-callable type.

PR Close #35271
This commit is contained in:
ayazhafiz
2020-02-09 12:29:45 -08:00
committed by Andrew Kushnir
parent 168a393589
commit acc483e2eb
11 changed files with 74 additions and 36 deletions

View File

@ -492,7 +492,7 @@ class ExpressionVisitor extends NullTemplateVisitor {
visitBoundText(ast: BoundTextAst) {
if (inSpan(this.position, ast.value.sourceSpan)) {
const completions = getExpressionCompletions(
this.getExpressionScope(), ast.value, this.position, this.info.template.query);
this.getExpressionScope(), ast.value, this.position, this.info.template);
if (completions) {
this.addSymbolsToCompletions(completions);
}
@ -501,7 +501,7 @@ class ExpressionVisitor extends NullTemplateVisitor {
private processExpressionCompletions(value: AST) {
const symbols = getExpressionCompletions(
this.getExpressionScope(), value, this.position, this.info.template.query);
this.getExpressionScope(), value, this.position, this.info.template);
if (symbols) {
this.addSymbolsToCompletions(symbols);
}