Fork me on GitHub
#cursive
<
2021-05-25
>
helios12:05:56

@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

cfleming21:05:40

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

👍 3
cfleming21:05:55

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.

d5p22:05:39

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/

cfleming22:05:06

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

d5p23:05:21

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

Jeff Evans13:05:39

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

Jakub Holý (HolyJak)16:05:12

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?

3
alex-eberts16:05:11

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.

👍 3
thheller16:05:39

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

❤️ 3
Jakub Holý (HolyJak)16:05:44

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ý (HolyJak)16:05:56

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.

Jakub Holý (HolyJak)16:05:59

Mystery solved, kind of. Pathom was not on the classpath (somehow, shadow-cljs did not complain about it and compiled the ns anyway.)

thheller16:05:49

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

Jakub Holý (HolyJak)18:05:30

Ah, that explains it. Thank you!

Jakub Holý (HolyJak)16:05:59

Mystery solved, kind of. Pathom was not on the classpath (somehow, shadow-cljs did not complain about it and compiled the ns anyway.)

markaddleman17:05:06

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

cfleming21:05:24

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

borkdude09:05:03

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

borkdude09:05:34

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

markaddleman15:05:53

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

markaddleman16:05:31

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

cfleming21:05:38

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?

borkdude21:05:06

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

borkdude21:05:27

But Cursive also emits syntax warnings on its own.

borkdude21:05:37

And these are not informed by any clj-kondo configuration

borkdude21:05:02

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

cfleming21:05:28

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?

borkdude21:05:21

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.

cfleming21:05:11

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

borkdude21:05:08

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.

cfleming21:05:16

Ah, ok, yes, that should be easy.

zZMathSP20:05:09

Can anyone help me with repl in intellij using wsl?

folcon09:05:55

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 😃...