Fork me on GitHub
#cider
<
2016-04-20
>
udit07:04:41

Hey folks! I am facing an issue with mis-match of cider and cider-nrepl versions? My emacs has the cider-version 0.12.0-SNAPSHOT and I have added the same in my lein profile for cider-nrepl. However when I run the project and connect to the repl via cider it shows me this warning.

WARNING: CIDER's version (0.12.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.3.0-SNAPSHOT and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
My lein-profile looks like this -
{
  :user {
            :plugins [[cider/cider-nrepl "0.12.0-SNAPSHOT"]]
            :dependencies [[org.clojure/tools.nrepl "0.2.12"]]
        }
}

udit07:04:10

Any ideas as to what might be going wrong?

benedek09:04:03

@udit: try remove cider/refactor related stuff from your profiles.clj

benedek09:04:40

These versions of cider and clj-refactor should inject their dependencies

benedek09:04:16

Unless you explicitly switched this feature off in ur cider config

udit09:04:31

@benedek: My profiles.clj is actually the text I posted above. I will remove the cider-refactor dep from the plugins.

udit09:04:56

I haven’t fiddled with any features of the Cider. Where can I check those?

benedek09:04:57

If you haven't changed stuff autoimjection should work

benedek10:04:48

places to check is .emacs.d directory in your home

nooga12:04:06

I just watched bozhidar’s talk from clojure/west - awesome ❤️

malabarba13:04:52

@zentrope: @rmuslimov FWIW, I started using figwheel yesterday. cider-jack-in-clojurescript works for me by setting

(setq cider-cljs-lein-repl
      "(do (require 'figwheel-sidecar.repl-api)
 (figwheel-sidecar.repl-api/start-figwheel!)
 (figwheel-sidecar.repl-api/cljs-repl))")

malabarba13:04:16

As long as figwheel-sidecar is in the plugins.

malabarba13:04:38

But no further configuration was necessary (starting from lein new figwheel ...).

zentrope15:04:56

@malabarba: Yes, I think it’s robust as long as project.clj starts with defproject. Try putting a (def foo “bar”) in front of (defproject …) and you might get what I was seeing: two Cider repls, not cljs.

malabarba15:04:27

Ah yes. I see how that could be a problem. simple_smile

ag17:04:47

anytime I jack-in in a project that uses boot it shows Java process icon. this is driving me nuts. how do I turn this off?

ag17:04:22

I mean this is not CIDER specific… I dunno why am I asking it here

ag17:04:18

even if I do boot repl it brings Java cup icon

pre17:04:20

For those who're still new and struggling with emacs/cider, I have a custom workflow with a minimalist typographic theme, that includes up-to-date versions of cider 0.12.0 and relevant plugins for Clojure/Clojurescript dev. It is based on “cask” dependency management, and as such upgrades should be less painful. Feedback appreciated. https://github.com/priyatam/emacs.d

pre18:04:29

@bozhidar: congrats on 0.12.0! I had no problems upgrading to it, and your talk at Clojure/West was inspiring.

ag18:04:35

ok I was able to fix Java Icon Cup thing for terminal repl by adding `export JAVA_TOOL_OPTIONS="-Dapple.awt.UIElement=true” `. but this didn’t fix cider-jackin do I need to add something into ~/profiles.boot?

nooga18:04:35

where can I find a good starting point for a clojure centric .emacs config? I was using emacs-live from the begining but it started lagging after cider a bit too much

bvulpes18:04:46

a "good starting point" for a .emacs config is...the empty file.

bvulpes18:04:04

@nooga: all you really need is to (require 'cider), and start browsing through the config vars as documented via M-x customize-group <RET> cider <RET>

bja18:04:49

has anyone else noticed that the chestnut template's (browser-repl) in a jack-in'd repl doesn't allow cljs-eval if a cljs buffer has already been loaded?

pre18:04:36

@nooga: I posted my config above and you can see my config under src/clojure.el.

bja18:04:20

i.e. if I open up my project.clj, jack-in, then do (run) and (browser-repl), I can open up a .cljs file and eval cljs. But if I open up a .cljs file before running (browser-repl), I get a message complaining that there is not cljs connection

bja18:04:48

that is to say, open up a .cljs file, run (browser-repl), and then try to eval, i get an error.

nooga18:04:43

@pri: didn’t notice, thanks

nooga18:04:48

I’ll check it out

plexus18:04:48

@bja: I'm aware of that issue, you could try the snippet @malabarba posted earlier

plexus18:04:54

(setq cider-cljs-lein-repl
      "(do (require 'figwheel-sidecar.repl-api)
 (figwheel-sidecar.repl-api/start-figwheel!)
 (figwheel-sidecar.repl-api/cljs-repl))")

plexus18:04:16

and use cider-jack-in-clojurescript instead of cider-jack-in

plexus18:04:58

if you have time to make an issue for it that would be great (--> http://github.com/plexus/chestnut)

plexus18:04:28

this solution might work, in which case it should be documented in the README, or if it doesn't work we can follow up and look for a solution

plexus18:04:47

also with this approach you would no longer call (browser-repl), instead cider-jack-in-clojurescript will open two REPLs for you, one CLJ one CLJS

plexus19:04:05

@nooga: cider, clj-refactor, and paredit/`smartparens`/`parinfer` are what I would consider essential. There are a lot of starter kits but unless you take the time to study all the stuff that's in them you're probably better off starting with a minimal config

malabarba19:04:44

@ag sorry, I meant to say "where does the icon appear?"

plexus19:04:46

@nooga: that said most of these "sane-defaults" from @magnars are pretty sensible to have as well https://github.com/magnars/.emacs.d/blob/master/settings/sane-defaults.el

ag19:04:48

@malabarba: in the os x dock. it creates foreground Java process which I can’t even close

malabarba19:04:21

That sounds annoying 🙃

malabarba19:04:21

You managed to solve it then?

malabarba19:04:58

You need to set that envvar in Emacs

malabarba19:04:37

In Linux/Windows that would be almost trivial. But I hear OSX is a little more finicky for that kind of stuff

malabarba19:04:52

But I think emacs has function forum that

malabarba19:04:58

Probably set-env

ag19:04:10

@malabarba: I feel I tried almost everything - tweaking .boot.properties and profile.boot files, setting env vars and getting them in emacs, using exec-path-from-shell package - nothing seems to help

ag19:04:05

it feels like cider-jack in ignores boot.properties and profile.boot.

malabarba19:04:22

@ag have yo utried evaluating this in emacs: (setenv "JAVA_TOOL_OPTIONS" "-Dapple.awt.UIElement=true")?

ag19:04:12

yasssss! yasss… that did work!

ag19:04:05

thank you, thank you, thank you!

gtrak20:04:10

what made cider need clojure 1.7?

gtrak20:04:53

this auto-injecting stuff feels wrong, I understand the nrepl dep because leiningen does that anyway.

gtrak20:04:17

And it's unlikely that other code in the app will depend on nrepl specifics

bozhidar21:04:32

@gtrak: our desire for feature-parity between Clojure and ClojureScript

bozhidar21:04:41

cljs is 1.7 only

bozhidar21:04:59

and I didn’t want us to bother with the differences between 1.5 and 1.7

bozhidar21:04:10

+ some of the deps are now 1.7 only

bozhidar21:04:27

effectively everything that works on cljs is 1.7+

gtrak22:04:20

well, I think I said all I could about it simple_smile

gtrak22:04:07

thankfully I'll be back on clojure pretty soon

pre23:04:28

what is the correct way to clear and reload a ns?

bvulpes23:04:48

clojure.tools.namespace.repl/refresh

bvulpes23:04:07

cider-refresh i think, possibly cider-reload