This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-22
Channels
- # announcements (88)
- # autochrome-github (2)
- # babashka (26)
- # beginners (5)
- # biff (2)
- # cider (73)
- # clj-kondo (4)
- # cljsrn (6)
- # clojure (54)
- # clojure-art (3)
- # clojure-europe (73)
- # clojure-germany (5)
- # clojure-new-zealand (1)
- # clojure-nl (13)
- # clojure-norway (16)
- # clojure-uk (8)
- # clojurescript (73)
- # conjure (1)
- # core-async (10)
- # cursive (17)
- # datahike (51)
- # datalevin (21)
- # datomic (4)
- # emacs (2)
- # events (3)
- # fulcro (35)
- # honeysql (6)
- # introduce-yourself (1)
- # jackdaw (3)
- # jobs (1)
- # leiningen (4)
- # lsp (3)
- # malli (17)
- # off-topic (60)
- # other-languages (5)
- # pathom (17)
- # pedestal (3)
- # polylith (19)
- # portal (2)
- # practicalli (1)
- # rdf (14)
- # reitit (3)
- # releases (1)
- # reveal (9)
- # sci (1)
- # shadow-cljs (26)
- # spacemacs (17)
- # sql (4)
- # testing (10)
- # tools-build (6)
- # tools-deps (16)
- # vim (9)
is there any issue with naming vars starting with a $
sign?
clojure itself doesn't seem to mind it, but cursive underlines them as "no usages found", while others are properly resolved and navigable.
eg, in this snippet:
(def $cfg (-> :local api.env/cfg-rmap valuate! remove-nils (dissoc :ssm/params)))
(def $user-email (=> "" "" ""))
(def $user-ref [:google.user/email $user-email])
(defonce ^{:doc "... service for `$user-ref`"} svc (-> svc/kit (assoc :cfg $cfg) valuate! ...
$cfg
is ok, but both $user-email
and $user-ref
are marked as Unused global declaration
, while $user-ref
is clearly using $user-email
right away on the next line.I’d have to check, but I have a vague recollection that Cursive might treat those as logic variables, with different symbol resolution.
No, I misremembered - that’s only in the context of Clara macros. I’ll try your snippet.
i tried it on 1.12.2-eap5-2022.1
and the problem still persist.
i've narrowed it further down; the symbol has to have a dash in it for the problem to manifest.
eg, this all resolves nicely:
(def user-email 123)
(def qwe user-email)
[qwe]
then i do a rename refactoring on user-email
-> $user-email
and this is what i get:funnily enough, i can navigate from the usage to the definition, but not the other way around. this smells like interference of special-case handling logic with something fundamental about symbol indexing.
Is there any way to resolve vanilla js functions? For example the .preventDefault function of events and others are not recognized at all.
this is tracked here: https://github.com/cursive-ide/cursive/issues/2076
We have a custom CLJS macro called defevent
and I’ve resolved that as defn
. I’m pretty sure I should then be able to do code navigation when calling that macro however it doesn’t seem to work. It worked previously at some point.
Current Plugin Version: 1.12.1-2021.3
Also verified on: 1.12.2-eap5-2021.3
I saw similar behaviour today. What ended up working was getting Cursive resolve the macro as def
, then when it finished indexing, telling it to resolve as defn
again
@U0567Q30W could this have anything to do with the recent config structure change?
huh, thanks for the suggestion @U08BJGV6E!! That worked for me!