These are chat archives for ensime/ensime-sublime

20th
Jul 2015
Dick Wall
@dickwall
Jul 20 2015 19:50
OK - so still trying to puzzle through the debugging story. It seems to come down to me not knowing what needs to go in current_launch_key in the .ensime-session file sublime creates
any clues, along with any quickstarters on how to launch a test in debug mode (I can probably figure that out though if I can just get the current_launch_key thing sorted)
I think for test I just need to run the Scalatest main with the test name as argument (or just get all tests)
aha - looks like that field needs to reference the name of one of the tests, makes sense
like this:
  "breakpoints": [
    {
      "file_name": "/home/dick/dev/Scala/subcut/src/test/scala/com/escalatesoft/subcut/inject/TrialBindingModule.scala", 
      "line": 24
    }
  ], 
  "current_launch_config": "All Tests", 
  "launch_configs": [
    {
      "args": "", 
      "main_class": "org.scalatest.tools.Runner", 
      "name": "All Tests", 
      "remote_address": ""
    }
  ]
}
still doesn't work though, but I think that's now a bug in the plugin
I'll see if I can track it down
Dick Wall
@dickwall
Jul 20 2015 19:57
oh, I think I see the problem :-)
@async_rpc(DebugKickoffResult.parse)
def _debug_start(self, command_line):
pass
yeah - got a missing implementation there to start the debugger :-)
right - time to fix that I think
in fact, I think this whole section of debugging is a todo, looks like I actually need to learn how ensime does this stuff
Rory Graves
@rorygraves
Jul 20 2015 20:09
@dickwall No, its reflective magic
no missing impls
what (if any errors do you see in the console when the call fails)?
Rory Graves
@rorygraves
Jul 20 2015 20:36
Most of the errors I've seen on the protocol side have been around changes to the results bodies.
Dick Wall
@dickwall
Jul 20 2015 21:00
ah, so it should be working?
OK - here's what I see, it's not much to go on I'm afraid
first - my launch script is as above
so I am trying to debug Scalatest, which does mean it needs the test classpath (could that be a problem?) and it's not trying to run a class in my specific code base, but the standard Scalatest one
the first thing I see is:
Traceback (most recent call last):
File "/home/dick/.config/sublime-text-3/Packages/Ensime/rpc.py", line 435, in callback
on_complete(data)
File "/home/dick/.config/sublime-text-3/Packages/Ensime/rpc.py", line 537, in callback
on_complete(status)
File "/home/dick/.config/sublime-text-3/Packages/Ensime/ensime.py", line 1761, in callback
self.status_message("Debugger has failed to start" + launch_name + ". " + str(status.details))
AttributeError: 'bool' object has no attribute 'details'
basically that status is a bool when it comes back (in fact it has false in it)
Rory Graves
@rorygraves
Jul 20 2015 21:02
Ah, so there are two issues here.
Dick Wall
@dickwall
Jul 20 2015 21:02
I found this by getting rid of the .details part and just printing out the status directly, at which point I see
Debugger has failed to start All Tests. False
Rory Graves
@rorygraves
Jul 20 2015 21:03
Debug procbis failing g to start (check the server log might have something useful in it)
Ah, or not....
I had not tried debugging a test, could well be class path related.
Dick Wall
@dickwall
Jul 20 2015 21:04
from the last couple of tests:
14:02:42.471 DEBUG akka://ENSIME/user/$d/13 o.e.s.RequestHandler - DebugClearAllBreaksReq
14:02:42.472 DEBUG akka://ENSIME/user/project o.e.c.Project - received handled message DebugClearAllBreaksReq
14:02:42.472 DEBUG akka://ENSIME/user/project/debugging o.e.c.DebugManager - received handled message DebugClearAllBreaksReq
14:02:42.472 DEBUG akka://ENSIME/user/$d/13 o.e.s.RequestHandler - received handled message VoidResponse in state receive
14:03:02.135 DEBUG akka://ENSIME/user/$d/14 o.e.s.RequestHandler - DebugClearAllBreaksReq
14:03:02.135 DEBUG akka://ENSIME/user/project o.e.c.Project - received handled message DebugClearAllBreaksReq
14:03:02.135 DEBUG akka://ENSIME/user/project/debugging o.e.c.DebugManager - received handled message DebugClearAllBreaksReq
14:03:02.135 DEBUG akka://ENSIME/user/$d/14 o.e.s.RequestHandler - received handled message VoidResponse in state receive
that's the server logs
OK - so let me try a main method of my own instead
I can work around it that way for now if I need to :-)
just have an app that extends Runner :-)
or calls Runner.run anyway
Rory Graves
@rorygraves
Jul 20 2015 21:05
True ;)
We might be light on the debug process start logging, which sounds foolish. Unless it's the clear all breakpoints call that is failing. Let me retest tomorrow I thought I had got past that issue.
Dick Wall
@dickwall
Jul 20 2015 21:10
well - I am still getting the Debugger has failed to start All Tests. False message
this is with my own main method in the src path (not test)
and all it does is a println (keeping things simple)
I am on linux if that makes a difference
haven't tried it on Mac
Rory Graves
@rorygraves
Jul 20 2015 21:11
I definitely had a debug session working at some point. Always a chance I broke it again.
Dick Wall
@dickwall
Jul 20 2015 21:12
well - it's not desperate, just something on my list to get working
Rory Graves
@rorygraves
Jul 20 2015 21:12
Cool.
Dick Wall
@dickwall
Jul 20 2015 21:12
I would love to know how the reflecto magic works sometime though
cos I thought that whole thing just wasn't implemented :-)
by the way, the ensime server has been running for days, with suspend/resume cycles in the mix. That thing is pretty strong
Rory Graves
@rorygraves
Jul 20 2015 21:13
There is a method with the same name as the annotation, but I have no idea how it works.
Dick Wall
@dickwall
Jul 20 2015 21:14
ah, OK - so that failure still just comes back with false
server logs have a bit more info though:
14:13:56.342 DEBUG akka://ENSIME/user/$d/28 o.e.s.RequestHandler - TypeAtPointReq(/home/dick/dev/Scala/subcut/src/main/scala/com/escalatesoft/subcut/inject/AllTests.scala,OffsetRange(108,108)) 14:13:56.343 DEBUG akka://ENSIME/user/project o.e.c.Project - received handled message TypeAtPointReq(/home/dick/dev/Scala/subcut/src/main/scala/com/escalatesoft/subcut/inject/AllTests.scala,OffsetRange(108,108)) 14:13:56.344 DEBUG akka://ENSIME/user/project/analyzer o.e.c.Analyzer - received handled message TypeAtPointReq(/home/dick/dev/Scala/subcut/src/main/scala/com/escalatesoft/subcut/inject/AllTests.scala,OffsetRange(108,108)) in state ready 14:13:56.344 DEBUG akka://ENSIME/user/$d/28 o.e.s.RequestHandler - received handled message Some(BasicTypeInfo(AllTests$,25,Object,com.escalatesoft.subcut.inject.AllTests$,List(),List(),Some(OffsetSourcePosition(/home/dick/dev/Scala/subcut/src/main/scala/com/escalatesoft/subcut/inject/AllTests.scala,47)),None)) in s 14:14:01.284 DEBUG akka://ENSIME/user/$d/29 o.e.s.RequestHandler - DebugClearAllBreaksReq 14:14:01.284 DEBUG akka://ENSIME/user/project o.e.c.Project - received handled message DebugClearAllBreaksReq 14:14:01.284 DEBUG akka://ENSIME/user/project/debugging o.e.c.DebugManager - received handled message DebugClearAllBreaksReq 14:14:01.284 DEBUG akka://ENSIME/user/$d/29 o.e.s.RequestHandler - received handled message VoidResponse in state receive
not sure if that helps you, doesn't help me much :-)
the breakpoints all toggle and behave nicely though, so good job on that one :-)
I had forgotten all about python for comprehensions until I saw yours. It rekindled some of my former python fandom...
Rory Graves
@rorygraves
Jul 20 2015 21:17
Will have a play with the debugger. The server side implementing is ensime poor relation compared to all the other support. It also has a nasty habit of returning false rather than a useful failure when it gets confused.
Lol, about the list comprehensions. I still miss my strong types.
I need compilers to protect me against the fade that although I've typed a word thousands of times, today I'm going to fat finger it for only the fifth time.
Dick Wall
@dickwall
Jul 20 2015 21:21
oh sure - I do find that even though it's a poor substitute, sublimes suggest popups really help
it at least matches tokens it knows about and spells them for you
better than nothing
BTW - not sure if this affects you, but if you clone from github directly into the packages folder and then symlink to your dev folder, that allows the changes in the plugin to be picked up straight away, I found that the other way around the symlink causes you to need to reload ST3 sometimes to pick up changes
my experimentation accelerated greatly once I learned that trick
so you think this problem is actually ensime server rather than the plugin?
Rory Graves
@rorygraves
Jul 20 2015 21:24
Yep I do exactly that with the symlink.
Not sure buy I think the server might be hiding the real launch issue from you. Sad to say I ten to run sublime and the server started from intellij allowing to fiddle with both sides.
I'm outta here catch you later.
Dick Wall
@dickwall
Jul 20 2015 21:26
OK - sure - talk to you tomorrow
I'll have a bit of a poke around later - it will probably be ineffectual until I know a bit more about how that is all supposed to work, but I'll try
you think the launch issue could actually be something to do with my machine here? maybe missing something in the Linux side of things?