-
-
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
Feature Request : Have cider-eval-last-sexp prompt for context #2113
Comments
I don't think that's a good idea. |
I thinks its a good idea, it would be useful to quickly test a sexp without needing to adding temporary changes to the buffer. Maybe not as default behaviour for |
That should definitely not be the default behaviour. The debugger already has similar functionality, so I'm guessing it can be leveraged for this as well. Whether this is easy or not I do not know - maybe @Malabarba can shed some light on this. |
@l0st3d have you tried https://github.com/vvvvalvalval/scope-capture ? |
Btw, I know it's not the same, but some of you might find useful the new |
Reading again @l0st3d's simple idea about just asking the user to supply some let-bindings and remembering those across invocations I decided to implement it. Parsing an expression for locals and prompting just for those would be fancy and is not a rocket science, but I simply don't have time to work on it, so let's just leave it to the user to provide whatever bindings they want. |
I just found this cool feature! :) I ran into it while looking if there would be a way to define a dynamic var around a form in the middle of a clojure.test test. I've been writing tests so that I have a (binding [fixture/*test-system* reloaded.repl/system]
(is 42 (get-answer-from-api)))
|
So I remembered that this is Emacs: replaced the let with binding, did eval, and voilà, got what I wanted :) Didn't yet have enough energy to look how this could be a thing in cider though :/ |
It might be nice if, when trying to eval an sexp from the middle of a function, there was some way to inject some form of context. I'm imagining something like wrapping the form in a let before trying to eval it. Ideally CIDER would prompt me for each of the undefined forms either by analysing the code before evaluation, and remember my previous input, but I'd be happy with just being prompted for a let-binding form to insert, which could default to an empty vector. The idea is to not have to pollute the namespace I'm working in with temporary vars that I need to remember to remove and undefine later.
The text was updated successfully, but these errors were encountered: