Newbie ensime-plugin questions

162 views
Skip to first unread message

paulg...@gmail.com

unread,
Jun 23, 2015, 7:36:11 PM6/23/15
to ens...@googlegroups.com
Hi Everyone,

First time posting.

I'm really enjoying using Scala and Emacs together under Ensime. But, I've got a couple of silly issues with the default .ensime file (see below), produced by the SBT ensime plug-in (gen-ensime).

I'm running with the latest versions of the code (as of a few days ago).

Q1) For the life of me, I can't get the documentation to work. I only ever get "No Documentation Found." whenever I try to use C-c C-v d, does this require further tweaking of the default .ensime file or am I missing something else.?

I'm creating lots of small test projects hence the next two questions:-

Q2) In order to run the REPL interpreter within Emacs, I've found I needed to manually add the scala-compiler and scala-reflect. jars to the runtime-deps section. Is there any reason why this isn't done automatically, for me for each project...?

Q3) I seem to remember stumbling upon a means that created the default SBT directory structure for me, but I can't reproduce it. I've followed numerous online step-by-step guides but I remain confused as the minimal steps needed to create a one source file project.

Finally, wanting the icing on the cake:-

Q4) Is there any way to break into a running app and run-up a REPL interpreter at that point, from within ensime/emacs?

Thanks for any help you can provide.

(
:root-dir "/Users/Paul/Documents/Work/Dev/Scala/HelloWorld"
:cache-dir "/Users/Paul/Documents/Work/Dev/Scala/HelloWorld/.ensime_cache"
:name "helloworld"
:java-home "/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home"
:java-flags ("-Xms1024m" "-Xmx1024m" "-XX:ReservedCodeCacheSize=128m" "-XX:MaxMetaspaceSize=256m")
:reference-source-roots ("/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/src.zip")
:scala-version "2.10.4"
:compiler-args nil

:subprojects ((
:name "helloworld"
:module-name "helloworld"
:source-roots ("/Users/Paul/Documents/Work/Dev/Scala/HelloWorld/src/main/scala")
:target "/Users/Paul/Documents/Work/Dev/Scala/HelloWorld/target/scala-2.10/classes"
:test-targets ("/Users/Paul/Documents/Work/Dev/Scala/HelloWorld/target/scala-2.10/test-classes")
:depends-on-modules nil
:compile-deps ("/Users/Paul/.sbt/boot/scala-2.10.4/lib/scala-library.jar")
:runtime-deps nil
:test-deps nil
:doc-jars ("/Users/Paul/.ivy2/cache/org.scala-lang/scala-library/docs/scala-library-2.10.4-javadoc.jar" "/Users/Paul/Documents/Work/Dev/Scala/HelloWorld/target/scala-2.10/helloworld_2.10-0.1-SNAPSHOT-javadoc.jar")
:reference-source-roots ("/Users/Paul/.ivy2/cache/org.scala-lang/scala-library/srcs/scala-library-2.10.4-sources.jar")))

)

Sam Halliday

unread,
Jun 24, 2015, 9:14:43 AM6/24/15
to ens...@googlegroups.com, paulg...@gmail.com
On Wednesday, 24 June 2015 00:36:11 UTC+1, paulg...@gmail.com wrote:
I'm really enjoying using Scala and Emacs together under Ensime.

Great! :-)
 
I'm running with the latest versions of the code (as of a few days ago).

Q1) For the life of me, I can't get the documentation to work. I only ever get "No Documentation Found." whenever I try to use C-c C-v d, does this require further tweaking of the default .ensime file or am I missing something else.?

This should be working. Does it work for J2SE Scala stdlib classes? It might just be that your own documentation jars are not available. If it's still broken, please create a bug report (ideally point us at a github project --- ensime-server if all else fails --- and a file/location).

 
Q2) In order to run the REPL interpreter within Emacs, I've found I needed to manually add the scala-compiler and scala-reflect. jars to the runtime-deps section.

That sounds like something is broken, it's definitely supposed to do this automatically and you shouldn't need to edit the .ensime file by hand. Are you definitely running the latest versions of client and server?

Q3) I seem to remember stumbling upon a means that created the default SBT directory structure for me, but I can't reproduce it. I've followed numerous online step-by-step guides but I remain confused as the minimal steps needed to create a one source file project.

Put sources under src/main/scala and that is added by default to an sbt single module project.

 
Q4) Is there any way to break into a running app and run-up a REPL interpreter at that point, from within ensime/emacs?

You mean like a REPL mixed with a debugger? I've seen that sort of thing done before, but it is more of a general Scala development question and you might find scala-user or stackoverflow to have a larger audience to answer.


Best regards,
Sam

paulg...@gmail.com

unread,
Jul 1, 2015, 1:30:43 PM7/1/15
to ens...@googlegroups.com, paulg...@gmail.com
Thanks Sam. I've now managed to get the documentation working. I have one final issue, you might be able to solve. I'm using C-c C-t t on a class, with the expectation of it creating a testclass automatically. However, I get "Could not determine test file name for <<package name>>.<<ClassName>>. Is there anything I should be checking to encourage this feature to work? Or am I misunderstanding what it's supposed to do. Separately, I have added a src/test/scala/<<packagename>>/<<classname>> directory, and manually created a testclass which ran successfully through sbt.Regards Paul

paulg...@gmail.com

unread,
Jul 2, 2015, 6:18:26 PM7/2/15
to ens...@googlegroups.com, paulg...@gmail.com
Stepping through the elisp code, it looks like it's failing trying to resolve test-file-name...?

paulg...@gmail.com

unread,
Jul 4, 2015, 7:30:49 PM7/4/15
to ens...@googlegroups.com, paulg...@gmail.com
On Thursday, 2 July 2015 23:18:26 UTC+1, paulg...@gmail.com wrote:
> Stepping through the elisp code, it looks like it's failing trying to resolve test-file-name...?

I've finally found out why the goto test feature wasn't working...I was missing the test directory path in the sources-roots config of the .ensime file.

Sam Halliday

unread,
Jul 4, 2015, 8:33:28 PM7/4/15
to ens...@googlegroups.com, paulg...@gmail.com
Hi Paul,

Not many people check the mailing list. You might want to lurk on gitter.im/ensime/ensime-emacs instead.

You can also use irc. Get your password --- i.e. token --- from https://irc.gitter.im/ and put it in your ~/.authinfo using the usual format. Then connect in emacs with

(defun gitter()
  "Connect to Gitter."
  (interactive)
  (erc-tls :server "irc.gitter.im" :port 6697))
Reply all
Reply to author
Forward
0 new messages