Liking cljdoc? Tell your friends :D

Build Status

CIDER nREPL

A collection of nREPL middleware designed to enhance CIDER.

Usage

Via Leiningen

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"]]

A minimal profiles.clj for CIDER would be:

{:user {:plugins [[cider/cider-nrepl "0.7.0"]]}}

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"]]
: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.

Via embedding nREPL in your app

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))

With Immutant

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)))

Supplied nREPL middleware

MiddlewareOp(s)Description
wrap-aproposaproposPattern search for symbols and documentation.
wrap-classpathclasspathJava classpath.
wrap-completecompleteSimple completion. Supports both Clojure & ClojureScript.
wrap-infoinfoFile/line, arglists, docstrings and other metadata for vars.
wrap-inspectinspect-(start/refresh/pop/push/reset)Inspect a Clojure expression.
wrap-macroexpandmacroexpand/macroexpand-1/macroexpand-allMacroexpand a Clojure form.
wrap-resourceresourceReturn resource path.
wrap-stacktracestacktraceCause and stacktrace analysis for exceptions.
wrap-testtest/retest/test-stacktraceTest execution, reporting, and inspection.
wrap-tracetoggle-traceToggle tracing of a given var.

Contributing

Discussion

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.

Issues

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

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.

Hall of Fame

Special credit goes to the following people for their contributions:

And the a big thanks to all other contributors who have helped so far.

Let's also acknowledge some of the projects leveraged by cider-nrepl:

License

Copyright © 2013-2014 Bozhidar Batsov

Distributed under the Eclipse Public License, the same as Clojure.

Can you improve this documentation? These fine people already did:
Bozhidar Batsov, Jeff Valk, Gary Trakhman, Rory O’Kane, Akhil Wali, Tim Pope & Jon Pither
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close