Fork me on GitHub
#cider
<
2018-12-12
>
pradyumna07:12:43

hi, i am seeing a strange issue with cljs while using cider-find-ns. Sometimes it shows correct file, but sometimes it says "Can't find namespace 'my.namespace'". I could see no perceptible difference in those files. any clues?

pradyumna07:12:31

one thing i note, the behavior is file specific. for a particular file, it either works or fails always even after restarting emacs.

pradyumna09:12:49

on further debugging found that,

(cider-nrepl-send-sync-request `("op" "ns-path" "ns" "my.namespace"))
returns (dict "status" ("done") "path" nil ...). so in the nrepl process itself not able to find it.

stathissideris10:12:31

hello! I tried to jack-in into a project with deps.edn and CIDER failed to connect with Exception in thread "main" java.io.FileNotFoundException: Could not locate cider_nrepl/main__init.class or cider_nrepl/main.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.. That’s not surprising, because it looks like it’s invoking this: /usr/local/bin/clojure -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'

stathissideris10:12:48

do I need cider-specific deps in my deps.edn?

dominicm10:12:44

@stathissideris do you have cider configured to not inject dependencies?

stathissideris10:12:28

@dominicm YES! genius! I remember now I disabled that because of reloading problems in the past

bozhidar10:12:41

Lein 2.8.2 is out (https://github.com/technomancy/leiningen/releases/tag/2.8.2) and it bundles the latest and greatest nREPL release! All CIDER users are strongly advised to move from Lein 2.8.1 to 2.8.2. The plan is that CIDER 0.20 will require 2.8.2 or newer for cider-jack-in to work.

8
lispyclouds12:12:05

For MacOS users, my PR to upgrade it in homebrew just got merged too. Happy updating! 😄

Saikyun11:12:11

is it possible to enable breakpoints on exceptions? iirc java has this, but I haven't been able to find it for clojure

Saikyun11:12:51

also is it possible to automatically reload files into the buffer when I save them?

pradyumna12:12:04

on digging deeper found that the value of :defs is {} in the return from cljs-tooling.util.analysis/find-ns, when the source file doesn't have a single def form. which is typical for subs or event files in re-frame projects. as a result cider-find-keyword fails with "Can't find namespace". @bozhidar any suggestion? as a workaround i can put a dummy def form in those files. is there any other way?

bozhidar12:12:47

> is it possible to enable breakpoints on exceptions? iirc java has this, but I haven’t been able to find it for clojure

bozhidar12:12:05

@saikyun No, currently we don’t have such functionality in CIDER’s debugger.

bozhidar12:12:22

Potentially it’s doable, but I don’t think anyone’s working on this.

bozhidar12:12:33

> also is it possible to automatically reload files into the buffer when I save them?

bozhidar12:12:26

Yeah, you can always leverage Emacs’s after-save-hook or something like this.

bozhidar12:12:18

> on digging deeper found that the value of :defs is {} in the return from cljs-tooling.util.analysis/find-ns, when the source file doesn’t have a single def form. which is typical for subs or event files in re-frame projects. as a result cider-find-keyword fails with “Can’t find namespace”. @bozhidar any suggestion? as a workaround i can put a dummy def form in those files. is there any other way?

bozhidar12:12:36

I guess we can work around this in cljs-tooling. You can file a ticket there.

pradyumna12:12:03

thanks @bozhidar, i'll create the ticket

Saikyun13:12:02

>Potentially it’s doable, but I don’t think anyone’s working on this. @bozhidar okay, good to know. >Yeah, you can always leverage Emacs’s after-save-hook or something like this. ah, I see. I was somehow thinking that the nrepl should be the one looking for file changes, but using the save hook makes sense 🙂

manuel13:12:58

With latest nREPL I get nrepl-send-sync-request: Sync nREPL request timed out on cider-jack-in-clj&cljs. Is it happening to someone else?

manuel13:12:10

I am using latest lein, by the way.

manuel13:12:30

yes, that's it

lispyclouds13:12:32

Get this error REPL server launch timed out. even when you run lein repl manually

manuel13:12:26

I can confirm that reverting to 2.8.1 works. Thanks for the tip.

bozhidar14:12:09

Fuck! Seems I really messed something up!

jumar15:12:17

Do you use clj-refactor, in particular cljr-find-usages and/or cljr-rename-symbol? This is something that I really miss - I normally just do fulltext search and/or replace Trying to use aforementioned functions give me these errors in our project:

Caused by: clojure.lang.ExceptionInfo: [line 11, col 0] Invalid keyword: ::specs/warning.
I tried to use cider-load-all-project-ns (as suggested here: https://github.com/clojure-emacs/clj-refactor.el/issues/353) but it just keeps throwing those errors. I guess that performance also isn't great but it could be usable if it ever worked.

André Peric Tavares16:12:35

Hi. Does anyone know if there's a cider command for formatting code in multiple lines? Like, given a {:foo :bar :baz :x} map, format it in the buffer like {:foo :bar \n :baz :x}

bozhidar17:12:55

@manuel The problem is fixed, btw.

futuro17:12:25

@andre.peric look up the cider-pprint- family of functions and options; they should have you covered.

👍 1
manuel18:12:36

@bozhidar should CIDER inject nREPL 0.5.3 now?

bozhidar18:12:04

Yeah, it should, but lein repl :headless was never broken, so this won’t really fix the problem for anyone.

bozhidar18:12:24

I know that Phil will issue a bugfix lein release pretty soon. I won’t be surprised if it happens today.

kidpollo21:12:53

When I do cider-jack-in-clj&cljs my cljs repl foes from cljs-pending state to clj repl. Figwheel main works fine and I can eval cljs code in the repl but if I try to eval code in a cljs file it I get a there are no cljs REPLS error.

kidpollo21:12:02

Anyone else have this issue?

kidpollo23:12:55

NVM I had an old cider-nrepl plugin configured in my ~/.lein/profiles.clj