What
PBasicNode carries a SourceRange for the whole element, but individual bindings do not. PBasicNode.bindings() is a Map<String, NGBindingValue> (name → value), and NGBindingValue has no source position — so there's no way to know where in the template a given binding attribute sits.
Why
A consumer that wants to map a binding back to its exact location in the template source can currently only reveal the whole element. Concretely: Parsley's render heat map now attributes DB queries to the binding that triggered them (e.g. object="$x.y.z" · 240q), and we'd like clicking that binding to reveal the exact attribute in the editor. Today the best we can do is open the element's span.
More generally, per-binding positions would enable precise editor navigation, per-binding error underlining, and tooling that operates at attribute granularity.
Sketch
- Add a
SourceRange to each binding — either by making NGBindingValue carry one, or by changing bindings() to a structure that pairs each name → (value, sourceRange).
- Populate it in the declaration parser where each binding is read.
- Downstream (e.g. Parsley) can then thread the binding range through to reveal the exact attribute.
Priority
Nice-to-have — logging it now to track. Not urgent; the immediate heat-map feature (knowing which binding) already works without it.
What
PBasicNodecarries aSourceRangefor the whole element, but individual bindings do not.PBasicNode.bindings()is aMap<String, NGBindingValue>(name → value), andNGBindingValuehas no source position — so there's no way to know where in the template a given binding attribute sits.Why
A consumer that wants to map a binding back to its exact location in the template source can currently only reveal the whole element. Concretely: Parsley's render heat map now attributes DB queries to the binding that triggered them (e.g.
object="$x.y.z" · 240q), and we'd like clicking that binding to reveal the exact attribute in the editor. Today the best we can do is open the element's span.More generally, per-binding positions would enable precise editor navigation, per-binding error underlining, and tooling that operates at attribute granularity.
Sketch
SourceRangeto each binding — either by makingNGBindingValuecarry one, or by changingbindings()to a structure that pairs eachname → (value, sourceRange).Priority
Nice-to-have — logging it now to track. Not urgent; the immediate heat-map feature (knowing which binding) already works without it.