Fork me on GitHub
#cider
<
2017-06-06
>
grzm00:06:46

I came across (boot (aot :namespace '#{ex.Example})) and that worked for me.

gonewest81804:06:35

@rmuslimov - well, when I try evaluating the same code, I get

gonewest81804:06:45

WARNING: test already refers to: #'clojure.core/test in namespace: foo, being replaced by: #'foo/test

gonewest81804:06:41

on a hunch, I wondered if the issue had to be with the aliasing of the underlying function. So I renamed your test to xtest like so

gonewest81804:06:01

(def xtest (wrap-nothing target))

gonewest81804:06:34

and now calling (xtest 3) gets the debugger too.

rmuslimov07:06:49

@gonewest818 Which is your version of cider-nrepl/refactor-nrepl/cider ?

rmuslimov07:06:19

Mine are latest

[refactor-nrepl "2.3.1"]
[cider/cider-nrepl "0.15.0-SNAPSHOT"]
and latest cider from MELPA

rmuslimov07:06:45

Renaming test -> xtest didn’t help.

pedrorgirardi12:06:32

Hi, I’m very new to Emacs/Cider, I’m coming from Cursive. I’m struggling a little bit, but I’m enjoying the adventure 🙂 I just would like to ask, if clj-refactor support *.cljs. I’m trying to rename a symbol and I’m getting

Only .clj is supported

pedrorgirardi12:06:25

I’m using Spacemacs

dominicm12:06:36

@pedrorgirardi some ops do not work in some files

dominicm12:06:56

I think it's just to do with renaming things, particularly globally

pedrorgirardi12:06:58

@dominicm thanks!! what is a “good way” to rename a symbol in a *.cljs file then?

dpsutton12:06:58

if its locally bound, it's easy to jump to closing parens. what i normally do is go to the beginning of the defun or form that encloses the var, set the mark C-space and then press C-m-f to go the the closing brace. It should now be highlighted. M-x narrow-to-region and then just M-x replace-regexp

dpsutton12:06:29

this is obviously not scope aware but that's why we narrow so as to hopefully limit to the score.

benedek12:06:44

@pedrorgirardi unfortunately those features needing an AST are not yet supported in cljs. this might change eventually, see reasons and discussion on how to tackle this here: https://github.com/clojure-emacs/refactor-nrepl/issues/195

benedek12:06:46

we have support for quite a few things for cljs too: see refactoring functions in clojure-mode https://github.com/clojure-emacs/clojure-mode#refactoring-support

benedek12:06:02

and clean ns also works for cljs

pedrorgirardi12:06:14

thanks very much guys!!! it’s the first time that I ask something here and you were super helpful!

pedrorgirardi12:06:37

@benedek I will check the issue you mentioned and the docs about the other functions

benedek12:06:12

coolio, good luck @pedrorgirardi and let us know how you get on

pedrorgirardi12:06:33

thanks @benedek !!

pandeiro18:06:58

What should a team do if their dev workflow requires cider-connect and members are using different versions of cider?

benedek18:06:40

can you elaborate? this sounds tricky...

benedek18:06:26

you either have ur own repl process so you can control the versions of middlewares you use

benedek18:06:44

or you need to synchronize you versions

benedek18:06:30

using the latest stable of cider & cljrefactor is not a bad idea if you need to sync

pandeiro18:06:53

@benedek So in most complex apps the entrypoint to the development system is not just lein repl or boot repl but a custom function or alias

pandeiro18:06:02

I should say, in my experience 🙂

pandeiro18:06:41

Is there a reason that cider-connect can't resolve dependencies from lein/boot profiles?

pandeiro18:06:54

I thought cider used to work this way but I may be wrong

benedek18:06:05

when you cider connect you attach to an already running repl server

benedek18:06:24

you can't control its classpath

pandeiro18:06:28

so the cider-nrepl middleware needs to be loaded on the server, not the client

pandeiro18:06:04

So couldn't that particular dependency version be kept in sync via the emacs customization UI?

pandeiro18:06:21

Because it needs to match the Emacs version of cider

pandeiro18:06:20

Ah but there's no way to inject it into the server process if Cider doesn't start it

pandeiro18:06:23

Now I get it

pandeiro18:06:27

So is it possible to customize the cider-jack-in REPL command?

benedek18:06:01

in fact cider already does that

benedek18:06:19

if you jack in that is

benedek18:06:51

I mean injecting the right version of middleware

pandeiro18:06:57

Oh yes, right

pandeiro18:06:13

But I think I need cider-jack-in-params to return something special for my project

pandeiro18:06:28

so that instead of lein repl, it calls lein special-repl etc

benedek18:06:38

you can also further tweak the lein or boot commands

benedek18:06:09

is that messing up the middleware injection?

benedek18:06:26

I don't think it should....

pandeiro18:06:33

Well actually I don't even know how to customize that yet, haven't tried

benedek18:06:13

your project have a dir-locals file in its root?

benedek18:06:07

hm... that is the usual way to set emacs things on a per project basis

pandeiro18:06:24

So I could gitignore that and set up the params there, that works I think

benedek18:06:11

yup that is what ppl usually do I guess...

pandeiro19:06:35

So @benedek actually the ~/.boot/profile.boot mechanism mentioned here does work for me with cider-connect

pandeiro19:06:53

Because the REPL server task has the correct middleware injected via the profile

pandeiro19:06:42

Hmm, I spoke too soon. Boot's profile.boot gets evaluated but still it seems like cider doesn't recognize the loaded cider-nrepl middleware when I M-x cider-connect

pandeiro19:06:50

I'm pretty sure this used to work fine

benedek21:06:49

again the profile only takes effect if you start the server

pandeiro21:06:09

Hmm, I don't understand "if you start the server" -- I am starting it?

dpsutton21:06:21

aren't you just connecting?

dpsutton21:06:27

ie, the server was already running?

dpsutton21:06:58

cider-jack-in starts a jvm, cider-connect connects to an existing one. If you connect to an existing one it did not start with a profile in your dir locals file

pandeiro21:06:43

Oh yes @dpsutton - but actually this is orthogonal to the dir-locals approach

pandeiro21:06:03

Boot itself evals the file at ~/.boot/profile.boot

pandeiro21:06:12

And that is happening when the server is invoked

dpsutton21:06:18

i don't know what's going just saw one potential source for confusion

pandeiro21:06:25

Ah sure thanks

pandeiro21:06:53

So the profile.boot is getting read in fact, and when I comment out certain deps, I am getting the expected loading of middleware

pandeiro21:06:05

However with my entire deps vector loaded, something is interfering

benedek21:06:25

any chance you can actually share the project in question?

benedek21:06:53

or at least the relevants bits...

benedek21:06:12

(all the files in the proj root perhaps...)

pandeiro21:06:36

a lib was bringing in a transitive dependency on an old version of cider/cider-nrepl

pandeiro21:06:47

I went through commenting them out til I isolated it

pandeiro21:06:56

That is very crazy

pandeiro21:06:13

Also because the version was so old that cider-nrepl's error message says "version (nil)"

benedek21:06:13

what was depending on cider middleware?

pandeiro21:06:41

This is why it's not a great idea to have to include cider/cider-nrepl as a project dependency

pandeiro21:06:02

Unfortunately the transitive dep was taking precedence over the version in my profile.boot