Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix clojure-emacs#1776] Add new customization variable `cider-test-d…
…efining-names`. This fix is strictly simpler than that suggested in clojure-emacs#1776 (comment). It has the advantage of being much more robust. I partially implemented the suggested fix, and witnessed the following two issues. First, full "macroexpand" does not leave a recognizable `deftest` form; it generally leaves a `(def test-... (fn [] ...))` sexp. That implies that a recursive macroexpansion would be required, with each step of the recursion checking for a recognized form. Second, even recognizing such a form is tricky, because the expansion may refer to deftest in an aliased namespace (e.g., `t/deftest` or `clojure.test/deftest` rather than bare `deftest`). One could then try to identify possible namespaces using the current environment, but this is getting complicated. Therefore, I think it better to have the user configure their environment to help them solve this problem. (And, of course, future work can implement the full macroexpansion approach.)
- Loading branch information