2

Just getting started in Scala programming. I got an environment set up using emacs, sbt, ensime according to the instructions here. (http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/)

It worked great for a couple of days, but then when I exited emacs and restarted I couldn't get the syntax check working (the check that happens after saving a buffer).

I start ensime after openning the file, and I see on the mode line that it says that ENSIME: Connected. But for some reason, I stopped getting the highlights for errors in the file.

Any help? It's driving me nuts.

Note: I can do other things with ensime, like starting a sbt subprocess.

thanks wing

Got some more info... I noticed that when it doesn't work, the *inferior-ensime-server* hangs on the 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>

When it does work, it goes past the scala> prompt and enters swank (this works on my linux machine)

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)

It almost seems like the ensime emacs scripts are failing to find something in the scala stream.

--- 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)  

1 Answer 1

0

You can check ensime's emacs buffer for errors and publish them here.

3
  • I'm not sure, that ensime supports 2.7, try to switch to more later version. Nov 15, 2011 at 14:06
  • I installed scala-2.9.1.final, and I see that when running scala from the command line. I think this 'Welcome to Scala version 2.7.7.final" is coming from the ensime package in ensime_2.9.2-SNAPSHOT-0.8.0.RC\ 2/bin/sbt-launch-0.7.7.jar. So i'd expect to having the co-exist peacefully :)
    – wing
    Nov 15, 2011 at 14:37
  • BTW, i'm able to get it working eventually by ctrl-c'ing the *inferior-ensime-server* buffer and restarting ensime. It eventually gets past the sticking point. This is unsatisfactory, but gets the job done.
    – wing
    Nov 15, 2011 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.