json: include NameRange and ExprRange in returned attributes
This commit is contained in:
parent
d2c9089812
commit
8883fb76ce
@ -65,9 +65,11 @@ func (b *body) PartialContent(schema *zcl.BodySchema) (*zcl.BodyContent, zcl.Bod
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
content.Attributes[attrS.Name] = &zcl.Attribute{
|
content.Attributes[attrS.Name] = &zcl.Attribute{
|
||||||
Name: attrS.Name,
|
Name: attrS.Name,
|
||||||
Expr: &expression{src: jsonAttr.Value},
|
Expr: &expression{src: jsonAttr.Value},
|
||||||
Range: zcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()),
|
Range: zcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()),
|
||||||
|
NameRange: jsonAttr.NameRange,
|
||||||
|
ExprRange: jsonAttr.Value.Range(),
|
||||||
}
|
}
|
||||||
usedNames[attrS.Name] = struct{}{}
|
usedNames[attrS.Name] = struct{}{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user