Skip to content
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

Support for inline form evaluation + watching #391

Closed
mdedetrich opened this issue Jun 11, 2014 · 25 comments
Closed

Support for inline form evaluation + watching #391

mdedetrich opened this issue Jun 11, 2014 · 25 comments
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build released-eap Marks issues which have had the fixes released in an EAP build
Milestone

Comments

@mdedetrich
Copy link

Couldn't find an issue on this, but one of the (only) reasons for using an IDE like lighttable over cursive is its ability to evaluate clojure forms and display the results inline.

An even greater feature is the ability to watch certain forms, and whenever those forms are executed, you see the results of every s-expression that gets executed in those forms (this basically completely replaces debugging)

Here is a tutorial video for the evaluate expression
https://www.youtube.com/watch?v=7YIaHyTdjTY
And this one is for the watching feature
https://www.youtube.com/watch?v=d8-b6QEN-rk (note that this is for javascript, but it works the exact same way with clojure)

Are features like this expected to be integrated into cursive?

@cursive-ide
Copy link
Owner

Yes, I'd like to, and I'm investigating options. IntelliJ doesn't provide a lot of infrastructure for painting over the top of the editor, but there are a couple of ways that might work. I can probably re-use some of the hint infrastructure, which are the pop-ups you sometimes see at the cursor. I'm not sure when I'll add this but I'd like to at some point. I actually like the instarepl painting of intermediate values, too, although that's probably trickier.

@danielcompton
Copy link
Collaborator

Relates to (dupe of?) #133.

@cursive-ide
Copy link
Owner

To update this issue - IntelliJ 14 added support for inline painting of results. However the problem is that the results can only be a single line, and there's currently no good way to make them clickable to pop up an inspector window or anything like that. I'm discussing this with JetBrains, and I hope there'll be a good solution in IntelliJ 15.

@mdedetrich
Copy link
Author

Cool, thanks for looking into this!

@liango2
Copy link

liango2 commented Dec 4, 2015

Yes, I need this ability of evaluation + watching.

@mdedetrich
Copy link
Author

@cursiveclojure Any idea if this is easier with Intellij 15?

@mikeball
Copy link

Still interested in this feature, any updates?

@pradeepcheers
Copy link

@cursive-ide the images in the documentation show that there is an option for inline evaluation. I tried CMD + ENTER at the end of the line but it doesn't seem to work :(
image

@danielcompton
Copy link
Collaborator

@pradeepcheers those are just static comments that show what the answer would be, there is no inline evaluation capability yet.

@maksimr
Copy link

maksimr commented Mar 6, 2017

To update this issue - IntelliJ 14 added support for inline painting of results. However the problem is that the results can only be a single line

For me, it will be enough.
This thing really boosts productivity.

There already exists plugin which supports such thing for javascript's tests
wallaby-js

Thanks

@cursive-ide
Copy link
Owner

@maksimr Yes, I love Wallaby! It's a fantastic tool.

I'm going to try adding this soon to see how it works. My plan is to collapse collection results to a line, truncated if necessary. In the case where a structure is truncated, I'll provide a gutter icon you can click to get a data structure explorer.

@theronic
Copy link

theronic commented Jan 9, 2018

@cursive-ide please add this! :) Light Table left a gap in the market. I just want to quickly see the results of my thinking inline.

@alexisvincent
Copy link

Any progress on this? :)

@Nimamoh
Copy link

Nimamoh commented Sep 7, 2018

It'd be so great

@coold
Copy link

coold commented Aug 10, 2020

@cursive-ide any updates?

@theronic
Copy link

theronic commented Oct 4, 2020

I would love love love to see this in Cursive, because I keep going back to Light Table to debug tricky algorithms and to teach Clojure.

I know Cursive is committed to IntelliJ right now, but it would be worth it to render the evaluated with inline results in a separate window, and in the long-term you'll probably need to do your own rendering.

@theronic
Copy link

theronic commented Oct 5, 2020

The Calva extension for Visual Studio Code shows the result of the entire expression as an inline comment after the code, but this totally misses the point of debugging intermediate steps, which is what Light Table lets you do, and greatly aids understanding in long threaded pipelines.

Here is a (crappy) macro I wrote to print intermediate results of a let-binding to logs to achieve something similar (using Specter :as S):

(defmacro let-spy
  [bindings & body]
  (let [pairs   (partition 2 bindings)
        rebound (into [] cat (S/transform [S/ALL (S/nthpath 1)] #(list 'log/spy :debug %) pairs))]
    `(let ~rebound ~@body)))

Surely this should be possible to do in the IDE given that Cursive already has to parse every expression?

@muhajirdev
Copy link

any update about this?

@classicrob
Copy link

I'm still curious about this! I'd love it.

@cursive-ide
Copy link
Owner

This is actually the next big new feature I'm working on, but it's stalled momentarily while I have to look at some other things. But, it's on the way.

@JacobGood1
Copy link

How is it going, is this feature incoming soon? =)

@mikeananev
Copy link

This plugin clj-extras-plugin can do inline code evaluation.

@cursive-ide cursive-ide added this to the 1.14.0-eap1 milestone Sep 13, 2024
@cursive-ide cursive-ide added the new Marks issues describing new features label Sep 13, 2024
@cursive-ide
Copy link
Owner

Fix released in 1.14.0-eap1 on 2024-09-13.

@cursive-ide cursive-ide added the released-eap Marks issues which have had the fixes released in an EAP build label Sep 13, 2024
@galemsky-hs
Copy link

galemsky-hs commented Oct 21, 2024

@cursive-ide as far as I see, the inline print/result display was implemented, but not the watches, correct?

@cursive-ide
Copy link
Owner

Fix released in 1.14.0 on 2024-11-13.

@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build released-eap Marks issues which have had the fixes released in an EAP build
Projects
None yet
Development

No branches or pull requests