This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-27
Channels
- # babashka (45)
- # beginners (44)
- # calva (3)
- # cider (14)
- # clara (4)
- # clj-commons (3)
- # clj-otel (4)
- # cljsjs (1)
- # cljsrn (111)
- # clojars (5)
- # clojure (62)
- # clojure-europe (14)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (31)
- # community-development (16)
- # conjure (7)
- # cursive (9)
- # data-science (1)
- # datalevin (10)
- # docker (1)
- # emacs (20)
- # fulcro (7)
- # helix (10)
- # jobs (4)
- # lsp (22)
- # malli (35)
- # meander (12)
- # music (1)
- # nbb (2)
- # off-topic (5)
- # pathom (3)
- # quil (1)
- # re-frame (12)
- # react (6)
- # reagent (18)
- # releases (1)
- # remote-jobs (1)
- # rewrite-clj (4)
- # ring (1)
- # shadow-cljs (10)
- # spacemacs (9)
- # tools-build (17)
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 :thumbsup: 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