简体   繁体   English

在调试intellij时模拟返回

[英]Simulate return while debugging intellij

Is there any way to return from the current step during execution in debug mode and not to stop the app? 在调试模式下执行期间有没有办法从当前步骤返回而不是停止应用程序? I see this like debugger should insert return statement when you press the 'exit button' for example. 我看到这就像调试器应该在按下“退出按钮”时插入return语句。

The main usecase of this behaviour is in fast response of refactoring\\rewriting of long methods; 这种行为的主要用途是快速响应重构或重写长方法; when you want to test first part of it and not to trigger save\\update\\delete actions at the end of it. 当你想测试它的第一部分而不是在它结束时触发save \\ update \\ delete动作时。

The question is concerned Intellij primarily, but other IDEs experience also is interesting. 问题主要涉及Intellij,但其他IDE的体验也很有趣。

IntelliJ 15 (which is in Release candidate stage as of writing this post) has debugger feature called Force early return which does exactly what you want. IntelliJ 15(在发布此帖子时处于候选发布阶段)具有调试器功能,称为强制提前返回 ,它完全符合您的要求。

You can explicitly specify which value to return and choose whether you want to invoke any finally blocks. 您可以显式指定要返回的值,并选择是否要调用任何finally块。 More information about this feature can be found on IntelliJ blog. 有关此功能的更多信息,请访问IntelliJ博客。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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