简体   繁体   中英

IntelliJ IDEA inspect variable like Eclipse (Cmd-Shift-I)

I recently moved from Eclipse to IDEA and by and large have been very pleased with it. However, there is one Eclipse feature that I miss terribly after all this time: evaluating expressions on-the-fly while debugging .

The way debug expressions are rendered by default in IntelliJ IDEA produces very long tooltips which are kind of hard to dismiss (and more importantly very hard to read while trying to sift through the information being displayed). By contrast, Eclipse renders debug expressions using a two-pane popup window which includes a text area to display text inclusive of newlines thus making the display far more optimal (see attached pictures).

IntelliJ IDEA 愚蠢的IDEA工具提示

Eclipse Eclipse工具提示

Is this something we need to live with?

I think you are using Expression Mode , which shows tooltips

Intellij IDEA provides two evaluation methods

Expression Mode for evaluating single-line expressions.
Code Fragment Mode for evaluating short code portions. You can evaluate declarations, assignments, loops and if/else .

These two method can be used depending upon your situation

Evaluating expressions or code fragments in a stack frame (this is your case I guess)
To evaluate an expression or a code fragment in a stack frame, do the following:

  1. In the Frames pane, select the thread where you want an expression to be evaluated.
  2. Click 在此处输入图片说明 on the Stepping toolbar in the Debug tool window.
  3. Select an evaluation mode. If you want to evaluate a code fragment, click the Code Fragment Mode button.
  4. Depending on the selected mode, type the expression or statements to evaluate in the text field and click Evaluate.

Go to this Documentation Link for detailed instructions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM