简体   繁体   中英

Emacs Scala Ensime: Opening REPL does not load anything from my project

I am pretty sure I have setup Emacs, Ensime, SBT, and Scala to work together properly. I am able to edit files and see type errors when I save and have successfully tried using ensime's autorefactoring tools.

The problem is when I open a REPL by pressing Cc Cv z it seems as if nothing from my file is loaded.

In other words if I define something like

class Moose {}

in my source file, this is what happens when I try to use Moose from the REPL

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

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

What is the best way to load something, such as the current buffer contents into the REPL?

I found out that there was actually no problem with the REPL. I had been trying to compile my project by pressing Cc Cb 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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