-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
require and in-ns ns in separate forms for cider-repl-set-ns #2994
require and in-ns ns in separate forms for cider-repl-set-ns #2994
Conversation
That handler should have a docstring indicating its subtle behavior: to swallow the nil that comes back from requiring. I always go back and forth if the name should be what it does, ie |
fix for #2993 |
Do we really need an extra handler for this? Seems to me that we can just do a |
cider-repl.el
Outdated
(format "(do (require '%s) (in-ns '%s))" ns ns) | ||
(format "(in-ns '%s)" ns)) | ||
(when cider-repl-require-ns-on-set | ||
(cider-nrepl-request:eval (format "(require '%s)" ns) |
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.
Here I'd just do a sync eval of the require and we should be good.
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.
awesome! I had a feeling there would be a more concise way of doing this. thanks
cider-repl.el
Outdated
(format "(do (require '%s) (in-ns '%s))" ns ns) | ||
(format "(in-ns '%s)" ns)) | ||
(when cider-repl-require-ns-on-set | ||
(cider-nrepl-sync-request:eval (format "(require '%s)" ns))) |
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.
Don't forget the connection param here.
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.
and the ns param?
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.
It's not needed in this case.
Thanks! |
I think I had to create a new nrepl response handler in order to ensure it wouldn't cause two new prompts. Tested in two cljs environments, where it works fine. Feedback very welcome!