Fork me on GitHub

does cider offer anything equivalent to stub generation in cursive?


I'm not sure what stub generation in cursive is, but based on the name, is this what you are looking for?


> There are still some cases that are impossible for Cursive to analyse the source, for example when vars are dynamically created at runtime, or in cases such as Datomic which are distributed without source at all. For these cases, Cursive supports stub generation. This will run a process and load the problematic namespaces into it, introspect the var metadata and then generate source files containing empty function stubs which it can index for use in the editor.


CIDER doesn't do static analysis, so I don't see what an equivalent would be.


I guess enrich-classpath is vaguely similar, except here we don't have any premade foo-sources.jar to download and display


I'm still confused by this. Clojure queries namespace vars at runtime and does not require static analysis. Thus there is no need for a stub to provide the vars from a namespace, since (ns-vars the-ns) will provide the actual vars


the actual reason for asking about this feature is simple: I want to see the function/var docstrings in emacs.


CIDER should 100% be able to do this with no extra tooling or stub generation


CIDER just queries the runtime for the information. As long as those namespaces are loaded it should work


ah, interesting. I'll admit, I'm not always certain what functionality in emacs is provided by cider and what comes from other packages (e.g. clojure-lsp).


they both will provide this functionality, but with two different philosophies. CIDER requires a running repl and queries the runtime for information. In Clojure this is surprisingly sufficient. Clojure-lsp (and Cursive) use static analysis and do not require a running repl. This has benefits, but has the downside that if the source is obfuscated (eg, Datomic) it has nothing to reason about and cannot offer any information


(-> #'+ meta :doc) should be enlightening :) that's basically what CIDER does