Fork me on GitHub
#cursive
<
2018-07-05
>
p-himik10:07:09

Is it possible to show a function parameters info (`ctrl+p`) for functions used in vectors? Like [table row1 row2 ...]. Would be incredibly useful for Reagent and the like. Another thing - many libraries appear to define a bunch of functions in some namespaces and then write (def some-fn some-ns/some-fn) in core.clj[s]. Cursive doesn't show function parameters info when some-lib.core/some-fn is used in this case.

adam15:07:12

Hi. How can I load profiles.clj into CURSIVE REPL? My profiles.clj file starts with: {:dev {:env {:env-name. I need to load it in CURSIVE REPL in order for me to be able to use (:env-name env) in my REPL testing. My ns declaration include: (:require [environ.core :refer [env]]

manutter5115:07:59

Hi @somedude314 I saw you posted this in #beginners first, so I assume you’re just getting started with this?

adam15:07:45

@manutter51 yes but working on a pretty complex system in Clojure already!

manutter5115:07:35

You shouldn’t need to load profiles.clj into your REPL for this. If you’re requiring [environ.core :refer [env]] then (:env-name env) should work for you (if other stuff is set up correctly)

manutter5115:07:02

but there’s a trick to using environ, hang on while I refresh my memory

manutter5115:07:10

Heh, plus I always confuse profiles.clj with project.clj, which doesn’t help 😉

manutter5115:07:33

Anyway, in your project.clj file, do you have the lein-environ plugin added?

manutter5115:07:56

or boot-environ if you’re using boot?

manutter5115:07:59

Actually, I’m remembering a Cursive-specific trick that can come in handy

manutter5115:07:10

Yeah, there it is: In your Run/Debug Configurations window, click the REPL you want to configure, then look at the Environment field in the “Common Options” section. You can click the “…” button and add “environment variables” that environ can read. So you can set up :env-name or whatever, and when you start your repl, you can grab it from env

manutter5115:07:46

I like to use it for things like db credentials, so I don’t have to mess with profiles.clj and keeping all that stuff straight.

adam16:07:52

@manutter51 thanks for the pointers. I will try adding it via the configs and if that doesn't work I will try lein-environ.

amann21:07:56

Has anyone played around with HugSQL before? https://github.com/layerware/hugsql It has a form where you do (def-db-fns "queries.hug.sql"). queries.hug.sql is a separate file on the filepath. The def-db-fns generates a tonne of functions and dumps them in the current ns. My question is whether folks have a workaround to get cursive to recognize/generate those stubs/fns on its own, or if a smattering of (declare my-db-fn-x) etc. is the best path forward