Fork me on GitHub

I can't seem to get cider to pass my arguments to clj:


(use-package cider
      :ensure t
      :after (clojure-mode)
      (setq cider-clojure-cli-global-options "-A:dev")
      (setq cider-clojure-cli-global-options "-A:dev")
      (setq nrepl-log-messages t)
      (add-hook 'cider-mode-hook #'eldoc-mode)
      (add-hook 'cider-repl-mode-hook #'eldoc-mode)
      (add-hook 'cider-repl-mode-hook #'paredit-mode)
      (add-hook 'cider-repl-mode-hook #'rainbow-delimiters-mode))


[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.3"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'


how can I debug this?


Did you restart Emacs/reload your config after making those changes?


Yes; i use two other packages that depend on cider (`helm-cider` and flycheck-clojure) - so did a package-del -> eval pinning code -> package-ins -> restart dance before testing anew.


I figured it out, but not sure how to fix (fix running tests in cider I mean). I'm using clojure CLI tools. Tests work with that from the command line however, which made me realise that the only thing I've changed that I think that could cause this within cider is that I moved the inclusion of webasets (resources subfolder) into an alias (to support depstar's way of uberjar-ing)... which probably means that I need to figure out how cider runs tests under clj. I have some code that reads configuration from the resources folder which is causing the NPE.


I guess there's a few options: 1. Put the "resources" folder back into :paths in deps.edn, move the webassets elsewhere. Means tests can't hit any code path that hits the static resources route in the webapp tho. 2. Move the reading of configuration into a fn (instead of a module-level def) such that the exception doesn't ocur when attempting to load the namespaces/files.


@U051BLM8F yes I’ve restarted emacs everytime I’m making changes


Can we add something like this to cljr-clean-ns

(defun cljr-ns-align ()
  "Align ns requires."
  (when (re-search-backward "^\(ns.*\\(\n.*\\)*\(:require" nil t nil)
    (align-regexp (region-beginning)
My team recently decided to start aligning requires and I think we like that. It probably should be done maybe via middleware, but I don’t know where the relevant code is.


looks like it's a text formatting matter and shouldn't involve the middleware at all?


Generally all sort of formatting functions that don’t require middleware or external deps should end up in clojure-mode. We’ve actually been moving out things from clj-refactor in recent years, but at a rather slow pace due to our limited time.


> looks like it’s a text formatting matter and shouldn’t involve the middleware at all? Well, I was looking at cljr-clean-ns and it seems using middleware. Also maybe it should be possible to have similar functionality not just in Emacs.