1

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

问题是当我尝试构建我的项目时。不管是否有任何错误都没有,按下C-c C-b b给我这个输出:

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

0 errors, 0 warnings.

然后我注意到 REPL 没有加载任何导致我问这个问题的东西,但是我发现如果我通过sbt compile从命令行调用来构建我的项目,我可以构建我的项目并且使用 REPL 很好。

我还看到,在我成功构建我的项目sbt compile然后尝试处理该项目并调用“增量构建”(C-c C-b r)之后,我会得到:

Asynchronous RPC Aborted: Error occurred in incremental builder. Check the server log.

在迷你缓冲区中。这是*inferior-ensime-server*缓冲区中出现的内容:

Handling RPC: (swank:builder-update-files (nil))
Error handling RPC: java.lang.NullPointerException :
scala.reflect.internal.util.BatchSourceFile.hashCode(SourceFile.scala:170)
scala.collection.mutable.FlatHashTable$HashUtils$class.elemHashCode(FlatHashTable.scala:392)
scala.collection.mutable.HashSet.elemHashCode(HashSet.scala:41)
scala.collection.mutable.FlatHashTable$class.containsEntry(FlatHashTable.scala:124)
scala.collection.mutable.HashSet.containsEntry(HashSet.scala:41)
scala.collection.mutable.HashSet.contains(HashSet.scala:58)
scala.collection.GenSetLike$class.apply(GenSetLike.scala:43)
scala.collection.mutable.AbstractSet.apply(Set.scala:45)
scala.collection.SeqLike$$anonfun$distinct$1.apply(SeqLike.scala:490)
scala.collection.immutable.List.foreach(List.scala:309)
scala.collection.SeqLike$class.distinct(SeqLike.scala:489)
scala.collection.AbstractSeq.distinct(Seq.scala:40)
scala.tools.nsc.Global$Run.compileSources(Global.scala:1531)
scala.tools.nsc.Global$Run.compileFiles(Global.scala:1643)
scala.tools.nsc.interactive.RefinedBuildManager.update0$1(RefinedBuildManager.scala:133)
scala.tools.nsc.interactive.RefinedBuildManager.update(RefinedBuildManager.scala:188)
scala.tools.nsc.interactive.RefinedBuildManager.update(RefinedBuildManager.scala:102)
org.ensime.server.IncrementalBuilder$$anonfun$act$1$$anonfun$apply$mcV$sp$1.liftedTree1$1(IncrementalBuilder.scala:124)
org.ensime.server.IncrementalBuilder$$anonfun$act$1$$anonfun$apply$mcV$sp$1.applyOrElse(IncrementalBuilder.scala:93)
scala.runtime.AbstractPartialFunction$mcVL$sp.apply$mcVL$sp(AbstractPartialFunction.scala:33)
scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:33)
scala.runtime.AbstractPartialFunction$mcVL$sp.apply(AbstractPartialFunction.scala:25)
scala.actors.InternalActor$class.receive(InternalActor.scala:123)
org.ensime.server.IncrementalBuilder.receive(IncrementalBuilder.scala:55)
org.ensime.server.IncrementalBuilder$$anonfun$act$1.apply$mcV$sp(IncrementalBuilder.scala:88)
org.ensime.server.IncrementalBuilder$$anonfun$act$1.apply(IncrementalBuilder.scala:87)
org.ensime.server.IncrementalBuilder$$anonfun$act$1.apply(IncrementalBuilder.scala:87)
scala.actors.Reactor$class.seq(Reactor.scala:285)
org.ensime.server.IncrementalBuilder.seq(IncrementalBuilder.scala:55)
scala.actors.Reactor$$anon$3.andThen(Reactor.scala:263)
scala.actors.Combinators$class.loop(Combinators.scala:28)
org.ensime.server.IncrementalBuilder.loop(IncrementalBuilder.scala:55)
scala.actors.Combinators$$anonfun$loop$1.apply(Combinators.scala:28)
scala.actors.Combinators$$anonfun$loop$1.apply(Combinators.scala:28)
scala.actors.Reactor$$anonfun$seq$1$$anonfun$apply$1.applyOrElse(Reactor.scala:282)
scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:33)
scala.actors.ReactorTask.run(ReactorTask.scala:31)
scala.actors.ReactorTask.compute(ReactorTask.scala:63)
scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:160)
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:915)
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:980)
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

Writing: (:return (:abort 205 "Error occurred in incremental builder. Check the server log.") 44)

如果我尝试使用 进行完整构建C-c C-b b,我会得到原始缓冲区没有显示错误或警告(无论是否是这种情况),并看到原始类目录将被删除。

为什么会发生这种情况,我怎样才能获得C-c C-b bC-c C-b r正确构建项目?

编辑

似乎类文件是在我ensime安装的目录中生成的,这对我来说似乎很奇怪......

编辑 2

*Messages*在启动时得到以下信息。我不知道这是否相关:

Eager macro-expansion failure: (error "(ensime-builder-changed-files (ensime-connection)) is not a valid place expression") [3 times]
4

1 回答 1

0

这些问题是由于 ensime 中的错误造成的;两者都应该在当前的 git 树中修复:

https://github.com/ensime/ensime-src.git

于 2014-03-24T20:48:41.910 回答