Fork me on GitHub

@cfleming I hadn't tried generating them yet. My understanding (which may be incorrect) was that the message occurred when you were calling functions in namespaces that Cursive didn't 'know' about, and therefore assume you needed stub functions generating to fill in later. In my case the lib is downloaded and working when I compile the code, so I thought asking Cursive to generate the stubs would be the wrong thing to do, because it should be able to find the lib already


@carr0t No, that’s incorrect. Here’s what this does.


(I actually need to document this correctly, so I’ll try to explain here then use this as the basis for the doc)


Cursive works using static analysis, not runtime introspection like most other Clojure tools do. However not all libs are amenable to this. The most obvious example is Datomic, which is closed source so Cursive can’t analyse it at all.


But a lot of other libraries generate vars using various sorts of tricks - some are just a pain to analyse, and some (e.g. Midje, Overtone) use macros so heavily that analysing them is basically impossible.


Aah yes, I had noticed it had issues with macros


For these sorts of libraries, runtime introspection works better, so what Cursive will do is start a process with the runtime of the module, load the namespaces that it can’t analyse correctly and then introspect it to generate “stub” source files which it can analyse.


That only has to be done once, then those files can be used from then on (or until e.g. the library version is upgraded).


It’s not a perfect solution, and more complete macro support is coming, but it helps a lot with some important libs, particularly Datomic.


So hopefully, you should just be able to tell Cursive to generate the stubs, and it will stop bothering you.


Currently the list of namespaces to do this for is hard-coded, but it will be configurable at some point.


@carr0t Does that help?


It does, thank you. (Sorry, we had standup)


Where are you based, btw? I'm in the UK, so it's coming up to 11am here. I assumed you were US based, but had no evidence for that


No worries - I’m in New Zealand, so it’s way past my bedtime 🙂