Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
visitBoundText: function (ast) {
var expressionPosition = templatePosition - ast.sourceSpan.start.offset;
if (utils_1.inSpan(expressionPosition, ast.value.span)) {
var dinfo = utils_1.diagnosticInfoFromTemplateInfo(info);
var scope = language_services_1.getExpressionScope(dinfo, path, /* includeEvent */ false);
var result = expressions_1.getExpressionSymbol(scope, ast.value, expressionPosition, info.template.query);
if (result) {
symbol_1 = result.symbol;
span_1 = utils_1.offsetSpan(result.span, ast.sourceSpan.start.offset);
}
}
},
visitText: function (ast) { },
var binding = bindings.find(function (binding) { return utils_1.inSpan(valueRelativePosition_1, binding.span, /* exclusive */ true); }) ||
bindings.find(function (binding) { return utils_1.inSpan(valueRelativePosition_1, binding.span); });
visitAttribute: function (ast) {
if (!ast.valueSpan || !utils_1.inSpan(templatePosition_1, utils_1.spanOf(ast.valueSpan))) {
// We are in the name of an attribute. Show attribute completions.
result = attributeCompletions(templateInfo, path_1);
}
else if (ast.valueSpan && utils_1.inSpan(templatePosition_1, utils_1.spanOf(ast.valueSpan))) {
result = attributeValueCompletions(templateInfo, templatePosition_1, ast);
}
},
visitText: function (ast) {
var directiveMetadata = selectorInfo.map.get(selector_1);
if (directiveMetadata) {
var contextTable = this.info.template.query.getTemplateContext(directiveMetadata.type.reference);
if (contextTable) {
this.result = this.symbolsToCompletions(contextTable.values());
}
}
}
else if (binding.key && valueRelativePosition_1 <= (binding.key.length - key_1.length)) {
keyCompletions();
}
}
else {
// If the position is in the expression or after the key or there is no key, return the
// expression completions
if ((binding.expression && utils_1.inSpan(valueRelativePosition_1, binding.expression.ast.span)) ||
(binding.key &&
valueRelativePosition_1 > binding.span.start + (binding.key.length - key_1.length)) ||
!binding.key) {
var span = new compiler_1.ParseSpan(0, this.attr.value.length);
this.attributeValueCompletions(binding.expression ? binding.expression.ast :
new compiler_1.PropertyRead(span, new compiler_1.ImplicitReceiver(span), ''), valueRelativePosition_1);
}
else {
keyCompletions();
}
}
}
};
ExpressionVisitor.prototype.visitBoundText = function (ast) {
ExpressionVisitor.prototype.visitBoundText = function (ast) {
var expressionPosition = this.position - ast.sourceSpan.start.offset;
if (utils_1.inSpan(expressionPosition, ast.value.span)) {
var completions = expressions_1.getExpressionCompletions(this.getExpressionScope(), ast.value, expressionPosition, this.info.template.query);
if (completions) {
this.result = this.symbolsToCompletions(completions);
}
}
};
ExpressionVisitor.prototype.attributeValueCompletions = function (value, position) {
bindings.find(function (binding) { return utils_1.inSpan(valueRelativePosition_1, binding.span); });
var keyCompletions = function () {
class_1.prototype.visit = function (ast) {
if ((!excludeEmpty || ast.span.start < ast.span.end) && utils_1.inSpan(position, ast.span)) {
path.push(ast);
compiler_1.visitAstChildren(ast, this);
}
};
return class_1;