Fork me on GitHub

I have my test source files in test/server/. Cursive seems to assume my tests are test/. I have set up project.clj as :test {:source-paths ["test/server"]}. What am I missing? I can manually set the appropriate value via Project Structure, but it gets reset every time I re-import project.clj.


@grzm So there, :test is a profile? In that case, open the Leiningen toolwindow and open the “Profiles” tree - these are the profiles that Cursive will use to sync the project information. Select “test” there and refresh your project, and your source folder should be synced.


@cfleming How can I tell Cursive to run a function on REPL startup?


I'm likely missing something. Yes, this is under the :test profile. I check "test" (not "leiningen/test") under the "Profiles" tree, and click the 🔄 button/icon. Am I following what you meant correctly? It does the same thing, revert my "test/server" "test" selection in Project Structure to "test".


Tests from the command line run as expected, btw.


@joelsanchez Cursive doesn’t provide the means to do that, but is it possible to use user.clj for that? That’s just a Clojure thing.


@grzm Hmm, that should work, I think - can you send a screenshot of your lein toolwindow? DM me if you’d prefer.


@cfleming I wanted to execute a function depending on the REPL configuration that I'm running, was just asking, no problem if it's not possible (the most useful case would be calling figwheel-sidecar.repl-api/cljs-repl when I run the REPL configuration for CLJS)


Yeah, a few people have asked for that - I’ll try to add that soon.


Just a follow-up for the record: the issue is that I was using :source-paths instead of :test-paths in my :test profile. Thanks, @cfleming!


Does the Cursive debugger offer any help in debugging code generated by macros in 3rd party libraries?


@kenny Generally, not really, it’s pretty difficult. Can you give an example of what you’re trying?


Sure. It's pretty nasty though.


I’m sitting down.


Haha. Getting a NPE pointing to this line: I'd really like to be able to expand that macro to see where exactly the NPE is occurring.


What makes it especially nasty is that file itself generates a Java class.