0

我很确定我已经设置了 Emacs、Ensime、SBT 和 Scala 以正常工作。当我保存并成功尝试使用 ensime 的自动重构工具时,我能够编辑文件并查看类型错误。

问题是当我通过按下打开 REPL 时C-c C-v z,似乎我的文件中没有任何内容被加载。

换句话说,如果我定义类似

class Moose {}

在我的源文件中,这就是我尝试Moose从 REPL使用时发生的情况

scala> Moose
<console>:8: error: not found: value Moose
              Moose
              ^

scala> new Moose
<console>:8: error: not found: type Moose
              new Moose
                  ^

将某些内容(例如当前缓冲区内容)加载到 REPL 中的最佳方法是什么?

4

1 回答 1

0

I found out that there was actually no problem with the REPL. I had been trying to compile my project by pressing C-c C-b b and assumed it was working the buffer *ENSIME-Compilation-Result* would pop up with:

Latest Compilation Results (q to quit, TAB to jump to next error)
----------------------------------------

0 errors, 0 warnings.

But, I checked in the target/scala-2.10/classes directory and found that no .class files were being generated.

When I instead compiled from the command line with sbt, I was able to then get a REPL loaded with what I expected.

EDIT:

I posted a follow-up question: Building with Ensime deletes all .class files, but doesn't compile anything.

于 2014-02-04T22:55:59.193 回答