This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-05
Channels
- # beginners (53)
- # boot (6)
- # braveandtrue (12)
- # cider (50)
- # cljs-dev (24)
- # clojure (60)
- # clojure-finland (1)
- # clojure-ireland (1)
- # clojure-italy (50)
- # clojure-kc (1)
- # clojure-nl (20)
- # clojure-norway (1)
- # clojure-portugal (1)
- # clojure-russia (2)
- # clojure-sanfrancisco (1)
- # clojure-sweden (1)
- # clojure-uk (176)
- # clojurescript (58)
- # cursive (14)
- # datomic (23)
- # emacs (4)
- # events (16)
- # fulcro (35)
- # graphql (48)
- # hyperfiddle (9)
- # jobs (5)
- # mount (4)
- # onyx (13)
- # overtone (1)
- # play-clj (2)
- # re-frame (91)
- # reagent (9)
- # reitit (9)
- # shadow-cljs (102)
- # sql (3)
- # testing (3)
- # tools-deps (3)
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.
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]]
Hi @somedude314 I saw you posted this in #beginners first, so I assume you’re just getting started with this?
@manutter51 yes but working on a pretty complex system in Clojure already!
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)
but there’s a trick to using environ, hang on while I refresh my memory
Heh, plus I always confuse profiles.clj with project.clj, which doesn’t help 😉
Anyway, in your project.clj
file, do you have the lein-environ
plugin added?
or boot-environ
if you’re using boot?
Actually, I’m remembering a Cursive-specific trick that can come in handy
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
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.
@manutter51 thanks for the pointers. I will try adding it via the configs and if that doesn't work I will try lein-environ.
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 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