cursive

Issues at: https://git.io/cursive-issues
2021-07-01T02:53:05.130100Z

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?

➕ 1
2021-07-01T09:51:08.131400Z

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

2021-07-01T16:32:16.132Z

Thanks, I have tried that and the same problem occurs. What could my problem be?

2021-07-01T18:05:29.134900Z

It doesn’t even recognize defn or let

2021-07-01T18:23:29.135200Z

Refactoring is also fairly broken, do I conclude that Cursive just doesn’t work under shadow-cljs?

2021-07-01T18:30:57.135400Z

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)

2021-07-01T18:32:56.135700Z

here is the official doc https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive

2021-07-01T19:32:36.135900Z

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.

2021-07-01T20:10:09.136200Z

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)

cfleming 2021-07-01T20:59:09.136400Z

@nodename 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?

greg 2021-07-01T21:19:56.136700Z

I had exactly the same problem a while ago, and I gave up on shadowcljs in Cursive. I will check it again soon

2021-07-02T01:04:34.140Z

I deleted the .idea folder and reimported the pom. Things seem to be operating normally now. Thanks all!

🎉 2
Björn Ebbinghaus 2021-07-01T17:46:00.133500Z

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.

thheller 2021-07-01T17:51:31.134100Z

needs to be protocols/tick since it is defined in that ns , same as you used the protocols/Updateable

Björn Ebbinghaus 2021-07-01T17:53:00.134700Z

Thanks. Makes sense.

greg 2021-07-01T21:45:00.139400Z

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))))

imre 2021-07-02T07:41:11.140200Z

you can try resolving ?> as clojure.core/-> as described at https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution

greg 2021-07-02T14:17:34.140700Z

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?

imre 2021-07-02T16:30:04.141100Z

Not sure about that. Perhaps Cursive already knows about those specific macros just failed to look them up yesterday? Only Colin could answer that I suppose

greg 2021-07-01T21:45:28.139500Z