This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-21
Channels
- # beginners (5)
- # boot (15)
- # capetown (1)
- # chestnut (2)
- # cljs-dev (9)
- # cljsjs (3)
- # cljsrn (1)
- # clojure (190)
- # clojure-brasil (2)
- # clojure-greece (14)
- # clojure-italy (3)
- # clojure-poland (8)
- # clojure-romania (1)
- # clojure-russia (2)
- # clojure-serbia (3)
- # clojure-spec (38)
- # clojure-uk (98)
- # clojure-ukraine (2)
- # clojurescript (65)
- # clojurex (1)
- # core-async (16)
- # cursive (16)
- # datomic (3)
- # defnpodcast (7)
- # emacs (11)
- # funcool (2)
- # hoplon (16)
- # jobs (1)
- # leiningen (4)
- # lumo (9)
- # off-topic (2)
- # om (1)
- # other-languages (1)
- # protorepl (1)
- # re-frame (50)
- # reagent (16)
- # reitit (32)
- # remote-jobs (1)
- # rum (1)
- # shadow-cljs (73)
- # spacemacs (36)
- # specter (21)
- # sql (6)
- # unrepl (107)
- # untangled (4)
@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
(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.
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.