-
-
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
Executing cider-pprint-eval-last-sexp evaluates sexp twice #2090
Comments
Is this in cljc file by chance? This is because the code is executed in both repls. I think this is the correct behavior. |
Thanks for your answer. I found that it is really related to cljc file only. I investigated it more and I found that if I have only one repl connection (with type Clojure) and I execute
The behavior for |
I changed issue description with information that it happens only for cljc files and if |
Yeah, that's certainly a bug and I think it should pretty easy to fix. |
According to @vspinu this is expected behavior? What should the behavior be? |
Well, I'm actually surprised this is done 1 time for dynamic dispatch and 2 times for static - I would have expected it to be the other way around, as dynamic dispatch would normally figure out that 2 connections are an option for some evaluation in a cljc file (if both the clj and cljs) connection are already present that is. Probably we should make it explicitly configurable what happens when you evaluate code in cljc files, though. There are too many assumptions about what people need right now. |
Indeed. It should be the other way around. I will look into this today along with the other connection related issue that I promised to fix. |
Checked it up. The behavior with the dynamic dispatch is as expected, the code is evaluated once for each dialect (once in clj buffer and once in cljs buffer, so twice in total). With static dispatch the code is evaluated twice in clj buffer. So static dispatch is broken then. Fixing this would require adding yet another hack to the pile of hacks already in place, and I am not particularly keen on it. IMO static dispatch should be deprecated and connection system rewritten, but I guess you already know my take on this ;) |
So this problem should go away when #2069 is merged? |
Well, #2069 removes static dispatch, so yes it "fixes" it. |
I guess we do. Well, it'd be nice if we still fix this in scope of 0.16, as the connection handling changes are certainly not going to happen before 0.17. I can't imagine fixing this is particularly complex. |
😭 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it. |
Expected behavior
Executing
cider-pprint-eval-last-sexp
in cljc file whencider-request-dispatch
is set to'static
with one (Clojure type) only repl connection should evaluate sexp once.Actual behavior
Executing
cider-pprint-eval-last-sexp
in cljc file whencider-request-dispatch
is set to'static
with one (Clojure type) only repl connection evaluates sexp twice.Steps to reproduce the problem
Set
cider-request-dispatch
to'static
Type in cljc file:
Execute:
cider-pprint-eval-last-sexp
The popup buffer will contain:
Environment & Version information
The text was updated successfully, but these errors were encountered: