Reputation: 10151
When debugging in eclipse, I selected expression and pressed ctrl+i and then ctrl+d. Then I see my expression in display view and there I can evaluate any java code. Is there such view in intellij-idea?
Upvotes: 17
Views: 7613
Reputation: 3
If you want the same behavior as "Display" window in Eclipse, just press alt+F8 and then click on "code fragment mode".
Upvotes: 0
Reputation: 1561
I'm an eclipse user and I know exactly what you mean by running code in display view. check this
double shift (or find anything) -> evaluate expression -> Click code fragment
check console for the code that I run in debug mode
Upvotes: 8
Reputation: 40378
I'm not familiar with the exact behaviour in eclipse, so i am guessing a little here, but you should be able to do the same thing in two ways.
Given you are debugging and have stopped at a breakpoint, you can evaluate an expression that is valid in the current scope by highlighting it, hitting alt-f8 and then enter - or the quick version is simply ctrl-alt-f8
Or you may prefer to right click on the expression and choose Add to Watches (in the Debug pane, ensure you have selected the Debugger panel, rather than Console).
Good luck!
Upvotes: 10