ion-rust
ion-rust copied to clipboard
Add location metadata to Element API
Purpose:
Customers that use Ion Rust’s Element API to manipulate Ion data can benefit from having more precise row-column information regarding the element. This helps identify the exact place of the element and can be useful for error messaging as well as debugging.
Some general usecases:
- Within
ion-schema-rustlibrary for better violation message with location to the Element that generated error in validation and to the schema constraint that was violated. - Use with
ion-clifor schema related subcommands as well as for code generation.
Implementation:
Requires a change in the TextBuffer to have properties for row and column data based on offset and whitespace. This then can be pulled to higher abstraction layers like LazyValue and eventually to Element API. This might require a cargo flag for people to opt-in to this feature.