Skip to content

inspect doesn't write delimiting commas after nested containers #17

@zslayton

Description

@zslayton

When stepping out of a container, ion beta inspect will print the appropriate closing delimiter. (] for lists, ) for s-expressions, } for structs.) However, if that container is nested, it should also print a delimiting , if the parent container is a list or struct.

This screenshot demonstrates the incorrect behavior:

image

Reproducing the command here for copy/pasting:

 echo '{foo:[{bar: a}, {bar: b}, {bar: c}]}' | ion dump --format binary | cargo run -- beta inspect

This isn't currently trivial to fix. Ideally, the reader would expose a method that allows applications to query for its current context. Something like:

fn parent_type(&self) -> Option<IonType>;

that would return None at the top level and Some(container_type) at any other depth. Absent such an API, the application would need to track the reader's traversal manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions