Fork me on GitHub
#cider
<
2019-05-16
>
bozhidar06:05:23

Ah, yeah. I didn’t understand you were talking about a mixed Clojure/Java project at first. Makes sense now that you mentioned Maven… 😄

alexyakushev12:05:02

So, I'm using Boot and tools.namespace, and when I reload the code with the latter and then use M-. to jump to a function definition, it jumps not to the source code file, but into the temporary source file that Boot creates. Anyone else had a similar problem?

alexyakushev12:05:13

And that is apparently because when I use tools.namespace, then the defined vars have :file in their metadata that is relative to the project resource root (e.g. foo/bar.clj, not /Users/me/blabla/src/foo/bar.clj). And then CIDER resolves that stuff from the classpath, and on the classpath Boot keeps its temporary "fileset" files

bozhidar12:05:36

@alexyakushev Does this problem occur only after reloading?

alexyakushev12:05:08

Yep. When I recompile a file naturally with C-c C-k, all vars get absolute :file metadata.

alexyakushev12:05:57

This tangentially brings me to another question: since we are doing CL development in Docker, we are using this SLIME's feature slime-filename-translations that allows us to set up translations from in-Docker paths to local filesystem paths, so that we can use M-..

alexyakushev12:05:35

Is there anything like that in CIDER, or would it be possible to implement manually?

bozhidar13:05:49

I think we have exactly the same feature. 🙂

bozhidar13:05:14

When it comes to Boot resources CIDER also tries to resolve them using Boot’s fake.class.path. Maybe I managed to break this around the recent changes in Orchard related to classpath lookups…

bozhidar13:05:41

Boot has always caused some trouble with its two classpaths. 🙂

alexyakushev13:05:37

Yeah, I know that Boot is hard to deal with 😞 I'd love to switch to something simpler but we are just too invested into it at this point.

alexyakushev13:05:45

Сool! Thanks for the hint

dpsutton13:05:33

woops. didn't realize it was the exact same PR 🙂

alexyakushev13:05:39

Thanks anyway:)

alexyakushev13:05:24

Bozhidar, I'm trying to find what changes to Orchard could trigger this behavior regarding Boot and tools.namespace (because I don't think it worked like that before) but I can't find it. Could you please point me to the commit(s)?

bozhidar13:05:11

Sure. Jeff Valk deleted some stuff from Orchard here.

bozhidar13:05:03

We had a misunderstanding (I think he wasn’t familiar with Boot and I didn’t pay much attention to this part of the changes).

bozhidar13:05:15

Later I realized this was a mistake and that should have stayed in Orchard.

bozhidar13:05:46

(otherwise Boot won’t work properly if you’re not using cider-nrepl)

bozhidar13:05:19

I’m pretty sure those two commits should give you an idea about where exactly the regression is.

alexyakushev14:05:31

Wow, that's a big commit.

alexyakushev14:05:15

Should I make an issue in Orchard regarding this? From a quick glance, it seems that it wouldn't be hard to salvage the Boot functionality by just bringing the code back.

alexyakushev14:05:54

Sad that a significantly breaking change went in without a PR 😕

bozhidar14:05:16

Yeah, I guess Jeff underestimated the impact of this, as he made many breaking API changes along the way.

bozhidar14:05:30

> Should I make an issue in Orchard regarding this? From a quick glance, it seems that it wouldn’t be hard to salvage the Boot functionality by just bringing the code back.

bozhidar14:05:10

That’s one way to approach this. @richiardiandrea already has a PR bringing back some of this in the context of another huge PR. 😄

bozhidar14:05:49

I guess it might be better to restore this separately, but I’ll take everything that solves the problem. Too many tasks, too little time to make everything right.

richiardiandrea14:05:41

Also, my PR should have tests around this so it makes me feel a bit better 😅

richiardiandrea15:05:06

The other massive PR for compliment is also ready so I guess we are close to kill cljs-tooling 😃😃

alexyakushev15:05:19

@richiardiandrea Yeah, sorry about that one moving slowly 😬

richiardiandrea15:05:01

No worries! I am excited where this brings us really 😁😁

chase-lambert16:05:08

when trying to run and connect to a shadow-cljs app I'm getting a ton of nrepl middleware warnings and then get errors when trying to connect to the repl (using cider/cider-nrepl and cider/piggieback with vim fireplace). https://pastebin.com/se1cJESJ This was working a few weeks ago but I'm on a fresh install so don't know what has changed. any clues?

chase-lambert16:05:48

this is the error message I get when trying to connect: https://pastebin.com/ZueFshz0

chase-lambert16:05:16

relevant portion of shadow-cljs.edn:

:dependencies [[binaryage/devtools "0.9.10"]                                                  
                [cider/cider-nrepl "0.21.1"]                                                   
                [cider/piggieback "0.4.1"]                                                     
                [reagent "0.8.0"]] 

bozhidar16:05:33

@chase-lambert It seems you’re spinning a legacy tools.nrepl server. Are you running Lein 2.9?

bozhidar16:05:59

> Exception in thread “nREPL-worker-0” java.lang.ClassCastException: cider.nrepl.middleware.track_state$make_transport$reify__30991 cannot be cast to clojure.tools.nrepl.transport.Transport

bozhidar16:05:25

The namespaces for the modern nREPL doesn’t have the clojure.tools prefix. 🙂

chase-lambert16:05:42

just got it solved over in #shadow-cljs The version of Shadow-cljs in the tutorial I'm following was quite outdated I guess.

chase-lambert16:05:12

I am on lein 2.9.1. Is that good?

bozhidar16:05:26

Ah, ok. But every time you see clojure.tools.nrepl in the error you’re running an old server or you have a depedency on the old server.

bozhidar16:05:38

Yeah, 2.9.1 is as good as it gets.

chase-lambert16:05:58

Ahh. Maybe that old shadow-cljs dependency was calling to the old server? A bit above my head. Anyways, thank you for the quick response!

bozhidar16:05:17

Probably. You’re welcome!

gdrte17:05:45

@bozhidar Is there any shortcut/way to clear all the debugging break points? Thanks in advance.

bozhidar21:05:15

@gdrte You can just eval the whole buffer and that’s going to clear them.