Open GoogleCodeExporter opened 9 years ago
It seems from the example you're providing that what you want is templates in
the REPL input area to ease writing common code, is that it ?
I mean, this would then only work in the REPL input area (no additional
dialog), be added to the command line history.
We could have a different set of templates for Clojure Editors and for Clojure
REPL Input areas.
If I'm misunderstanding, please feel free to expand the set of use case
examples.
Original comment by laurent....@gmail.com
on 28 Mar 2013 at 9:39
My main use case is: I'm editing code in a test namespace and I want to run the
tests without having to manually switch to the repl and execute
(clojure.test/run-tests). A more general framework for adding shortcuts like
this would be nice though. The key thing is for common tasks like running
tests, I shouldn't have to leave the editor or use the mouse at all.
The example above is a little contrived, but I wanted something that would show
using the ${ns} template var.
Original comment by dave...@gmail.com
on 28 Mar 2013 at 11:33
I also would like to provide a general way for users to extend Counterclockwise.
Either because they have something really specific to their environment.
Or else to help share / sandbox new features (I could well use it myself,
throwing new features in the wild by means of Gists, etc.).
For instance, there could be a way to register for editions, file saves,
getting the current repl, registering new commands, etc.
For instance, you could then be able to add a custom listener for file saves
and react to them by automatically launching (clojure.core/run-tests) :
(declare run-tests)
(eclipse/register-editor-save-editors ;; whatever would make sense, didn't
think about all this that much
(fn [saved-files context]
(when-let [namespaces (seq (filter #(.endsWith (.getName %) ".clj") saved-files))]
(run-tests namespaces (:repl context))))
(defn run-tests [namespaces repl]
(doseq [n namespaces]
(nrepl/eval repl `(clojure.core/run-tests ~n))))
Something like that
Original comment by laurent....@gmail.com
on 3 Apr 2013 at 1:36
Original comment by laurent....@gmail.com
on 18 Nov 2014 at 9:25
Original issue reported on code.google.com by
dave...@gmail.com
on 28 Mar 2013 at 6:46