hello, I'm trying to use rewrite-clj to analyse some code, I start from clj-kondo analysis info which contains row and col of what I need, how can I navigate to something on rewrite-clj based on row/col?
@wilkerlucio rewrite-clj provides find-last-by-pos which lets you seek to a node if you know its position. There are some caveats to using that function. It only works if you have a :track-position? zipper. And it can be slow, especially if you’re working in large files. See this https://github.com/clj-commons/rewrite-clj/issues/171 for some alternative code that works around both of those problems. Feel free to 👍 that issue if you’d like to see it worked on ;).
@wilkerlucio using zippers. see e.g. carve which does something like that:
https://github.com/borkdude/carve/blob/df552797a198b6701fb2d92390fce7c59205ea77/src/carve/impl.clj#L111
thanks! checking it out