Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap arrays using an hov box only if they contain only simple elements. #142

Merged
merged 3 commits into from
Jun 8, 2022

Conversation

mjambon
Copy link
Member

@mjambon mjambon commented Jun 7, 2022

This produces a similar output to yojson < 2. See the expected test output.

This is a follow-up to #141 (comment)

This produces a similar output as to the earlier behavior from when
easy-format was being used (yojson < 2).
@mjambon mjambon mentioned this pull request Jun 7, 2022
Copy link
Member

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and definitely an improvement, thanks for contributing!

While looking through the expected value, I ran into an odd case, where I think the code formats incorrectly, the trailing ] of a non-atom that's inside a box seems misplaced.

test/pretty/atd.expected.json Outdated Show resolved Hide resolved
@Leonidas-from-XIV Leonidas-from-XIV merged commit 009a0a8 into master Jun 8, 2022
@Leonidas-from-XIV Leonidas-from-XIV deleted the mj-wrap-only-atom-arrays branch June 8, 2022 08:50
@Leonidas-from-XIV
Copy link
Member

Excellent, thanks for the fix! It makes the output look much better.

Leonidas-from-XIV added a commit to Leonidas-from-XIV/opam-repository that referenced this pull request Jun 28, 2022
CHANGES:

*2022-06-28*

### Fixed

- Fix pretty-printing behavior for lists/objects inside lists (@c-cube
  ocaml-community/yojson#141, @mjambon ocaml-community/yojson#142)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants