cursive

Issues at: https://git.io/cursive-issues
helios 2021-05-25T12:44:56.027200Z

@cfleming In our main project folder we have a couple of "subprojects" where our babashka code lives. It seems that Cursive doest not remember some folders marked as source. I need to manually "Add to sources" every time (or mark them with the right-click menu). 😞 any hint why? Main clojure stuff works fine

2021-05-25T13:52:39.027300Z

Is it Lein or deps? Either way, those will need to be marked as source roots in the build file.

Jakub Holý 2021-05-25T16:36:12.029900Z

Hi! Is there a problem with requiring cljc from inside a cljs file? In my .cljs I have (:require [com.wsscode.pathom.connect :as pc :refer [defresolver]]) , which is a .cljc file. When I command-click on the ns, I get to a .js file compiled from it. Cursive complains later on in the file that it does not know defresolver . // @alex-eberts You experienced something similar, right?

✅ 1
thheller 2021-05-25T16:42:39.030500Z

sounds like you probably have the output path of your CLJS build on the classpath?

❤️ 1
Jakub Holý 2021-05-25T16:44:44.030600Z

That is correct, I guess resources/public/js/ is on the classpath. Which I actually want, since I use the classpath to serve the JS when requested by the browser.

Jakub Holý 2021-05-25T16:48:56.031300Z

Removing the js output from the classpath results just in Cmd-click on the namespace not doing anything (just telling me "No usages found..."). The referred var still cannot be resolved.

2021-05-25T16:52:11.032Z

I do remember that happening but I just tried command-clicking on a defresolver in a clj namespace and cursive navigated correctly to the definition. :man-shrugging: I’ll keep an eye open for when it happens again.

👍 1
thheller 2021-05-25T16:58:49.032200Z

pathom is always on the classpath since shadow-cljs uses it internally 😉

markaddleman 2021-05-25T17:01:06.033500Z

Any thoughts on incorporating clj-kondo configs into Cursive's syntax understanding? I'm seeing more projects including appropriate kondo configs . I'm hopeful that the kondo konfigs will help cursive link attribute keywords used in Pathom 3

borkdude 2021-05-26T09:27:03.036400Z

it helps in so far that if you integrate clj-kondo linting inside Cursive then people would see the correct warnings

borkdude 2021-05-26T09:27:34.036600Z

but I can imagine this would be a big step and doesn't integrate with the way IntelliJ works

markaddleman 2021-05-26T15:38:53.040100Z

> How would you like this to work? It's a good question. I'm not very familiar with with konfigs - I am assuming there is enough information to determine the "source" of a symbol/keyword and, thus, that would be enough information to wire up Intellij's Find Usages feature.

markaddleman 2021-05-26T16:54:31.040500Z

> but I can imagine this would be a big step and doesn't integrate with the way IntelliJ works Thanks. I guess it was more wishful thinking than anything else 🙂

cfleming 2021-05-26T21:05:38.040800Z

I still don’t quite understand. As I understand it, the clj-kondo integration should show the warnings in the editor already, right? And when there’s a warning in the editor, you should be able to use the normal Cursive find usages feature at that point?

borkdude 2021-05-26T21:07:06.041Z

> As I understand it, the clj-kondo integration should show the warnings in the editor already, right? This is correct. The other point seems logical too.

borkdude 2021-05-26T21:07:27.041200Z

But Cursive also emits syntax warnings on its own.

borkdude 2021-05-26T21:07:37.041400Z

And these are not informed by any clj-kondo configuration

borkdude 2021-05-26T21:08:02.041600Z

And that was what the question was about: could clj-kondo configuration inform Cursive's own understanding of the syntax, somehow

cfleming 2021-05-26T21:09:28.041800Z

So is the proposal to control the IntelliJ inspections via the clj-kondo config, i.e. enable and disable the roughly equivalent inspections based on the config? Or to somehow use the clj-kondo analysis results?

borkdude 2021-05-26T21:11:21.042Z

I don't think anyone has made a proposal, Mark was just asking about thoughts. I don't have any thoughts on this, but I would be open to help you out with something, if you needed it from the clj-kondo side.

cfleming 2021-05-26T21:13:11.042300Z

Ok, I’ll wait and see what Mark suggests. I’d be interested to know what the issue around attribute keywords is, for example.

borkdude 2021-05-26T21:16:08.042500Z

Well, the config for pathom3 is pretty basic: https://github.com/wilkerlucio/pathom3/blob/master/resources/clj-kondo.exports/com.wsscode/pathom3/config.edn I think the same can be accomplished in Cursive with "resolve macro as" if I remember correctly.

cfleming 2021-05-26T21:17:16.042900Z

Ah, ok, yes, that should be easy.

Jakub Holý 2021-05-25T18:34:30.033600Z

Ah, that explains it. Thank you!

Matheus Silva 2021-05-25T20:00:09.034600Z

Can anyone help me with repl in intellij using wsl?

2021-05-26T09:29:55.036800Z

What issue are you having? You need to have ports open, but what I've found useful to do is just use repl within wsl, so for example lein repl then connect to the nrepl port from cursive using the remote repl option 😃...

Matheus Silva 2021-05-26T11:18:54.037Z

thanks!!

1
cfleming 2021-05-25T21:33:40.034700Z

@helios As @jeffrey.wayne.evans said, these will have to be configured in your project.clj or deps.edn file, otherwise Cursive will un-mark them on every sync.

👍 1
cfleming 2021-05-25T21:35:55.034900Z

If you don’t want them added by default, you could have the paths in an alias/profile, and just use that when syncing with Cursive.

cfleming 2021-05-25T21:52:24.035100Z

How would you like this to work? I’m not sure how Cursive would use these.

2021-05-25T22:35:39.035300Z

I have a similar problem with a project set up similar to ring - a parent project using lein sub with a series of subprojects , used to all load and resolve fine in cursive but last few versions it never remembers/sets the source roots, and gets confused with the checkouts/

cfleming 2021-05-25T22:40:06.035500Z

@d5p Is your project something I can look at, or are you able to set up a simple test repo in a similar config?

2021-05-25T23:26:21.035700Z

you can see the behaviour with the main ring project (i.e just check out https://github.com/ring-clojure/ring and open up the top level project) , my project is configured identically with lein sub and a series of sub projects