These are chat archives for ensime/ensime-sublime

4th
Aug 2017
Dick Wall
@dickwall
Aug 04 2017 15:16
hey there everyone, yeah yeah I know I have been quiet
good reasons I promise
anyway, I thought I would take the time to get ensime running again today and take the new stuff for a spin
however I can't get the initial connection going (this is from a checkout of the latest master of the sublime code, just in case something is known to be broken in there)
ensime log:
2017-08-04 08:14:08.647527: Initializing project - /home/dick/dev/CIBO/continuum
INFO     <2017-08-04 08:14:08,647> (env.py:102) - Logger initialised.
INFO     <2017-08-04 08:14:08,654> (client.py:144) - ----Initialising server----
INFO     <2017-08-04 08:14:10,977> (client.py:222) - About to connect to ws://127.0.0.1:33763/websocket with options {'enable_multithread': True, 'subprotocols': ['jerky']}
ERROR    <2017-08-04 08:14:11,403> (client.py:207) - connection error: Handshake status 404
Traceback (most recent call last):
  File "/home/dick/.config/sublime-text-3/Packages/Ensime/ensimesublime/util.py", line 10, in catch
    yield
  File "/home/dick/.config/sublime-text-3/Packages/Ensime/ensimesublime/client.py", line 223, in connect_ensime_server
    self.ws = websocket.create_connection(self.ensime_server, **options)
  File "/home/dick/.config/sublime-text-3/Packages/Ensime/dependencies/websocket/_core.py", line 487, in create_connection
    websock.connect(url, **options)
  File "/home/dick/.config/sublime-text-3/Packages/Ensime/dependencies/websocket/_core.py", line 214, in connect
    self.handshake_response = handshake(self.sock, *addrs, **options)
  File "/home/dick/.config/sublime-text-3/Packages/Ensime/dependencies/websocket/_handshake.py", line 69, in handshake
    status, resp = _get_resp_headers(sock)
  File "/home/dick/.config/sublime-text-3/Packages/Ensime/dependencies/websocket/_handshake.py", line 129, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d", status)
websocket._exceptions.WebSocketBadStatusException: Handshake status 404
INFO     <2017-08-04 08:14:11,405> (client.py:240) - Server shutdown.
INFO     <2017-08-04 08:14:11,418> (client.py:209) - Server was shutdown.
INFO     <2017-08-04 08:14:11,418> (outgoing.py:18) - send_request: 
{'callId': 1, 'req': {'typehint': 'ConnectionInfoReq'}}
server.log:
08:14:09.995 INFO  None a.e.s.Slf4jLogger - Slf4jLogger started
08:14:10.006 DEBUG EventStream(akka://ENSIME) a.e.EventStream - logger log1-Slf4jLogger started
08:14:10.009 DEBUG EventStream(akka://ENSIME) a.e.EventStream - Default Loggers started
08:14:10.041 INFO  None o.a.c.v.i.StandardFileSystemManager - Using "/tmp/vfs_cache" as temporary files store.
08:14:10.118 DEBUG akka://ENSIME/system/IO-TCP/selectors/$a/0 a.i.TcpListener - Successfully bound to /127.0.0.1:35349
08:14:10.123 INFO  akka://ENSIME/user/ensime-main/tcp-server o.e.s.t.TCPServer - Bound server on port 35349
08:14:10.132 INFO  None o.e.s.PortUtil$ - creating port file: /home/dick/dev/CIBO/continuum/.ensime_cache/port
08:14:10.953 DEBUG akka://ENSIME/system/IO-TCP/selectors/$a/1 a.i.TcpListener - Successfully bound to /127.0.0.1:33763
08:14:10.953 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor - Environment:
08:14:10.954 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   OS : Linux
08:14:10.954 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Java : Java HotSpot(TM) 64-Bit Server VM 25.144-b01, Java(TM) SE Runtime Environment 1.8.0_144-b01
08:14:10.954 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Scala version: version 2.11.8
08:14:10.954 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Ensime : 1.0.0
08:14:10.955 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Built with Scala version: 2.11.8
08:14:10.955 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Built with sbt version: 0.13.11
08:14:10.955 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Built from git sha: cf6a0453d3a7890b3a711769cee081b497f535b6
08:14:10.955 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor -   Built on: 2016-06-25 12:21:53.134
08:14:10.962 INFO  akka://ENSIME/user/ensime-main o.e.s.ServerActor - ENSIME HTTP on /127.0.0.1
08:14:10.962 INFO  None o.e.s.PortUtil$ - creating port file: /home/dick/dev/CIBO/continuum/.ensime_cache/http
08:14:10.980 DEBUG akka://ENSIME/system/IO-TCP/selectors/$a/1 a.i.TcpListener - New connection accepted
08:14:11.129 DEBUG akka://ENSIME/system/IO-TCP/selectors/$a/1 a.i.TcpListener - New connection accepted
08:14:11.148 DEBUG akka://ENSIME/system/IO-TCP/selectors/$a/1 a.i.TcpListener - New connection accepted
08:14:11.404 DEBUG akka://ENSIME/system/IO-TCP/selectors/$a/4 a.i.TcpIncomingConnection - Closing connection due to IO error java.io.IOException: Connection reset by peer
the server seems to be exiting right away, but there's not a ton of clue as to why
Vishesh Chauhan
@VC1995
Aug 04 2017 15:20
Did you have a .ensime_cache folder from before? If so would you try deleting that folder and trying again?
btw, hello
Dick Wall
@dickwall
Aug 04 2017 15:21
hey vishesh - I will delete .ensime_cache and try again - hang on
and thanks for taking this over
how can I run ensime server now from the command line, maybe with extra debugging on
?
nah - same thing after removing ensime cache
let me blow away all the ensime files and re-create them again just in case
Vishesh Chauhan
@VC1995
Aug 04 2017 15:23
You can set "debug": true in Ensime user settings to see debugging messages in ensime.log
Preferences -> Package Settings -> Ensime
Dick Wall
@dickwall
Aug 04 2017 15:23
right - also I am running on Ubuntu 16.04 here, just in case that's useful info
regenerating ensimeConfig right now
I did have a bunch of other settings in my ensime user settings in sublime too - I am taking those out just in case one of them upsets it
Dick Wall
@dickwall
Aug 04 2017 15:29
same result I'm afraid, no more DEBUG messages than above
it does say Ensime 1.0.0, that's not right is it?
shouldn't it be running 2. something now
Vishesh Chauhan
@VC1995
Aug 04 2017 15:29
Are you using an older version of the server?
yes
Dick Wall
@dickwall
Aug 04 2017 15:30
not intentionally using an older version of the server
it should be starting whatever the plugin says
but it's entirely possible I have some old setting kicking around somewhere
sorry
I'll have a poke around
Vishesh Chauhan
@VC1995
Aug 04 2017 15:31
maybe something in ensime.sbt?
If you have specified an older version there
or you can check in .ensime generated too, mine has :ensime-server-version "2.0.0-SNAPSHOT"
Dick Wall
@dickwall
Aug 04 2017 15:38
probably something there - I'll check it as soon as this meeting finishes
thanks
Vishesh Chauhan
@VC1995
Aug 04 2017 15:38
okay :)
Yijia Zhan
@yijia-zhan
Aug 04 2017 16:23
Hi, can anyone give me a hint on what Inline local really does?
Dick Wall
@dickwall
Aug 04 2017 16:28
I think it means, if you have something like
  def xSquared(x: Int) = x * x
  val sq = xSquared(x)
and you ran Inline Local on the second line, it would end up with
val sq = x * x
Yijia Zhan
@yijia-zhan
Aug 04 2017 16:31
Hmm, interesting... I wonder what's the point tho... why would it refactor to code back to val sq = x * x.
Actually just gave it a try, the command is not doing anything
btw @dickwall, I had similar connectivity issue when I changed to this rewritten sublime ensime package. Did not remember what exactly I did to solve it tho, I basically deleted all ensime related files and and retried a couple times then it worked
Dick Wall
@dickwall
Aug 04 2017 16:33
yeah - I expect it's some left over setting from the old plugin
if I didn't have 3 solid hours of meetings ahead I could track it down quicker
eeurggh
Dick Wall
@dickwall
Aug 04 2017 16:47
Visesh, I see no :ensime-server-version in my generated .ensime
I have 1.12.13 set as the ensime plugin version
and it does seem to be generating ensime server jar with 1.0.0
where should that be controlled? Which setting should I make
Vishesh Chauhan
@VC1995
Aug 04 2017 16:48
I have been working with 1.12.9
but you can simply set the ensime-server-version in ensime.sbt
Dick Wall
@dickwall
Aug 04 2017 16:48
I tried to force it with ensimeServerVersion in ThisBuild := "2.0.0-SNAPSHOT"
in my global.sbt
which is a setting I used to have, but sbt doesn't like that setting any more
Vishesh Chauhan
@VC1995
Aug 04 2017 16:50
I know little about sbt :/
Dick Wall
@dickwall
Aug 04 2017 16:50
OK
I'll give 1.12.9 a go
Yijia Zhan
@yijia-zhan
Aug 04 2017 16:51
I'm on 1.12.13 tho.
and use sbt 0.13.13 in my projects.
Dick Wall
@dickwall
Aug 04 2017 17:01
any other settings in your .sbt/0.13 files that might prompt it to use 2.0.0-SNAPSHOT?
I suspect I need some variant of the setting I used to have, but maybe with a different key (they get changed from time to time)
Vishesh Chauhan
@VC1995
Aug 04 2017 17:07

The documentation on the site says to use this in .ensime in your project directory

ensimeServerVersion in ThisBuild := "2.0.0-M2" // or "1.0.1"
ensimeProjectServerVersion in ThisBuild := "2.0.0-M2" // or "1.0.1"

and if we are putting settings in global.sbt .. When putting settings in your global configuration, you must import org.ensime.EnsimeKeys._

I'm sorry I'm not able to help
Dick Wall
@dickwall
Aug 04 2017 17:07
no worries - where did you find this? I was working through the ensime sbt instructions page to make sure I hadn't missed anything :-)
they must be somewhere else
Vishesh Chauhan
@VC1995
Aug 04 2017 17:07
btw, @yijia-zhan an example of inline local http://imgur.com/a/rHwXi
Dick Wall
@dickwall
Aug 04 2017 17:07
but this is likely to be it - thanks
Vishesh Chauhan
@VC1995
Aug 04 2017 17:08
It's here http://ensime.org/build_tools/sbt/. Under "Customize"
Dick Wall
@dickwall
Aug 04 2017 17:09
thanks - that's it - I missed that
Vishesh Chauhan
@VC1995
Aug 04 2017 17:09
Great :D glad it worked
Yijia Zhan
@yijia-zhan
Aug 04 2017 17:19
thanks @VC1995 !
Yijia Zhan
@yijia-zhan
Aug 04 2017 17:27
I have another questions, how is .ensime (generated by ensimeConfig) different from project/.ensime (generated by ensimeConfigProject)?
Dick Wall
@dickwall
Aug 04 2017 17:46
yep - fiddled about with those and I got the whole boot sequence working now :-)
thanks for the help - I'll give this a spin today
Vishesh Chauhan
@VC1995
Aug 04 2017 17:56
Great, now maybe with your help, we can add debugging features to ENSIME Sublime
don't know about ensimeConfigProject @yijia-zhan