borkdude / rewrite-edn

Utility lib on top of rewrite-clj with common operations to update EDN while preserving whitespace and comments.
Eclipse Public License 1.0
84 stars 14 forks source link

Repeated assoc-in, assoc no longer throw NPE #23

Closed lread closed 1 year ago

lread commented 1 year ago

Also checked update and update-in, they were unaffected because they do not currently attempt any indentation for new items.

Note, I renamed "0.3.0" header in changelog to "Unreleased" because there is no 0.3.0 yet as far as I can tell.

Closes #19

borkdude commented 1 year ago

@lread I like where this is going, but perhaps we can prevent the roundtrip to fix metadata like so:

When returning a node, we can mark it as needing metadata location fixing. On an incoming node, we can then check if we need to fix locations and do it only when necessary.

lread commented 1 year ago

Yeah, sounds good, can do!

borkdude commented 1 year ago

Looks great!