cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
2021-02-11T06:03:24.249200Z

I came up with a working PoC for injections using NREPL. Is there a more straight-forward way to accomplish this?

2021-02-11T06:04:24.249800Z

The injection in this case is requiring pprint.

2021-02-11T06:09:42.253Z

The code is easily referenced in a deps.edn alias:

:inject {:extra-deps {waffletower/repl-eval {:local/root "../repl-eval/"}
                      nrepl/nrepl {:mvn/version "0.7.0"}
                      refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"}
                      cider/cider-nrepl {:mvn/version "0.25.1"}}
         :main-opts ["-m" "repl-eval.nrepl"]}
While I could refactor this to instrument variable middleware and injection forms, is there some hook I am missing here? It was much much easier and cleaner to accomplish REPL initialization with leiningen.

bozhidar 2021-02-13T12:40:41.260500Z

I'm assuming by "injection" here you mean "evaluate some code on nREPL startup", right?

1☝️
bozhidar 2021-02-13T12:43:56.260700Z

There's nothing in the existing CLI UI, although it'd be easy to add something like --init or whatever. CIDER itself injects a bit of code via cider-repl-require-repl-utils-code.

1🙇
william 2021-02-11T12:57:58.254800Z

Usually when I write a defn form in emacs, the docstring is rendered in a nicer style (italics, in my case). What should I modify if I want to get that when I use macros that replace the defn form, like >defn from guardrails?