feat(language-service): provide completion for $event variable (#34566)
This commit adds a completion for the `$event` variable in bound event expressions. This is the first in a series of PRs to support completions for properties on `$event` variables (https://github.com/angular/vscode-ng-language-service/issues/531). PR Close #34566
This commit is contained in:
@ -308,7 +308,7 @@ function attributeValueCompletions(info: AstResult, htmlPath: HtmlAstPath): ng.C
|
||||
const templatePath = findTemplateAstAt(info.templateAst, htmlPath.position);
|
||||
const visitor = new ExpressionVisitor(info, htmlPath.position, () => {
|
||||
const dinfo = diagnosticInfoFromTemplateInfo(info);
|
||||
return getExpressionScope(dinfo, templatePath, false);
|
||||
return getExpressionScope(dinfo, templatePath);
|
||||
});
|
||||
if (templatePath.tail instanceof AttrAst ||
|
||||
templatePath.tail instanceof BoundElementPropertyAst ||
|
||||
@ -398,8 +398,7 @@ function interpolationCompletions(info: AstResult, position: number): ng.Complet
|
||||
return [];
|
||||
}
|
||||
const visitor = new ExpressionVisitor(
|
||||
info, position,
|
||||
() => getExpressionScope(diagnosticInfoFromTemplateInfo(info), templatePath, false));
|
||||
info, position, () => getExpressionScope(diagnosticInfoFromTemplateInfo(info), templatePath));
|
||||
templatePath.tail.visit(visitor, null);
|
||||
return visitor.results;
|
||||
}
|
||||
|
Reference in New Issue
Block a user