-
-
Notifications
You must be signed in to change notification settings - Fork 651
[Fix #1299] Eval in both REPLs for cljc and cljx #1399
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
Conversation
|
The build result doesn't make sense to me. I'm not even sure what the difference between the two builds are. |
|
There's just one shortcoming of the current implementation - the responses from the two requests will be interleaved, meaning most people will probably not realize what's going on. @Malabarba and I mentioned this yesterday as the biggest issue we need to tackle - how to handle the 2 return values that we'd get from operations like this one (or eval on multiple connections). |
13bbde4 to
a78f883
Compare
Which build result? |
a78f883 to
ece9bdb
Compare
cider-interaction.el
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole diff should be implemented as a macro that checks for (cider--cljc-or-cljx-buffer-p). This can then be used on the already-merged namespace switching too. Here's an example of how it would work:
(cider-do-connections (conn)
(cider-nrepl-request:eval (format "(in-ns '%s)" ns)
(cider-repl-switch-ns-handler conn)
conn))
This will make it easy for us to customize this behavior, implement a toggle variable, etc.
|
Ok. I like this feature more than I initially did. I think dispatching load-file to both repls is a good default.
|
There will definitely be some period of bug fixing after the initial release, so I wouldn't worry that much about this. At some point we'll have to invest into better tests for the connection-related functionality, though. :-) |
|
I don't think I'll have time to make these changes this week. If anyone else wants to take this across the finish line that would be great, if not I'll probably have some more time for CIDER next week. I also think this needs a bit more manual testing. |
I don't see why files vs buffers is a meaningful distinction here, however.... Once we starting doing this for local operations (eq, eval-last-sexp), the macro will have to take a keyword that indicates that we also care about local context. So we could also use a keyword to indicate we only care about the file extension, and not the major mode. |
|
[Stupid Artur stupidly erased this comment by accident.] |
|
This feature is now blocked on #1400 I can't test this because the middleware is constantly setting the repl type to the wrong value. |
|
Oh god. I just realised I think I edited your comment instead of posting a comment. 😱sorry about that!
I prefer to check for This is simpler, and makes it easier for the user to configure the behaviour. If the user has manually configured |
|
Aight, once I can test this feature I will rewrite |
CHANGELOG.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.cljc or .cljx
|
One small remark about the commit message title - it's a bit unclear in it which eval is being referred to there. Today for moment I decided you've implemented interactive eval operations for cljc files as well. :-) |
The current patch affects both |
Don't see why we shouldn't do it for it as well. |
5d6f67e to
61ee56a
Compare
|
Rewritten in terms of |
|
What can I do about this |
|
Use make-symbol instead. |
61ee56a to
a2856c2
Compare
|
Apart from my small remarks the code looks good to me. |
a2856c2 to
54684d8
Compare
|
Just rebase this and let's have it merged. I doubt it will break anything. |
cider-client.el
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should still be a (car cider-connections) as a last clause here. Otherwise this function might return nil.
|
Don't merge yet. I tested it and it seems to be breaking the state tracker. @expez, do you have any local work on this, or can I rebase it to current master? |
|
Go ahead and rebase. |
399b355 to
f197e4b
Compare
|
I've found what the problem was. The “connection” and “session” specified in the load-file request didn't match (mostly because of -ensure-session), so everything got messed up. Most relevantly, the state-tracker was sending information about the cljs session to the clj connection, which is why the repl-type info went wrong. Overall, I think we should start purging |
64ea636 to
26116ae
Compare
|
I changed do-connections to a function, map-connections. Sadly, we don't yet live in a world where inter-file macros are super |
|
The tests are failling due to byte-comp warnings from the new message-logging. |
* repls -> project-connections * Fix considering all connections in the branch for project connections. AFAICT this only worked correctly because of the order in the list being checked.
This function would fail when nil was propogated as the ns to act on. I encountered this in `profiles.clj`.
This changes the load file request to dispatch to `cider-other-connection` in addition to `cider-current-connection`, when the file is a cljc or cljx file.
nrepl-client now derives the session from the connection automatically. There was a bug because in some requests specified a connection different from the current one, but then ensure-session took the session from the current-connection.
37f6be9 to
cf54439
Compare
Damn, I totally forgot about this. I know what you're referring to - an odd usage of the logging regarding some errors. |
Purge it how? It's appended requests that don't have it, but there you can't automatically have there the tooling session if you want to use it. I was thinking lately because of the middleware exceptions that maybe the middleware requests should operate on the tooling session. |
[Fix #1299] Eval in both REPLs for cljc and cljx
|
Ah, looking at the change you've made we can remove most usages of it I guess. That was my idea with appending the session automatically actually, but I guess it makes more sense to do so where the connection is explicitly known. |
|
Yes. My thoughts were to just replace current-connection with nil everywhere, so we could still specify a connection if we ever want the tooling connection. |
You meant Yeah, let's focus on fixing everything else that's important right now. I addressed the failing build in the morning and will try to refine/update the documentation in time for the release. As the next two days will be busy for me at work I doubt I'll be able to work or more bug fixes/features before the release. |
|
Thanks for taking this one across the finish line @Malabarba! |
This changes the load file request to dispatch to
cider-other-connectionin addition tocider-current-connection, when the file is a cljc or cljx file.