Fork me on GitHub
#rewrite-clj
<
2020-12-10
>
sogaiu01:12:53

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

sogaiu01:12:32

@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})

sogaiu01:12:14

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

lread12:12:13

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!

❤️ 3
borkdude12:12:18

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

borkdude12:12:13

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.

lread12:12:11

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.