rewrite-clj

https://github.com/clj-commons/rewrite-clj
2020-12-10T01:18:53.185500Z

oh, this '#:foo{x 1 :bar/y 2} is not something i'd seen before

2020-12-10T01:19:32.186200Z

@lee may be you know, but one thing i do is to use read-string so for this current case i did:

user=> (read-string "'#:user{x 1}")
(quote #:user{x 1})

2020-12-10T01:20:14.186800Z

luckily, i think tree-sitter-clojure handles this case appropriately

lread 2020-12-10T12:32:13.193300Z

Ya that’s a good way to verify reader behavior @sogaiu! Great point! I’m a bit surprised that I missed this detail after referring to CLJ-1910 so many times, but am so appreciating the benefits of the community in its continuous sharing, learning and improving!

❤️ 1
borkdude 2020-12-10T12:33:18.193900Z

@lee fwiw, I fixed it in clj-kondo. hopefully the "real" rewrite-cljc solution/record/fix isn't too different

borkdude 2020-12-10T12:34:13.194800Z

in the deps.edn analyzer I had to make a special check for namespaced maps, when taking all the keys or vals from a rewrite-clj map, since children are organized differently / more nested in a namespace map.

lread 2020-12-10T12:43:11.200Z

Ya @borkdude, I already roughed something in yesterday in my branch. To support sexpr properly on map key nodes, even when navigating down to the key node itself, I am currently applying namespaced map context to the key node. This was previously only for keyword nodes but now also for symbol nodes. Still thinking on this approach.