Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Immediate' window for IntelliJ

I'm using IntelliJ 9 and I'm curious if there is any IntelliJ equivalent of the Visual Studio 'immediate' debug window. There is selecting the desired expression in the editor, then ALT-F8 to evaluate the expression, but I'd like to be able to write code in a window that interacts with what I am currently debugging (if that's even possible).

Having breakpoints that log messages to the console is helpful, but I'd like to do more than that if I can.

like image 200
Jon Onstott Avatar asked Jun 24 '10 17:06

Jon Onstott


People also ask

What is the shortcut key for immediate window?

To display the Immediate window, open a project for editing, and then choose Debug > Windows > Immediate or press Ctrl+Alt+I. You can also enter Debug. Immediate in the Command window. The Immediate window supports IntelliSense.

What is the difference between immediate window and window?

The differences between the Command and Immediate windowsThe Command window can load dlls or packages into the IDE as well. The Immediate window, on the other hand, is solely used during debugging and is useful to execute statements, print values of a contextual variable, or even evaluate expressions.

How do I open the variable window in Intellij?

Step Over (F8) lets you execute a line of code and move on to the next line. As you step through the code, you'll see the value of the variables next to the code in the editor window. These values are also visible in the Variables pane in the Debug window.


2 Answers

Intellij IDEA's Expression Evaluation dialog has a button to enable Code Fragment Mode, which permits multi-statement evaluations. (I'm using version 9.0.2 of the Ultimate Edition.)

like image 94
Noel Ang Avatar answered Oct 09 '22 23:10

Noel Ang


Same as @Noel answer, but some more details. First of all, Expression Evaluation (ALT + F8) can be enabled only in debug mode.

enter image description here

enter image description here

like image 26
om-nom-nom Avatar answered Oct 10 '22 00:10

om-nom-nom