Fork me on GitHub

It seems that Cider uses snapshot versions of cider/cider-nrepl and refactor-nrepl


Why is that?


Only if you aren't using it from the stable repo


Over the weekend I’ve started working on (a dedicated section in the user manual for ClojureScript). It’s still in its early stages, but I’ll certainly appreciate any input and contributions from CIDER’s users, who are into ClojureScript development.

cider 16
❤️ 12

Shadow's section looks great! Might be useful to mention shadow-select (and perhaps suggest it as the default?), since I suspect it's not uncommon to have multiple builds running in parallel (e.g. test + devcards + app, each on a separate page).


PRs welcome! 🙂 There’s a lot I want to add to each section, but I’ll have to find some time for this first.


@didibus @dominicm I don’t use spacemacs, but a lot of people I work with do. I keep seeing them using the melpa latest version instead of melpa stable. Perhaps it’s just default config there - but it seems like it results in them often using a snapshot of cider. wonder if this relates to your version.


It is the default there


I think that’s unfortunate. I don’t particularly find a dev environment of all cutting-edge snapshots to be that stable of an experience. Using the latest seems more of something you’d do if you wanted to actively test things to give feedback and/or work on dev.


Yeah, agree. I've always thought it an odd choice. But all you emacs people are weird vim

😄 4

Well I don’t use spacemacs but I do use emacs but default to melpa stable


Your comments are about a year out of date I believe. You can choose to if you want to a use stable package repository in the .spacemacs config.


ah, well everyone I’m referring to probably installed prior to this - so that may make sense


is it documented anywhere where you can have it use stable instead? @U05254DQM ?


dotspacemacs-use-spacelpa t in your .spacemacs config file.


It has been around since the end of 2017 it seems. (I haven't used the stable package repo myself, as I've not had any issues with Cider snapshots)


It maybe that spacelpa is only available on the Spacemacs develop branch, which is very stable itself


Ah I see. Thanks for the details. When troubleshooting cider things in the past it was just confusing to see them use snaphot versions. And I wasn’t sure how to adjust it to not do that to rule it out.


But, why does nRepl stable uses snapshot?


Cider complains of mismatch version otherwise?


I also find, in practice, latest melpa is better then stable


Since most things you're behind on are bug fixes


I'm not even sure all melpa package ever transition into stable


So sometimes stable means old outdated and buggy


I didn’t know a stable did or could use snapshot. Hah.


And your theory on snapshot is interesting. I think it seems unstable to have projects upgrading automatically with every “fix” but perhaps it works well in practice


You might still be right though. It could be unstable cider from melpa telling me to use a weird combo of snapshot and non snapshot for middleware


> But, why does nRepl stable uses snapshot? I don’t get this. Can you explain what do you mean?


Spacemacs can role back any package update. So I have had confidence to update the Emacs packages on a rough monthly basis (or a few days after bozhdar releases more awesomeness from the orchard)


@U051BLM8F I mean:

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


Here nrepl 0.6.0 is used with snapshot versions of the middleware


Well, that’s simply because we don’t need anything from the snapshot nREPL at this point.


Occasionally the versions of the middleware on the dev branch would be non-snapshot as well.


Hum, okay, and what about this warning:

WARNING: CIDER 0.24.0-snapshot requires cider-nrepl 0.23.0-SNAPSHOT, but you're currently using cider-nrepl 0.22.4. The version mismatch might break some functionality!
         More information.WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)


Though I think I just got it. CIDER 0.24.0-snapshot is the Emacs package ?


So it means my Emacs package is not in sync with my Clojure dependency on cider-nrepl ?


@didibus the error message you get is usually because you have versions of these libraries in your project. This is usually experienced when using cider-connect rather than cider-jack-in , as jack-in pushes the right version of libraries in the command line. So its usually something adding an older version in your project or build tool (Clojure CLI, Leiningen profie, etc.). The other possibility is that it is clj-refactor as I am running the same version of Cider as you and do not have the same error when running ckder-jack-in

Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' 
I dont know if clj-refactor has a dependency on an older version that it is pulling in. It seems strange if so, but that is the only think I can think of from the information you have provided so far.


Hi everyone. Does anyone experience this behavior: • jacked into cider • type few spaces within a form before the closing bracket • wait just under a second • the form is automatically reformatted (spaces removed) If one quits the cider session, this behavior is gone, one can type normally. Video:


Seems to me you have some hook to reformat the code on save or something like this. CIDER doesn’t reformat anything by itself.

Suvrat Apte10:01:19

Do you have aggressive indent installed?


Thanks for the hints. Yes, it seems something from my doom emacs rig is aggressively formatting. Good that I can exclude Cider. I'll check for aggressive indent; it seems like a candidate, given the github page.

Suvrat Apte13:01:20

Try disabling aggressive-indent-mode and see if the behaviour changes. If it does, it’s surely aggressive-indent.


Generally I don’t recommend using aggressive-indent-mode, as it tends to affect performance a lot in bigger source files.

Suvrat Apte15:01:52

I completely agree with you. It makes Emacs very slow with big files. I add aggressive-indent-defun to before-save-hook. Do you know any better approach?


Finally tracked the issue down. It wasn't agressive-indent-mode but this little "helper"


I suspect it errors out wihtin those save-excursion and leaves the buffer in a "cleaned up state".