Scala sbt 控制台 - 代码更改未反映在 sbt 控制台中 [英] Scala sbt console - code changes not reflected in sbt console

查看:32
本文介绍了Scala sbt 控制台 - 代码更改未反映在 sbt 控制台中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 scala sbt 控制台来测试我的方法.(命令:sbt 然后 控制台)但是在 eclipse 或其他外部编辑器中完成的代码更改并没有反映在 sbt 控制台中.

I use scala sbt console to test my methods. (commands : sbt then console) But the code changes done in eclipse or other external editor, are not getting reflected in the sbt console.

每次,我都必须退出控制台(使用 Crt + D)并再次使用 console 命令启动它以查看更改.

Every time, I have to quit the console (using Crt + D) and again start it using console command to see the changes.

有人遇到过这个问题吗?有没有办法从控制台重新加载代码?

Any one facing this problem? Is there any ways to reload the code from console?

我使用的是 64 位 Ubuntu,

I am using Ubuntu 64-Bit,

推荐答案

并非没有使用 JRebel 之类的东西,主要是因为类定义可能会以这样的方式中断,从而使已加载的实例无法使用.我唯一的建议是使用 ~console 运行控制台,这样如果进行了更改,它们将被重新编译并重新进入控制台.

Not without using something like JRebel, mostly because class definitions could break in such a way as to make instances already loaded unusable. The only suggestion I have is to run the console with ~console so that if changes have been made they will be recompiled and the console re-entered.

此外,如果您定期运行一组命令,initialCommands sbt 设置会将命令配置为在启动控制台后立即运行.

Also if you're regularly running a set of commands the initialCommands sbt setting configures commands to be run immediately after starting the console.

这篇关于Scala sbt 控制台 - 代码更改未反映在 sbt 控制台中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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