Update to 0.4.1. Test output appears again! Thank you @mauricio.szabo!
About this issue: https://github.com/mauricioszabo/atom-chlorine/issues/139, do you think it's better to add REBL integration directly on Chlorine, or keep it as an add-on version? I'm not really sure myself (I don't use REBL that much).
If I read @seancorfield's code right, not using REBL shouldn't matter for his case. BUT, as I noted in the issue, it doesn't work for me, which is why I had switched back to the Chlorine version of Inspect Block when I stopped using REBL.
inspect-block
is only for REBL. It makes no sense to use it without REBL. You should just use eval-block
.
If my code doesn't work without REBL on the classpath, that's a bug I need to fix.
@mauricio.szabo unless you're going to support the full range of "inspect" functions, I see no value in Chlorine supporting REBL "partially".
I used to have the keymap wired up to use Inspect Block regardless of whether REBL was in use, since I'm pretty sure it used to work in either case. But I recently switched jobs and rebuilt the environment from scratch (without REBL installed), and your Inspect Block wasn't working, so I switched to Chlorine's version.
Yes, it should work without REBL -- it should be identical to eval-block
What's the difference between the inspect-block
and evaluate-block
commands in Chlorine?
But if you're not using REBL you might as well just use bare eval-block anyway
Something is screwy with how the block is scoped. What's happening is that evaluate-block
scopes differently based on cursor position than Chlorine's inspect-block
. Take this expression: (vec (gen/sample sql-gen/stmt-text-gen 100))
. If the cursor is inside the last closing paren, evaluate-block
evaluates the entire expression, inspect-block
evaluates the (gen-sample...)
bit to the left of the cursor. Your inspect-block
has the same behavior as Chlorine's evaluate-block
. The behavior when the cursor is to the right of a top-level s-expression is to do nothing, which I interpreted as "not working", whereas Chlorine's inspect-block
would evaluate the s-expression to the left of the cursor (prior to 0.4.0).
inspect-block
is using some old APIs that I was removing little by little (and on 0.4.0 I removed some, but forgot to migrate the code)
Presumably that's the source of the exception, and I should be using evaluate-block
instead of inspect-block
?
@dave.dixon not really, I'm gonna fix the inspect-*
versions for now and then we can decide on how to progress (migrate the code, remove it altogether, extend with Sean's version, etc) ð
Also, I think that "Evaluate top block" could understand (+ (* 2 3) 4)| as "evaluate the whole expression before me" (I think it's not working like this right now)
@dave.dixon I just tried my inspect-block
command on a Socket REPL connected to a remote machine that has never seen REBL and it worked just fine. Sounds like I'll need to dig into your setup a bit deeper to figure out why it isn't working for you. I'll be free in about 30 minutes for that.
Actually, it is working. It just isn't working how I expected, see the description in the 6:10AM thread.
By the way, I also fixed the Chlorine version, but it'll use the new API for detection of blocks
(I'm just checking other things so that I can publish a new version)
Got it. At some point, inspect-block
worked that way. I got used to just cmd-tabbing between the end of top-level s-expressions, and then cmd-enter to evaluate. I assume others have something similar wired up, but working with evaluate-block
?
Sounds like inspect-block
is maybe intended to be more like "evaluate expression to the left of the cursor"? So using your example:
(+ (* 2 3) 4|)
=> 4
(+ (* 2 3)| 4)
=> 6
(+ (* 2 3|) 4)
=> 3
(+ (* 2 3) 4)|
=> 10
Ah, inspect-block
was written using the older expression-finding logic and that "broke" at some point and @mauricio.szabo fixed it for evaluate-block
. My commands use the API which I think "does the right thing" now?
Yes, exactly. In fact, I'm using the same API that is available for extensions to implement this version of REBL
It does, and is consistent with evaluate-block
. It's just not what I want ðĪŠ But I may just have to adapt my workflow.
(+ (* 2 3) 4|) ;=> 10
(+ (* 2 3)| 4) ;=> 10
(+ (* 2 3|) 4) ;=> 6
(+ (* 2 3) 4)| ;=> does not work
That last one is kind of annoying, I agree.It used to work, but no longer does.
(that's my inspect-block
BTW which I believe is consistent with the built-in evaluate-block
)
Yes. On evaluate-block
, it'll probably not work anymore. On top-block
, I'm checking if I can make it work