-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cljc buffers not evaluated in cljs repl by cider-load-buffer #1875
Comments
Sounds like some regression to me. Probably fixing this would be easy, but I won't be able to look into this for a while. |
@bbatsov I'll give it a stab. |
I've confirmed that simply changing the major mode of the
|
Still digging, but it looks like after the It looks like something is setting the ClojureScript REPL |
Beginning to wonder if this has something to do with the nrepl callback queue. Here's a log of activity when
With the caveat that I know very little about this system, it looks like the callbacks are called twice for the clj connection (session id |
Perhaps it's possible that the state tracker middleware is below the load-file middleware, so once you call load-file cider gets confused. Technically I can't see how that would produce the results you observe, but it's the closest I can think of to a lead. 😕 |
So the code goes through In setting the |
OK. It definitely shouldn't go through the function the second time. I guess we need to rethink the code flow here a bit. |
Ok, I think I've gotten to the bottom of the issue. The problem is that the session for cljs is being marked as clj type, as @leppert mentioned earlier. The issue (I think) is that when you load the buffer, it doesn't fully respect the connection that its given:
So here, the connection is looked up but session is grabbed independently of this. And there's our bug. We say do this to cljs repl and it does on that connection, but it grabs the clj session info. And when the state info comes back, it marks it as a clj repl for the future. |
This can be closed now as well. |
Great work on this, y'all, this removes a major pain point for me. Really appreciate this, and all of your work :) 💯 |
Expected behavior
After running
cider-jack-in-clojurescript
,cider-load-buffer
loads the cljc buffer in both the Clojure and ClojureScript REPLs per thecider-load-buffer
docstring.Actual behavior
The buffer is evaluated in the Clojure REPL but not the ClojureScript REPL.
Steps to reproduce the problem
cider-jack-in-clojurescript
C-c M-n
to load the namespace. Note: this works correctly in both REPLsC-c C-k
to eval the buffer(foo "bar")
in the Clojure REPL will now correctly printbar Hello, World!
(foo "bar")
in the ClojureScript REPL will throw the errorWARNING: Use of undeclared Var /foo at line 1 <cljs repl>
Environment & Version information
CIDER version information
Lein/Boot version
Leiningen 2.7.1 on Java 1.8.0_40 Java HotSpot(TM) 64-Bit Server VM
Emacs version
GNU Emacs 25.1.1 (x86_64-apple-darwin16.0.0, NS appkit-1504.00 Version 10.12 (Build 16A320)) of 2016-09-21
Operating system
macOS 10.12 (16A320)
The text was updated successfully, but these errors were encountered: