This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-15
Channels
- # announcements (1)
- # babashka (1)
- # beginners (43)
- # cider (2)
- # clj-kondo (29)
- # clojure (61)
- # clojure-austin (18)
- # clojure-dev (7)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (5)
- # clojuredesign-podcast (8)
- # cloverage (1)
- # conjure (1)
- # data-science (1)
- # datahike (36)
- # datavis (1)
- # datomic (23)
- # emacs (14)
- # hyperfiddle (28)
- # lsp (5)
- # missionary (1)
- # music (1)
- # off-topic (11)
- # re-frame (11)
- # reitit (5)
- # releases (1)
- # shadow-cljs (65)
- # spacemacs (13)
- # squint (33)
- # tools-deps (56)
With re-frame I can go to the definition (the reg-…
) of an event or subscription keyword. What would be involved to get that to work for other things? I have a function where I set up event handlers for dumdom and would like clojure-lsp to quickly take me there from any dispatch of those events. Is there some special treatment for re-frame in clojure-lsp?
yes, that was a feature we added to clj-kondo to allow these kind of thing and we supported re-frame as built-in, but I think it should work for other features if you have a custom hook or something, let me find it
that happens when a clj-kondo analysis element has a :reg
https://github.com/clojure-lsp/clojure-lsp/blob/161c9c80b09d1d209120d09b4cee5b160f433171/lib/src/clojure_lsp/kondo.clj#L132
example:
(require '[re-frame.core :as re-frame])
(re-frame/reg-sub ::foo (fn [_]))
{:ns my-ns,
:name "foo",
:auto-resolved true,
:from my-ns,
:context {:re-frame.core {:in-id "4", :id "4", :var "reg-sub"}},
:reg re-frame.core/reg-sub,
:uri "...",
:bucket :keyword-definitions}
@U0ETXRFEW I think that may work if you use https://github.com/ericdallo/clj-kondo/blob/6bca0676674ae784ba487dea150b63567e2b6b2a/src/clj_kondo/impl/hooks.clj#L54 clj-kondo reg-keyword!
hook function in a hook for your macro
Thanks, @UKFSJSM38! 🙏 I’ll try this and see where it gets me.