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 attributeValueSymbol_1 = function (ast, inEvent) {
if (inEvent === void 0) { inEvent = false; }
var attribute = findAttribute(info);
if (attribute) {
if (utils_1.inSpan(templatePosition, utils_1.spanOf(attribute.valueSpan))) {
var dinfo = utils_1.diagnosticInfoFromTemplateInfo(info);
var scope = language_services_1.getExpressionScope(dinfo, path, inEvent);
if (attribute.valueSpan) {
var expressionOffset = attribute.valueSpan.start.offset + 1;
var result = expressions_1.getExpressionSymbol(scope, ast, templatePosition - expressionOffset, info.template.query);
if (result) {
symbol_1 = result.symbol;
span_1 = utils_1.offsetSpan(result.span, expressionOffset);
}
}
return true;
}
}
return false;
};
path.tail.visit({
results.push.apply(results, tslib_1.__spread(ast.parseErrors.map(function (e) { return ({
kind: types_1.DiagnosticKind.Error,
span: utils_1.offsetSpan(utils_1.spanOf(e.span), template.span.start),
message: e.msg
}); })));
}
}
},
visitText: function (ast) { },
visitDirective: function (ast) {
symbol_1 = info.template.query.getTypeSymbol(ast.directive.type.reference);
span_1 = utils_1.spanOf(ast);
},
visitDirectiveProperty: function (ast) {
if (!attributeValueSymbol_1(ast.value)) {
symbol_1 = findInputBinding(info, path, ast);
span_1 = utils_1.spanOf(ast);
}
}
}, null);
if (symbol_1 && span_1) {
return { symbol: symbol_1, span: utils_1.offsetSpan(span_1, info.template.span.start) };
}
}
}
exports.locateSymbol = locateSymbol;