These are chat archives for ensime/ensime-atom

11th
Nov 2015
Doug Clinton
@DougC
Nov 11 2015 11:56
I’ve just read the post by @d6y on using ensime and atom and thought I’d give it a go. I’ve got Atom 1.1.0 and generated the .ensime for my project using ensime-sbt 0.2.1. I’m using the Atom package for Ensime version 0.30.0. However, when I use Shift-Command-P and run Start Ensime not a lot happens
The Ensime log window shows up at the bottom, but there’s no output to it. Do I need to install ensime server separately, or is atom suppose to download and run it?
Eventually Atom pops up an error that says “Server hasn’t been updated yet"
Richard Dallaway
@d6y
Nov 11 2015 12:23
Hey @DougC - did you see the screen recording with that post, and did you get anything like that?
Doug Clinton
@DougC
Nov 11 2015 12:27
Hi @d6y, yeah I’ve watched the screencast a couple of times through and I don’t think I’ve missed anything. The path to sbt is right and I’m running sbt 0.13.8
I just don’t get any output in the “Start ensime” window :-(
Richard Dallaway
@d6y
Nov 11 2015 12:29
I thnk I’ve seen that once when I was connected to a flakeyVPN into a locked down nexus that simply failed to deliver some JARs.
Doug Clinton
@DougC
Nov 11 2015 12:29
Only thing I notice is different is that you’re using 0.29.0 of the ensime atom plugin and I’m using 0.30.0
is there a way I can start ensime server from a command line to download and check it?
Richard Dallaway
@d6y
Nov 11 2015 12:30
Just trying this out with the latest version (I’ve been using a local build recently)
Richard Dallaway
@d6y
Nov 11 2015 12:38
Ok - that started up just fine for me with 0.30.0
Doug Clinton
@DougC
Nov 11 2015 12:38
which version of Atom are you using?
Richard Dallaway
@d6y
Nov 11 2015 12:39
Do you get anything if you Shift+Cmd+p ensime: update server
Atom: 1.0.0
Doug Clinton
@DougC
Nov 11 2015 12:39
Update server gives the same amount of nothingness as start ensime.
Richard Dallaway
@d6y
Nov 11 2015 12:40
Weeeeird
Doug Clinton
@DougC
Nov 11 2015 12:40
Ah, I’m using Atom 1.1.0. maybe something broke
Richard Dallaway
@d6y
Nov 11 2015 12:40
Ah no, sorry.
I mistyped.
I’m on 1.1.0
Doug Clinton
@DougC
Nov 11 2015 12:40
hmm
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:40
@DougC You don't get any log output pane?
There should open a pane with the title "Ensime server update:"
Doug Clinton
@DougC
Nov 11 2015 12:42
@hedefalk The pane opens. Nothing gets logged to it
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:43
If you open dev tools (cmd-shift-i on Mac) do you see any console logs there?
Doug Clinton
@DougC
Nov 11 2015 12:43
Ensime server update- - -Users-dec-development-voa-rentreg-frontend - Atom.png
That’s what my window looks like after 30 seconds or so. A bit later I get the “Server hasn’t been updated yet” popup
Richard Dallaway
@d6y
Nov 11 2015 12:45
@hedefalk alt+cmd-i for me to get the console open
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:46
Ah, yes, sorry, alt+cmd-i it is!
Doug Clinton
@DougC
Nov 11 2015 12:47
Ahh, yes. I’m getting "Uncaught Error: spawn /usr/local/bin/sbt
ENOENT” in events.js line 141
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:48
Ok. Weird, if that happens to me I get:
Screen Shot 2015-11-11 at 13.48.24.png
Doug Clinton
@DougC
Nov 11 2015 12:49
The path to my sbt is right - it appears to be failing for some other reason
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:50
You need to make sure to put the correct path to sbt in settings. Unfortunately, I haven't found any way to have Atom consistently get any path.
Doug Clinton
@DougC
Nov 11 2015 12:50
the path is right
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:50
Oh, ok.
Doug Clinton
@DougC
Nov 11 2015 12:50
I’m thinking maybe it’s using the wrong version of java to launch it. I’ll check my bash setup
Richard Dallaway
@d6y
Nov 11 2015 12:51
If I look at my /usr/local/bin/sbt I see I’m running (eventually) exec "/usr/local/Cellar/sbt/0.13.9/libexec/sbt" "$@“ - @DougC is on 0.13.8, but I can’t imaging that’d make much difference
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:51
Yeah, you can go to ~/.atom/packages/Ensime/ensimeupdate
And run sbt there to see if everything's ok. On the other hand, you have the same problem there. Atom wont honour any $JAVA_HOME set in shell :´(
Doug Clinton
@DougC
Nov 11 2015 12:52
How does it resolve the version of Java?
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:53
No idea, it just runs sbt without any path so it's up to sbt. I guess system default.
Sorry, without any ENV from shell's that is.
Richard Dallaway
@d6y
Nov 11 2015 12:54
I still see this in the preferecnes for Ensime+Atom:
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:54
So if you typically use $JAVA_HOME to decide on Java version that you set up in .bash_profile or something you will have problems…
Richard Dallaway
@d6y
Nov 11 2015 12:54
essential-slick-code - Atom 2015-11-11 12-54-24.png
…is that needed any more, or a relic from an older version?
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:55
Oh, yes. Atom settings are super-broken. That's just because you have it in your .cson. Kill it!
Richard Dallaway
@d6y
Nov 11 2015 12:55
:+1:
Doug Clinton
@DougC
Nov 11 2015 12:56
I don’t see that setting. I gather I’m not supposed to?
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:56
~/.atom/config.cson that is
No, your not. That's a side track :)
you're not.
Richard Dallaway
@d6y
Nov 11 2015 12:57
Sorry! That was me confusing/checking things.
Doug Clinton
@DougC
Nov 11 2015 12:57
ok
so I’ve gone to ensimeupdate, unset my JAVA_HOME and run sbt no problem. It’s using Java 8 by default
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:58
Sorry, I'm looking at the code
It uses JAVA_HOME from .ensime. That's why I could remove the setting.
No, wrong again!
Richard Dallaway
@d6y
Nov 11 2015 12:59
:-)
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:59
It starts ensime server with JAVA_HOME from .ensime, but it just runs sbt from settings to run sbt to make the server update.
Richard Dallaway
@d6y
Nov 11 2015 12:59
Could there be an issue inside @DougC ’s .ensime config? I’m using: addSbtPlugin("org.ensime" % "ensime-sbt" % "latest.integration”) (so no idea what version that is :-)
Viktor Hedefalk
@hedefalk
Nov 11 2015 12:59
I guess sbt then just uses system default?
Doug Clinton
@DougC
Nov 11 2015 13:00
my suspicion is that it’s picking up Java 6 somehow (have it installed for some old, old apps that need it)
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:00
Don't think so. 0.2.1 is the latest.
Yeah, I think that the problem is that the sbt command is run without any env and have no JAVA_HOME. So it probably uses system default and something breaks.
Richard Dallaway
@d6y
Nov 11 2015 13:01
So we could test that: doug could put a java 8 on the front of his PATH in .profile I guess?
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:02
Yeah.
I'm starting to google stuff here. Maybe we should depend on https://atom.io/packages/env-from-shell
Not that I know how that works…
Richard Dallaway
@d6y
Nov 11 2015 13:03
Sounds promising… might mean no need to set path to sbt in preferences.
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:04
But I don't even think it can work though. I mean, we need to support starting Atom as .app.
Richard Dallaway
@d6y
Nov 11 2015 13:04
What’s the .app issue? Some kind of sandboxing?
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:04
You don't have any env then? And you can't just read ~/.bashrc or whatever - people use zsh and other things. I really don't think there's any super nice way to do it…
If you clicketiclick an app in OSX you don't get anything you set up in a bash shell… There's launchctl instead but there is no consistent common ground for ENV between systems…
But I still think we can do better.
I think we should have settings first, else look at known env-places, and if nothing popup a modal window and save to settings. I think I did that for sbt.
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:09
Is it a bad idea to use JAVA_HOME from .ensime when running the sbt server download?
Richard Dallaway
@d6y
Nov 11 2015 13:11
In my case .ensime has the right value in it for me, but I have a simple set up on only needed one JVM
Doug Clinton
@DougC
Nov 11 2015 13:14
what is the sbt command that the ensime plugin uses to generate the classpath file that it polls for? If I run that manually from the ensemeupdate directory maybe I can move things forward?
found it. it’s “saveClasspath”. That worked - now when I run Ensime Start I get the goodness in my scala files
:-)
cany anyone recommend any particular scala plugin for syntax highlighting?
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:18
scala-lang
I think I added it as a automatic dependency from ensime-atom in the latest release though so you should get it already?
Sorry, "language-scala" it's called
Doug Clinton
@DougC
Nov 11 2015 13:20
probably. I had it installed but disabled it at some point to see if it was causing the issue. It wasn’t :-)
Thanks for you help. So it seems that the sbt command is being run in a way that crashes, possibly due to picking up the wrong java version, but I’m not yet sure.
This message was deleted
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:23
Yeah, I would guess something like that. There might definitely be room for improvements in the startup thingy.
Catching errors and showing more info.
more interactiveness when path is missing and stuff.
Doug Clinton
@DougC
Nov 11 2015 13:28
Ahh, fixed it! I looked at the config.cson and notices that the sbtExec looked funny. Like this:
config.cson - -Users-dec-development-voa-rentreg-frontend - Atom.png
I fixed that up and my server update is working now!
This is probably left over from an earlier attempt at using all this from wayback with Atom 1.0.0
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:31
Oh, weird.
Doug Clinton
@DougC
Nov 11 2015 13:31
So nothing to do with JDK 1.6
Viktor Hedefalk
@hedefalk
Nov 11 2015 13:32
Ok, cool.
Doug Clinton
@DougC
Nov 11 2015 17:27
@hedefalk just to confirm, I did the same setup on another machine, which had never had atom on before but does have JAva 6, and it all worked smoothly.
Viktor Hedefalk
@hedefalk
Nov 11 2015 21:54
@DougC Cool. Thanks for the update! It figures, sbt should work fine with Java 6 and if not should give some kind of error message that should be shown. That linebreak in the command sent to the spawned child process probably messes up real bad.