如何在 Eclipse 中禁用重构后自动保存?
当我运行内联和提取局部变量重构时,Eclipse 立即保存了我的文件。此外,撤消/重做这些重构每次都会重新保存文件。我怎样才能禁用这种行为?
第二个问题:运行提取方法没有自动保存文件。为什么行为不一致?
When I ran the Inline and Extract Local Variable refactorings, Eclipse saved my file immediately after. Also, Undoing/Redoing these refactorings resaved the file each time. How can I disable this behavior?
Secondary question: Running Extract Method didn’t automatically save the file. Why the inconsistent behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要禁用它,您可以检查它是否是由于在首选项(常规 > 工作区)中启用了自动构建和构建前自动保存引起的。第二个问题不知道。
To disable it, you could check if it is caused by having both Build automatically and Save automatically before build enabled in the preferences (General > Workspace). No idea about the second question.
也许问题是你为什么不希望 eclipse 保存它?就我而言,我不希望 Eclipse 保存我的更改,因为我在 Eclipse 中运行 Tomcat,并且它在每次重构后重新加载应用程序(我在调试代码时更改了代码),我只是希望它继续执行之前的代码。解决方案是将 Tomcat 的发布部分配置为不自动发布。
Perhaps the question is why would you not want eclipse to save it? In my case, i didn't want eclipse to save my changes because i was running Tomcat in eclipse and it reloaded the application after each refactoring (i was changing the code as i was debugging it) and i just wanted it to continue executing with the previous code. The solution was to just configure the Publishing section of Tomcat to not publish automatically.