Fork me on GitHub
#cider
<
2019-07-08
>
plexus11:07:24

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

plexus12:07:11

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

plexus12:07:28

Is there a way to downgrade to 0.21?

plexus12:07:06

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

bozhidar12:07:39

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

bozhidar12:07:12

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

bozhidar12:07:46

Bad cider-nrepl build to be precise.

manuel12:07:44

I can confirm latest build works now.

bozhidar12:07:47

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

macrobartfast17:07:22

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!'...

macrobartfast17:07:32

is this indicative of my having set things up improperly?

macrobartfast17:07:03

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.

macrobartfast17:07:33

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

macrobartfast17:07:38

which might be related.

practicalli17:07:07

@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...
[

macrobartfast17:07:26

cider-jack-in allowed for docs to work.

macrobartfast17:07:52

is your profiles public?

macrobartfast17:07:02

or, what versions are you using of nrepl etc?

practicalli17:07:47

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

macrobartfast17:07:24

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

macrobartfast17:07:31

all good... thx!

practicalli17:07:41

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 🙂

macrobartfast17:07:20

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

practicalli17:07:55

There are some excellent docs on different ways to run/connect to the REPL if cider-jack-in doesnt meet your needs https://docs.cider.mx/cider/basics/up_and_running.html.

macrobartfast17:07:56

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

macrobartfast17:07:16

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

practicalli17:07:43

@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.

dpsutton18:07:55

there's lsp mode that statically can solve this

dpsutton18:07:23

(use-package lsp-mode
  :init
  (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)
  :config
  (require 'lsp-clojure))

aisamu00:07:31

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

carkh18:07:32

i'm not upgrading cider anymore because i need this

carkh19:07:01

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

carkh19:07:45

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

carkh19:07:01

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

carkh19:07:56

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 '\''

carkh19:07:28

ok i can add that last one

Nate Sutton19:07:40

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

carkh19:07:39

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

carkh19:07:57

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

carkh19:07:43

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

carkh19:07:10

i'm ok with not going at it without forethought

carkh19:07:26

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

carkh19:07:16

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 '\''

carkh19:07:00

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

Nate Sutton19:07:20

$ echo 'hi$varg'\''uys'
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

carkh19:07:32

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.

FiVo19:07:13

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

dpsutton19:07:40

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

FiVo19:07:47

yes just the repl that opens up

carkh19:07:23

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

felipebarros20:07:58

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