A collection of nREPL middleware designed to enhance CIDER.
Use the convenient plugin for defaults, either in your project's
project.clj
file or in the :user
profile in
~/.lein/profiles.clj
.
:plugins [[cider/cider-nrepl "0.7.0-SNAPSHOT"]]
A minimal profiles.clj
for CIDER would be:
{:user {:plugins [[cider/cider-nrepl "0.7.0-SNAPSHOT"]]}}
Or (if you know what you're doing) add cider-nrepl
to your :dev :dependencies
vector plus specific
middleware to to :nrepl-middleware
under :repl-options
.
:dependencies [[cider/cider-nrepl "0.7.0-SNAPSHOT"]]
:repl-options {:nrepl-middleware
[cider.nrepl.middleware.classpath/wrap-classpath
cider.nrepl.middleware.complete/wrap-complete
cider.nrepl.middleware.info/wrap-info
cider.nrepl.middleware.inspect/wrap-inspect
cider.nrepl.middleware.macroexpand/wrap-macroexpand
cider.nrepl.middleware.stacktrace/wrap-stacktrace
cider.nrepl.middleware.trace/wrap-trace]}
Note that you should use a cider-nrepl
version compatible with your CIDER. Generally, if you're
using CIDER 0.x.y you should be using cider-nrepl
0.x.y, if you're using CIDER 0.x.y-SNAPSHOT, you should be
using cider-nrepl
0.x.y-SNAPSHOT, etc.
If you're embedding nREPL in your application you'll have to start the server with CIDER's own nREPL handler.
(ns my-app
(:require [clojure.tools.nrepl.server :as nrepl-server]
[cider.nrepl :refer (cider-nrepl-handler)]))
(defn -main
[]
(nrepl-server/start-server :port 7888 :handler cider-nrepl-handler))
Using the advanced features of the info
middleware with WildFly/Immutant
requires a tweek, since JBoss modules prevent modifications to AppClassLoader
(usually the highest modifiable classloader) from being seen by application
code. To work around this, run the following code from within your
WildFly/Immutant container to mark that classloader as unmodifiable, and cause
the lower level clojure.lang.DynamicClassLoader
to be used instead. This code
must execute prior to loading the cider-nrepl
middleware.
(require '[dynapath.dynamic-classpath :as cp])
(extend sun.misc.Launcher$AppClassLoader
cp/DynamicClasspath
(assoc cp/base-readable-addable-classpath
:classpath-urls #(seq (.getURLs %))
:can-add? (constantly false)))
Middleware | Op(s) | Description |
---|---|---|
wrap-apropos |
apropos |
Pattern search for symbols and documentation. |
wrap-classpath |
classpath |
Java classpath. |
wrap-complete |
complete |
Simple completion. Supports both Clojure & ClojureScript. |
wrap-info |
info |
File/line, arglists, docstrings and other metadata for vars. |
wrap-inspect |
inspect-(start/refresh/pop/push/reset) |
Inspect a Clojure expression. |
wrap-macroexpand |
macroexpand/macroexpand-1/macroexpand-all |
Macroexpand a Clojure form. |
wrap-resource |
resource |
Return resource path. |
wrap-stacktrace |
stacktrace |
Cause and stacktrace analysis for exceptions. |
wrap-test |
test/retest/test-stacktrace |
Test execution, reporting, and inspection. |
wrap-trace |
toggle-trace |
Toggle tracing of a given var. |
For questions, suggestions and support refer to our official mailing list
or the Freenode channel #clojure-emacs
.
Please, don't report issues there, as this makes them harder to track.
Report issues and suggest features and improvements on the GitHub issue tracker. Don't ask questions on the issue tracker - the mailing list and the IRC channel are the places for questions.
Patches under any form are always welcome! GitHub pull requests are even better! :-)
Before submitting a patch or a pull request make sure all tests are passing and that your patch is in line with the contribution guidelines.
Special credit goes to the following people for their contributions:
- Gary Trakhman (@gtrak)
- Jeff Valk (@jeffvalk)
- Hugo Duncan (@hugoduncan)
And the a big thanks to all other contributors who have helped so far.
Copyright © 2013-2014 Bozhidar Batsov
Distributed under the Eclipse Public License, the same as Clojure.