Fork me on GitHub
#cursive
<
2016-05-10
>
moizsj07:05:06

@cfleming: I consistently have an issue with the Leiningen Tool Winow's Synchronize action. It causes Cursive to remain unresponsive for a minute or two even after its done. (post sync, indexing, etc)

cfleming09:05:24

I don’t know what’s up with that, I use a retina screen and I don’t see that.

stunami12:05:20

Looks like this is perhaps unexpected behaviour, as its not consistent between the REPL and the standard editor window.

stunami12:05:46

(I dont have the problem when in the window under the REPL)

gpetukhov18:05:33

Hi. Why when I debug, the debugger is getting stuck on the same endpoint? Only after I press step-over several times, it gets to the next line.

cfleming22:05:21

@stunami: This looks like https://github.com/cursive-ide/cursive/issues/1386 - I haven’t managed to reproduce it in the debugger unfortunately.

cfleming22:05:45

Restarting IntelliJ seems to fix it, which I’m ashamed to recommend you do - sorry

cfleming22:05:42

@gpetukhov: That is usually because on that line, you have a macro which expands to more than one statement. I haven’t figured out how to make the debugger force step to the next line always.

gpetukhov22:05:41

@cfleming: thanks! is there a way to inspect how the data is being transformed inside a macro such as ->>?

cfleming22:05:38

@gpetukhov: Yes, you can use Tools->REPL->View macroexpansion

cfleming22:05:32

It’s interactive - initially it will show you the original unexpanded form, then you put the caret in the part you’d like to expand and either press the right arrow toolbar button, or Ctrl/Cmd-Right

cfleming22:05:54

That will expand from the root of the form to the point around the caret so you can see what the resulting code will look like.

gpetukhov22:05:30

@cfleming: I did what you said but pressing the right arrow in the macroexpansion tool doesn't do anything

cfleming22:05:06

@gpetukhov: Do you have the caret inside the form you’re trying to expand?

gpetukhov22:05:18

@cfleming: yes. I tried putting it everywhere.

cfleming22:05:56

That looks like it should work. And you have the REPL running, and that namespace loaded into it?

gpetukhov22:05:51

@cfleming: yes and yes. where should the expansion show up?

cfleming22:05:17

In that same window. It’ll highlight what has changed.

cfleming22:05:46

Are you getting any errors showing in the status bar at bottom right?

gpetukhov22:05:50

I know why it did not work

gpetukhov22:05:10

It is because it was at the breakpoint

stunami22:05:16

@cfleming: thanks mate, I'll have a poke to see if I can find anything useful before a restart.

cfleming22:05:29

Yes, that will do it - the REPL doesn’t respond in that case.

cfleming22:05:41

Interesting case, I wonder if I could fix that.

cfleming22:05:51

@stunami: Thanks, let me know if you find anything.

cfleming22:05:42

@gpetukhov: In general, when the JVM is stopped at a breakpoint, everything is frozen and evaluation has to be done in a special way.

gpetukhov22:05:51

So it is just expanding the macro which I could do with macroexpand function anyway. But I was wondering if I could debug my code with intermediate values showing up. So, as on the photo, I would like to see the value created by forms->postfix while I am stopped at postfix->value.

cfleming22:05:03

In general, that’s difficult. It’s because the JVM debugger is line-oriented, and the macros expand out to code which doesn’t correspond accurately to the original source lines.

cfleming22:05:21

I don’t have a good solution for that yet, sorry.

cfleming22:05:48

What you can do, assuming your calls are pure functions, is use the expression evaluator, and just evaluate part of the expressions

cfleming22:05:04

i.e. evaluate (-> expr (forms->postfix))

gpetukhov22:05:19

In repl, right?

cfleming22:05:30

No, because the REPL is frozen.

cfleming22:05:43

In the debugger window, there’s an expression evaluate button.

cfleming22:05:47

If your result is a lazy seq, wrap it in vec to see all the elements realised.

gpetukhov22:05:48

Hmm getting nullpointerexception

gpetukhov23:05:10

Anyway, thanks Colin!

cfleming23:05:43

@gpetukhov: No worries, good luck!