刚刚开始Scala编程。根据这里的说明,我使用emacs、sbt、ensime设置了一个环境。(http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/)
它在几天内工作得很好,但是当我退出emacs并重新启动时,我无法使语法检查工作(保存缓冲区后发生的检查)。
我打开文件后启动ensime,我在模式行看到它说ensime: Connected。但是由于某种原因,我停止了对文件中错误的高亮显示。
帮忙吗?快把我逼疯了。
注意:我可以用ensime做其他事情,比如启动一个sbt子进程。
谢谢翼
得到了更多的信息…我注意到,当它不工作时,*inferior-ensime-server*
挂在scala> REPL
Welcome to Scala version 2.7.7.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
当执行时,它越过scala>提示符并进入swank(这在我的linux机器上有效)
Handling RPC: (swank:symbol-designations /home/wing/work/scala-test1/src/main/scala/Main.scala 0 96 nil)
Writing: 000051(:return (:ok (:file "/home/wing/work/scala-test1/src/main/scala/Main.scala")) 3)
Indexing completed in 13.394 seconds.
Indexed 13564 classes with 117390 methods.
Writing: 000012(:indexer-ready t)
ensime emacs脚本似乎无法在scala流中找到一些东西。
--- Buffers from emacs ---
*Message*
("emacs")
Loading encoded-kb...done
Loading cl-macs...done
Loading derived...done
Loading edmacro...done
Loading easy-mmode...done
For information about the GNU Project and its goals, type C-h C-p.
Main.scala has auto save data; consider M-x recover-this-file
Loading image...done
Loading advice...done
Loading cl-seq...done
Polling "/var/folders/0j/0jDMoITREkmpZqCgO11BCk+++TM/-Tmp-/ensime_port.2349".. (Abort with `M-x ensime-abort-connection'.) [4 times]
Read port 51568 from "/var/folders/0j/0jDMoITREkmpZqCgO11BCk+++TM/-Tmp-/ensime_port.2349".
Connecting to Swank on port 51568.. [2 times]
Loading cl-extra...done
Connected.
Wrote /Users/wing/work/scala/ensime-p1/src/main/scala/Main.scala [2 times]
-----
*ensime-events*
(:swank-rpc
(swank:connection-info)
1)
(:return
(:ok
(:pid nil :server-implementation
(:name "ENSIMEserver")
:machine nil :features nil :version "0.0.1"))
1)
(:swank-rpc
(swank:init-project
(:project-package "com.myproject" :use-sbt t :root-dir "/Users/wing/work/scala/ensime-p1/"))
2)
您可以检查ensime的emacs缓冲区是否有错误,并在这里发布它们。