Fork me on GitHub

@bozhidar Thanks for the nREPL improvements. I just tried connecting to an nbb server with CIDER 1.4.1 but it still didn't work for me


Well, connecting worked :)


I still have to go into clojure-mode to be able to evaluate things from a .cljs buffer. Connecting with clojurescript-mode and then choosing the custom REPL type doesn't do it either


cc @U07SQTAEM - Perhaps also try with Hubble?


thanks for the release from me as well!! Also tried it with the clerk nrepl and connecting worked but not eval so the same behavior that you saw @U04V15CAJ


That's a different problem and it will be addressed separately. Basically the issue is that CIDER now thinks that the connection in Clojure not ClojureScript. There are a couple of ways to solve this, but I'm still wondering what's the best option.


I'm guessing that manually setting the type of the connection should fix this problem as well.


Still, I'm thinking that probably a better fix would be to just dispatch to whatever connection there is if there's a single connection within a session and just disregard the connection type check.


Decisions, decisions... 😄


How to set the connection type?

David Pham07:05:32

Is it cider-set-repl-type emacs function?


You can ignore the part about the middleware, as this is only relevant to hosted ClojureScript REPLs.


While I agree with @U04V15CAJ that it shouldn't matter whether it's a clj or cljs REPL for connect to work, in the meantime should we be able to use cider-connect-cljs?


what’s this needed for? Might be nice if we could get at least the (especially eval + completions) could work without a repl detection?


@U07SQTAEM No, cider-connect-cljs didn't work either :/ You still need the custom snippet, I documented that here:


> could work without a repl detection Yes, that's the whole point of just using nREPL as a protocol, there should be no REPL type detection necessary, or at least, if you try to do it, fall back on something that assumes nothing specific.


cider-connect-cljs doesn't work for non-hosted REPLs yet, which is part of the problem.


@U04V15CAJ The REPL type is needed mostly because a common workflow was to have 2 different REPLs for the same project and we needed some way to figure out which evaluations to go into which REPL. That's not really related to nREPL, but was rather an artefact of how people were using CIDER.


In hindsight I almost regret moving away from the early design where you simply had to select what REPL you want to use manually. This worked flawlessly, but required people to do some manual work when running multiple REPLs.


Isn't that managed by sesman now?


All the logic to detect automatically which REPL is related to which source file resulted in some problems.


@U04V15CAJ Yep. Sesman replaced the old code in CIDER, but it didn't really solve anything related to the REPL types. It's main focus what to simplify the grouping of REPLs by mapping them to project paths.


You can still have different types of REPLs in the same project and you need to figure out which one you want to use.


Anyways, all of this is fixable, I'm just trying to explain that this time around the problem is not really nREPL-related. I'm still wondering how to best address this in CIDER.


@U5H74UNSF This detection is mostly for the purpose of not sending the code to be evaluated in the wrong REPL. This may or may not be a problem depending on one's perspective.


(e.g. you're in a ClojureScript source file, but you have two REPLs running)


I see, yeah this would become less automatic but maybe manual selection is actually good here? I’m often confused when things get evaluated in two repls.


Seems like a buffer-local variable binding would be good for this — though less convenient than magical auto-detection, obvs.


sesman-link-with-buffer should also work, I think?


Yeah, there are workarounds, but ideally things should just work out-of-the-box for everyone. I'll keep thinking about a proper solution.


To give you a bit more context - the problem is the cider-repls functions, which we happen to be discussing in a PR currently


As you can see it filters the available REPLs by their session and by their type to decide which are the valid options.