These are chat archives for ensime/ensime-sublime

26th
Jan 2016
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 09:16
@soc how is ENSIME working out for you anyway?
@fommil I think it's getting better, but for me it's still in the state where I have the Sublime console opened continuously to see when/if things break
Dick Wall
@dickwall
Jan 26 2016 19:21
oh - me too :-) I think it will be that way for a while yet
I also get this error from time to time:
Traceback (most recent call last):
  File "ensime in /home/soc/.config/sublime-text-3/Installed Packages/Ensime.sublime-package", line 607, in message_compiler_ready
FileNotFoundError: [Errno 2] No such file or directory: '/home/soc/.config/sublime-text-3/Packages/Ensime/Encouragements.txt'
Dick Wall
@dickwall
Jan 26 2016 19:22
ha - that must be the one that says "Death to null!" and stuff like that. Never seen that error though
Magnus Andersson
@magnusart
Jan 26 2016 19:22
I get that as well. The folder does not exist.
btw, is ctrl+space supposed to do auto-completion?
Dick Wall
@dickwall
Jan 26 2016 19:23
you may need to add a key-binding for that: in your user key bindings
hmm - no actually maybe not - I don't have that key binding and it works for me
oh - wait, yes there it is at the top
here are my current bindings, for posterity
[
  { "keys": ["ctrl+space"], "command": "auto_complete" },
  { "keys": ["alt+w"], "command": "worksheet_eval" },
  { "keys": ["alt+c"], "command": "worksheet_clear" },
  { "keys": ["ctrl+alt+c"],
      "command": "sublime_highlight",
      "args": { "target": "external",
                "output_type": "html"
    }},
  { "keys": ["f9"], "command": "ensime_toggle_breakpoint" },
  { "keys": ["ctrl+shift+f9"], "command": "ensime_clear_breakpoints" },
  { "keys": ["ctrl+f5"], "command": "ensime_startup" },
  { "keys": ["ctrl+shift+f5"], "command": "ensime_shutdown" },
  { "keys": ["f5"], "command": "ensime_smart_run_debugger" },
  { "keys": ["f8"], "command": "ensime_continue_debugger" },
  { "keys": ["shift+f5"], "command": "ensime_stop_debugger" },
  { "keys": ["f11"], "command": "ensime_step_into" },
  { "keys": ["f10"], "command": "ensime_step_over" },
  { "keys": ["ctrl+alt+i"], "command": "ensime_add_import" },
  { "keys": ["ctrl+alt+o"], "command": "ensime_organize_imports" },
  { "keys": ["ctrl+alt+b"], "command": "ensime_build" },
  { "keys": ["ctrl+shift+g"], "command": "ensime_go_to_definition" },
  { "keys": ["ctrl+shift+t"], "command": "ensime_inspect_type_at_point" },
  { "keys": ["f1"], "command": "ensime_browse_scaladoc_at_point" },
  { "keys": ["ctrl+alt+m"], "command": "sbt", "args": {"command": "test:compile"}}
]
Rory Graves
@rorygraves
Jan 26 2016 19:24
@soc I have a local fix for that error. It's startup it used to print a random message from a file ST3 packaging broke it.
Dick Wall
@dickwall
Jan 26 2016 19:25
the alt+w, alt+c and ctrl-alt-c are for things you may not have (other packages)
the rest are ensime related
Rory Graves
@rorygraves
Jan 26 2016 19:25
Will put in a PR tonight.
Dick Wall
@dickwall
Jan 26 2016 19:26
ahh - I am running from a git repo, so I guess there is no problem with it finding that file there
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 19:38
@soc @dickwall ha! I was thinking we should move that funny business to the server side
it's definitely a fun task for somebody on a hack day
I'm creating it
although... it is a benefit of emacs vs rest
I think things have vastly improved, but I still miss the interactivity of ScalaIDE a bit.
e. g. not having remember to save a file to get error markers.
Rory Graves
@rorygraves
Jan 26 2016 19:45
That's actually fixable. I'm usIng it to do it interactively on idle on another project. Just needs some client tweaks.
Magnus Andersson
@magnusart
Jan 26 2016 19:47
Does debugging work on the Sublime text plugin for anyone else? I want to know if I should dig deeper.
Dick Wall
@dickwall
Jan 26 2016 20:02
debugging is a bit of a pain in the ass to get going - you need the right combination
for one, you need to be able to start the JVM with remote debugging turned on (remote debugging is the easiest way to get it going)
for that, you can enable to jvm debug flags, or use Sam's handy command (which I have forgotten) to turn it on - @fommil - what's that SBT command again?
second you need to either start sbt that way, or fork the JVM used for testing, so those flags are live
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 20:03
debugging but I think @magnusart is using that already
Dick Wall
@dickwall
Jan 26 2016 20:04
third, you need a run target in sublime that looks like this:
{
  "breakpoints": [], 
  "current_launch_config": "Remote Debug", 
  "launch_configs": [
    {
      "args": "", 
      "main_class": "", 
      "name": "Remote Debug", 
      "remote_address": "localhost:5005"
    }
  ]
}
that's in the .ensime_session
Magnus Andersson
@magnusart
Jan 26 2016 20:06
Yes I have debugging on. I have tests that fork (akka-persistence-cassandra)
Dick Wall
@dickwall
Jan 26 2016 20:06
in sublime, if you don't have one of those it will write one out with those contents, so it's getting better
so that tells ensime to start up and hook up to the JVM remote debugger running on localhost port 5005
that needs to match the port you told sbt to use
once all of those pieces match up (LOL - it's a bit clunky) it does actually work pretty well
Magnus Andersson
@magnusart
Jan 26 2016 20:07
@dickwall I think I have that as well. But I guess I need to start digging around a bit to see if there are any logs.
Hmm
Dick Wall
@dickwall
Jan 26 2016 20:08
note - you can also use the main_class to invoke a class directly in debug, but I have had less success with that
and it's a pain for scalatest, where you have to remember the right scalatest run class, args, etc. etc.
Magnus Andersson
@magnusart
Jan 26 2016 20:08
5005 is that what sbt debug port is supposed to be?
Dick Wall
@dickwall
Jan 26 2016 20:08
easier to just kick it down to remote debugging
you can choose any port you like for the debug as long as it matches, I think 5005 is something of a default out there though
so one thing I do sometimes is turn off all forking in SBT, and just have SBT itself start up with port 5005 remote debugging
and tell it not to wait for a debugger connection - just get SBT running, and connect the debugger before you have SBT run tests
there are various combinations that work, it's just very wide open and a bit fiddly
Magnus Andersson
@magnusart
Jan 26 2016 20:09
Ok. Because I was a bit confused with the debug ports. It says to use 1337 in the docs. For the sbt plugin.
Dick Wall
@dickwall
Jan 26 2016 20:10
certainly not something you can just hit a toolbar and go
huh - haven't really looked at the docs for a while
but yeah - change it in either place, as long as those number match
and nothing else is sitting on that port
Magnus Andersson
@magnusart
Jan 26 2016 20:11
Right. I'll give that a try.
Dick Wall
@dickwall
Jan 26 2016 20:13
yeah - fiddle with it. Be prepared, it took me an hour or two to get it right the first time
contributions in this area to make things better are certainly welcome. Right now the whole relationship between ensime-sublime and the sublime-sbt plugin are a bit vague too
I run both, usually have sbt running full time, alongside ensime
and use the sbt plugin to kick off runs that ensime can connect to
this is hardly what the experience should be :-)
Magnus Andersson
@magnusart
Jan 26 2016 21:17
@dickwall thanks I'll give it look and report back!
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 23:34
is anyone around here who could help me out with tracking down a bug?
@/all is anyone around and has 10 mins to help me track down a server bug?
https://github.com/fommil/ensime-server/tree/parboiled2 <= please publishLocal this branch locally and try doing some method completions to trigger ensime/ensime-server#1243
then post a few more reproductions on that ticket, including the raw source code.
Magnus Andersson
@magnusart
Jan 26 2016 23:47
@dickwall By adding debug to the sbt and changing ensime session I got the debugger to attach. But when running the tests that are akka actors and a cassandra server there are threads created and those does not seem to be halted waiting for the debugger. Anyhow, thanks for your help. I think I need to test the debugging with a different project to evaluate it.
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 23:48
@magnusart any chance of testing out my dev branch?
I just need a repro and then you can nuke it and go back to the mainline
Magnus Andersson
@magnusart
Jan 26 2016 23:51
@fommil I’ve never built the project. But I can give it a quick try
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 23:51
cool! Just type publishLocal in that branch
if you have https://github.com/github/hub it's even easier :-)
Magnus Andersson
@magnusart
Jan 26 2016 23:56
Starting up sbt. Will prob take a couple of minutes. Should I do something after publishLocal?
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 23:56
I think sublime should just use it next time you start up ensime
Magnus Andersson
@magnusart
Jan 26 2016 23:56
OK
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 23:57
you'll have to remember to wipe out your ~/.ivy/local after
Magnus Andersson
@magnusart
Jan 26 2016 23:57
Right. I have the dirty-money plugin for that :)
Ghost
@ghost~540393fe163965c9bc2018ce
Jan 26 2016 23:57
cool