Fork me on GitHub
#cursive
<
2017-12-14
>
grzm21:12:54

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.

cfleming21:12:35

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

joelsanchez21:12:23

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

grzm21:12:11

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

grzm21:12:41

Tests from the command line run as expected, btw.

cfleming21:12:22

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

cfleming21:12:18

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

joelsanchez21:12:15

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

cfleming21:12:52

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

grzm22:12:43

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!

kenny23:12:49

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

cfleming23:12:31

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

kenny23:12:46

Sure. It's pretty nasty though.

cfleming23:12:04

I’m sitting down.

kenny23:12:02

Haha. Getting a NPE pointing to this line: https://github.com/fzakaria/slf4j-timbre/blob/master/src/slf4j_timbre/adapter.clj#L126. I'd really like to be able to expand that macro to see where exactly the NPE is occurring.

kenny23:12:40

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