This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-01
Channels
- # announcements (53)
- # babashka (27)
- # beginners (103)
- # biff (1)
- # calva (21)
- # cider (5)
- # circleci (12)
- # clj-kondo (7)
- # cljfx (3)
- # cljsrn (9)
- # clojure (25)
- # clojure-europe (21)
- # clojure-nl (1)
- # clojure-uk (21)
- # clojured (1)
- # clojurescript (49)
- # cursive (20)
- # datomic (33)
- # events (3)
- # fulcro (39)
- # graalvm (20)
- # graphql (2)
- # introduce-yourself (1)
- # jobs (14)
- # keechma (3)
- # lsp (34)
- # malli (18)
- # meander (15)
- # off-topic (30)
- # polylith (10)
- # re-frame (21)
- # releases (2)
- # remote-jobs (5)
- # sci (10)
- # shadow-cljs (16)
- # tools-deps (2)
- # vim (6)
I’ve joined a project in which the app is built using shadow-cljs. I use Cursive as my IDE. I’ve created a pom with the shadow-cljs pom
command, AND I’ve copied its dependencies into a project.clj file. I thought this would make the requires in the source files resolve, but it seems not to have happened.
For example in (:require [reagent.core :as r]
I hover and get ‘r cannot be resolved’. Is there anything I can do to fix this?
you shouldn’t create a project.clj, shadow-cljs pom
generates a maven file for you (pom.xml), so you should then import / open your repo as a maven project instead
Refactoring is also fairly broken, do I conclude that Cursive just doesn’t work under shadow-cljs?
it works for me, and I did what I’ve said you :thinking_face: (+ I’ve setup a java sdk for the project as usual)
here is the official doc https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive
Yes I’ve seen that, and as I said I’ve tried it. That failure is what led me to think creating a project.clj might help.
If it is a intellij/cursive problem, you may try to delete the .idea folder and reimport the project as a maven one. Also in intellij you have a menu “file > invalidate caches” which have resolved similar problems for me in the past (clojure syntax not recognized)
@U04V91K02 If you open the Maven toolwindow, do you see your pom registered there? If not, do things start working if you add it there using the +
button?
I had exactly the same problem a while ago, and I gave up on shadowcljs in Cursive. I will check it again soon
I deleted the .idea folder and reimported the pom. Things seem to be operating normally now. Thanks all!
I get an unresolved symbol when calling a function defined in a protocol in another namespace. If I pull the protocol into the same ns, the symbol gets resolved.
needs to be protocols/tick
since it is defined in that ns , same as you used the protocols/Updateable
Thanks. Makes sense.
I noticed that Cursive highlights incorrectly the code when using https://github.com/plumatic/plumbing conditional threading macros (like https://github.com/plumatic/plumbing/blob/6d713472f7324344545aa93597cb2a137b3404b3/src/plumbing/core.cljx#L308> , https://github.com/plumatic/plumbing/blob/6d713472f7324344545aa93597cb2a137b3404b3/src/plumbing/core.cljx#L301>>). Is there a way to handle it? Example:
(let [assoc-please (fn [r] (assoc r :b :B))]
(-> {}
(?> false (assoc :a :A))
(?> true (assoc-please))))
you can try resolving ?>
as clojure.core/->
as described at https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution
Right, I forgot about this feature. Thanks. I will do it next time. Strange thing is that today I opened the IDE and these macros are no longer highlighted as yesterday. The highlighting works as I would expect (I wrote some incorrect forms to validate it). And these macros (?>, ?>>) are not added in the 'Symbol Resolution' mapping in the Preferences. How to explain that? Is the Cursive resolving macros to figure out correct highlighting?