在Intellij Idea中一次评估多个表达式 [英] Evaluating many expressions at once in Intellij Idea

查看:528
本文介绍了在Intellij Idea中一次评估多个表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Intellij Idea中,我正在寻找一种方法,可以使用一个命令在调试模式下评估多个表达式。

In Intellij Idea, I'm looking for a way to evaluate many expressions in debug mode with one command.

通常我可以用<$ c来评估单个命令$ c>右键单击→评估表达式( ALT + F8 )。我想有可能评估一堆表达式,如:

Normally I can evaluate single command with Right Click → Evaluate Expression (ALT+F8). I would like to have possibility to evaluate a bunch of expressions like:

System.out.println(myVar1);
System.out.println(myVar2);

在Eclipse中可以执行这样的表达式脚本,但我找不到解决方案在Idea中。

In Eclipse this is possible to execute such "script of expressions", but I can not find a solution in Idea.

推荐答案

您必须在评估表达式对话框中单击代码片段模式( Alt + F8 )你可以输入任意数量的行而不是单行 - 这是默认的 - 表达模式。

You have to click "Code fragment mode" in the evaluate expression dialog (Alt+F8) and you can enter as many lines as you want instead of single line - which is default - "Expression mode".

然后您可以随时使用表情模式切换回来按钮。

Then you can switch back anytime using "Expression mode" button.

这篇关于在Intellij Idea中一次评估多个表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆