Fork me on GitHub

Seems after upgrading I'm no longer to evaluate anything, instead I get exceptions in the *nrepl-server* buffer: No such var: info/resource-path


after upgrading to master, no such var: u/jar-file?


Is there a way to downgrade to 0.21?


Thanks, I'd still be interested to know this.


@plexus There was a bad build in the morning, but it should be ok now.


(a small mismatch between cider-nrepl and orchard that resulted in that missing info/resource-path)


Bad cider-nrepl build to be precise.


I can confirm latest build works now.


You can just delete your current installation and pin the cider package to melpa-stable.


using emacs I tend to start a nrepl with lein nrepl and then cider-connect to connect to it... I get the warning 'WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!'...


is this indicative of my having set things up improperly?


tbh I'm confused now of what I need to do with a plugin and what with deps in package.clj to get cider working.


cider-doc produces 'Wrong type argument: stringp, nil' as well...


which might be related.


@macrobartfast I used to get this message when the version of cider-nrepl was different (or not included) in my .lein/profiles.clj configuration. Quick check would be to quit the lein repl repl and use cider-jack-in from Emacs instead (moving any .lein/profile.clj file out of the way first), as this will inject the right version of libraries for the CIDER version you have installed. Then just look in the messages buffer to see what to use. For example

[nREPL] Starting server via /home/jr0cket/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta6\"\] -- repl :headless :host localhost...


cider-jack-in allowed for docs to work.


is your profiles public?


or, what versions are you using of nrepl etc?


I do not use a .lein/profiles.clj it is not needed if you are using cider-jack-in, unless you are on a really old version of CIDER, circa February 2015. Move your profiles.clj out of the way first


yeah, I use nrepl in a terminal and then connect to it from emacs.


all good... thx!


Its okay to use a terminal to start the REPL using lein repl but you need to manage the versions of the plugins for the version of cider you have installed. So whenever you upgrade CIDER then you may need to update your .lein/profile.clj. CIDER has taken on some pretty big improvements and consolidated lots of code from other libraries, so its simpler to use cider-jack-in and let CIDER do the work for you 🙂


ok... and it's all working now, thanks!

👍 1

There are some excellent docs on different ways to run/connect to the REPL if cider-jack-in doesnt meet your needs


maybe for #clojure, but what is a good way to jump to a function declaration and pop back?


I'm finding cider-find-var requires everything have been already loaded somehow, which is awkward.


@macrobartfast you are not the first to mention this limitation of cider-find-var. I always have the REPL running so don't notice the issue much. I use a lot of the tools in Spacemacs to navigate around.


there's lsp mode that statically can solve this

👀 1

(use-package lsp-mode
  (setq lsp-clojure-server-command '("bash" "-c" "cd ~/projects/clojure/clojure-lsp && lein run"))
  (setq lsp-enable-indentation nil)
  (setq lsp-enable-completion-at-point nil)
  ;; (setq indent-region-function #'clojure-indent-function)
  (add-hook 'clojure-mode-hook #'lsp)
  (add-hook 'clojurec-mode-hook #'lsp)
  (add-hook 'clojurescript-mode-hook #'lsp)
  (require 'lsp-clojure))

👍 1

Interesting, thanks! Can CIDER and this be used simultaneously?


i'm not upgrading cider anymore because i need this


that's as fast as applying the patch and jack in a project, see if it works


a deps.edn project

Nate Sutton19:07:52

if your arg has a " in it then it breaks that

Nate Sutton19:07:19

unless the arg also has quotes escaped


i tested it with a few projects here on windows and WSL,

Nate Sutton19:07:04

and also $ in double quotes will cause all kinds of problems

Nate Sutton19:07:36

generally if you want bash or sh to not touch an argument you use single quotes


but when will cider produce a problematic command line though ?

Nate Sutton19:07:58

and single quotes in your arg need to be escaped from ' to '\''


ok i can add that last one

Nate Sutton19:07:40

that's only if it's wrapped in single quotes, though


alright, but are you talking in the abstract or specifically for cider usage ?

Nate Sutton19:07:50

when shelling out

Nate Sutton19:07:48

if I'm using double quotes and the value in between double quotes includes $var or ${var} or $(something) then that will be evaluated by the shell


the situation is that right now, cider won't jack(in a deps.edn project on windows without the changes i proposed, and i'm not knowledgable enough to handle the unix side of things, just good enough to test it


do you think cider can produce such a command line with $var in it ?

Nate Sutton19:07:20

generally you assume the worst when shelling out, because you don't know how that arg or other args will be used in the future

Nate Sutton19:07:27

it doesn't really matter what it can do now

Nate Sutton19:07:39

I'm not knowledgeable enough about windows to be of help on that side, I'm just saying this is a bad idea


i'm ok with not going at it without forethought


but it eventually needs to be fixed to work in both cases i think

Nate Sutton19:07:48

for sure, definitely

Nate Sutton19:07:32

I'd be extremely careful about this with this


allright then, so how can i escape the $var ${var} and $(something) cases

Nate Sutton19:07:33

use single quotes

Nate Sutton19:07:59

and then escape ' to '\''


haha well that's what's preventing it to work under windows

Nate Sutton19:07:20

$ echo 'hi$varg'\''uys'

Nate Sutton19:07:38

sounds like there should be a switch or something to let it work differently based on platform, then

Nate Sutton19:07:10

and, really, some sort of function to do proper escaping of these things


that's beyond my abilities =( i only know enough elisp to be dangerous

Nate Sutton19:07:50

like a function to quote an argument and have it automatically wrap it in the correct quotes for the platform and to escape any quotes or whatever within the arg

Nate Sutton19:07:03

yeah, I'm crap with elisp, too 😞

Nate Sutton19:07:14

I commented on there, I hope it's helpful.


Is there a way to set the size of a new repl window?


that should just be a normal emacs buffer/frame configuration thing? Do you mean just constraining the size of the repl that opens up?


yes just the repl that opens up


one thing i dislike is when you drill down, say from test result to exception window then to code, i end up with code in my repl window, and sizes don't go back to what they were


It's not a cider specific thing. It's one of the most annoying aspects of Emacs in general.