These are chat archives for ensime/ensime-sublime

28th
Jul 2016
Jay Shin
@jshin49
Jul 28 2016 01:12
hey guys
i've been getting this error: PermissionError: [WinError 5]
Saying that access has been denied
when trying to run Ensime Startup
It seems like sublime cannot find sbt
the following works:
import subprocess; print(subprocess.check_output(['where', 'sbt'], stderr=subprocess.STDOUT).decode("utf-8"))
in the subime console,
but
this
import subprocess; print(subprocess.check_output(['sbt', 'sbtVersion'], stderr=subprocess.STDOUT).decode("utf-8"))
Jay Shin
@jshin49
Jul 28 2016 01:17
doesn't work
Dick Wall
@dickwall
Jul 28 2016 12:55
hmm - yeah - not very up on Windows, but I would certainly check if you can run sbt from the command prompt without problem (I am assuming you can)
so if you type sbt sbtVersion at the command prompt, does it work?
in other news, I have a working classpath search in ensime-sublime now!
but it's rough
two things I am throwing out to crowd sourcing (if anyone knows)
the dialog prompt happens at the bottom of the window (as all of my dialog inputs do right now), however I notice certain other prompts are able to use the center/top of the window instead (which would be much nicer in this case), e.g. goto line
is that possible in the API does anyone know, and if so, how?
second, even nicer would be integration into the CTRL-P find-everything command, but I don't even know where to start on that
if I can't figure it, I will check what I have in - it's better than nothing, although it is clunky
if anyone knows the starting points for either of these options, please let me know
Jay Shin
@jshin49
Jul 28 2016 13:56
yes as you assumed, 'sbt sbtVersion'works fine
on the cmd prompt of windows
so i guess there's not much of support yet for windows?
Dick Wall
@dickwall
Jul 28 2016 13:57
as far as I know it works for other people
Rory has run it on windows
there might be a regression, we really need a windows team member to stay on top of that...
Jay Shin
@jshin49
Jul 28 2016 14:00
so i was reading the troubleshooting guide regarding this issue
of Sublime Text not finding sbt
it provided me a way to diagnose the problem, but not a solution.
Any insights?
Dick Wall
@dickwall
Jul 28 2016 14:01
nothing that I haven't covered already - sorry - just not a windows user
this is the right place to ask though
Rory Graves
@rorygraves
Jul 28 2016 14:01
There is a config flag that you can use to explicitly tell it where to find sbt. I can never remember what it is. Thought it was in the docs.
On mobile at the mo so can't check.
Jay Shin
@jshin49
Jul 28 2016 14:24
yes
i set it on the 'Package Settings - ensime - user settings'
is this where you were referring to?
Rory Graves
@rorygraves
Jul 28 2016 14:25
That sounds like it.
Jay Shin
@jshin49
Jul 28 2016 14:25
something like
{ sbt_path : ''path/to/sbt' }
Rory Graves
@rorygraves
Jul 28 2016 14:26
Yep.
If you run. Path/to/sbt from a command prompt does it work?
Jay Shin
@jshin49
Jul 28 2016 14:26
yes
and just running
sbt also works
{ "sbt_binary": "C:\Program Files (x86)\sbt\bin" }
do you think it could bethe path issue?
becasue of the white space?
Rory Graves
@rorygraves
Jul 28 2016 14:28
Oh yeah could be.
If you do subprocess.checkout with the full path does it work?
Jay Shin
@jshin49
Jul 28 2016 14:32
the following command works on git bash
c/program\ \files\ (x86)/sbt/bin/sbt
Rory Graves
@rorygraves
Jul 28 2016 14:34
The key is to get the subprocess command test command to work. I.e.fiddle with the path until it works correctly. The use that in your config file.
I would fiddle myself but I won't b near a I does box until Sat
Jay Shin
@jshin49
Jul 28 2016 14:35
ok
ill try to make it work and let you know the solution
but maybe ill start out by reinstalling sbt and scala
to
c/sbt and c/scala
this is why i hate windows
haha
Rory Graves
@rorygraves
Jul 28 2016 14:36
Lol. Cool. Let us know.
this guide is wrong
in this part:
Next you need to add SBT to your Sublime path, within Sublime Text, go to the Preferences > Package Settings > Settings > Ensime and select Settings - User to open the Ensime.sublime-settings file. Now add the following to this file. json { "sbt_binary": "/path/to/sbt" }
changing the last to
{"sbt_path": "path/to/sbt"}
made the server start
how can i test if ensime works?
Rory Graves
@rorygraves
Jul 28 2016 15:05
Oh. Darn. It's a failure in the quoting in the documentation.
Open a Scala file in your project introduce an error and save. You should get a red outline around the error.
Jay Shin
@jshin49
Jul 28 2016 15:06
i see
Rory Graves
@rorygraves
Jul 28 2016 15:06
You should also have completions etc.
Jay Shin
@jshin49
Jul 28 2016 15:07
it still doesn't find sbt by the way, but at least the startup worked.
{ "sbt_binary": "/path/to/sbt" }
this gives me permission errors,
but this doesn't: {"sbt_path": "path/to/sbt"}
that's weird
Rory Graves
@rorygraves
Jul 28 2016 15:11
I'm amazed the startup works if it can't find sbt. We use it during startup. So it's working on editing files? Which part is giving you an error?
Jay Shin
@jshin49
Jul 28 2016 15:26
there is no error
but it doesnt seem like ensime is working

[Ensime] 2016-07-28 17:25:06,522 [INFO ] -----------------------------------------------------------
[Ensime] 2016-07-28 17:25:06,522 [INFO ] Initialising server
[Ensime] 2016-07-28 17:25:06,523 [INFO ] Cache dir = C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache
[Ensime] 2016-07-28 17:25:06,523 [INFO ] Java home = C:\Program Files (x86)\Java\jdk1.8.0_73
[Ensime] 2016-07-28 17:25:06,523 [INFO ] Target scala version = 2.10.6
[Ensime] 2016-07-28 17:25:06,529 [INFO ] Resolving, log available in C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache\Resolution\saveClasspath.log
[Ensime] 2016-07-28 17:25:06,530 [INFO ] Running sbt saveClasspath (in C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache\Resolution)
[Ensime] 2016-07-28 17:25:06,536 [INFO ] Save classpath task running

import subprocess; print(subprocess.check_output(['sbt', 'sbtVersion'], stderr=subprocess.STDOUT).decode("utf-8"))
Traceback (most recent call last):
File "./python3.3/subprocess.py", line 1104, in _execute_child
FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다

ensime.png
Rory Graves
@rorygraves
Jul 28 2016 15:30
Ah. What does the user config file say exactly?
Startup is not working still
Jay Shin
@jshin49
Jul 28 2016 15:31
blob
what do you mean by the user config file?
the { "sbt_path": "C:\sbt\bin" }?
Rory Graves
@rorygraves
Jul 28 2016 15:38
That should be c:sbtinsbt.
Ignore the .
Yeah that file.
It should be the executable not the dir.
I.e. C:\sbt\bin\sbt
Jay Shin
@jshin49
Jul 28 2016 15:44
ah
indexing [queue 19]: no files were indexed out of the 1 queued, abandoning crawl
this is the error outputed when i intentionaly create an error in my scala file
Rory Graves
@rorygraves
Jul 28 2016 15:46
It had not finished indexing yet. Give it a moment s d it will give you a humours message.
Jay Shin
@jshin49
Jul 28 2016 15:49
ill loook into it later after work
i changed the path to the following :
{ "sbt_path": "C:\sbt\bin\sbt" }
hmm
two backslahses
\
\\
{ "sbt_path": "C:\\sbt\\bin\\sbt" }
sublime doesn't like it with just one backslash
is that right?
it still doesn't seem to find sbt
Rory Graves
@rorygraves
Jul 28 2016 15:51
I think it should be one slash. Try the test command you posted earlier with you new path. I'm not sure what the correct form under Windows is.
You should see the startup log showing the class path generation and then server startup info.
Jay Shin
@jshin49
Jul 28 2016 15:54
[Ensime] 2016-07-28 17:25:06,522 [INFO ] -----------------------------------------------------------
[Ensime] 2016-07-28 17:25:06,522 [INFO ] Initialising server
[Ensime] 2016-07-28 17:25:06,523 [INFO ] Cache dir = C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache
[Ensime] 2016-07-28 17:25:06,523 [INFO ] Java home = C:\Program Files (x86)\Java\jdk1.8.0_73
[Ensime] 2016-07-28 17:25:06,523 [INFO ] Target scala version = 2.10.6
[Ensime] 2016-07-28 17:25:06,529 [INFO ] Resolving, log available in C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache\Resolution\saveClasspath.log
[Ensime] 2016-07-28 17:25:06,530 [INFO ] Running sbt saveClasspath (in C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache\Resolution)
[Ensime] 2016-07-28 17:25:06,536 [INFO ] Save classpath task running
nothing happens after that log
my laptop is out of battery so im on mobile now.
With one slash, Sublime gives me errors/warnings.
The test command for getting the sbt version still doesn't work.
It works for Java, by the way.
import subprocess; print(subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT).decode("utf-8"))
works
Rory Graves
@rorygraves
Jul 28 2016 15:59
Ok. It's something funny about sbt. Maybe it's a script or something.
That's the fundamental issue that sublime is not able to get sbt to run
Jay Shin
@jshin49
Jul 28 2016 17:08
I just found out that
import subprocess; print(subprocess.check_output(['scala', '-version'], stderr=subprocess.STDOUT).decode("utf-8"))
doesn't work either
so maybe its not just sbt
Rory Graves
@rorygraves
Jul 28 2016 18:19
Ah try sbt.bat in your commands.
Jay Shin
@jshin49
Jul 28 2016 19:11
ahh
that works
sublime finds sbt
startup now gives a different error
[Ensime] 2016-07-28 21:12:35,925 [INFO ] Save classpath task failed with error 1 check C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache\Resolution\saveClasspath.log
[Ensime] 2016-07-28 21:12:35,927 [INFO ] Failed to start
indexing [queue 4]: no files were indexed out of the 39 queued, abandoning crawl
does the scala version matter?
[Ensime] 2016-07-28 21:13:36,899 [INFO ] Target scala version = 2.10.6
and my scala version is 2.11.8
Rory Graves
@rorygraves
Jul 28 2016 20:17
That should not matter. Sbt ensures it is built with the right Scala version.
Ah what's in the saveClasspath.log?
Jay Shin
@jshin49
Jul 28 2016 20:19
.

Warning: invalid system property 'sbt.log.noformat'
[info] Loading global plugins from C:\Users\jshin.sbt\0.13\plugins
[info] Updating {file:/C:/Users/jshin/.sbt/0.13/plugins/}global-plugins...
[info] Resolving org.ensime#sbt-ensime;1.0.0 ...

[info] Resolving org.scala-lang#scalap;2.10.6 ...

[info] Resolving org.scala-lang#scala-compiler;2.10.5 ...

[info] Resolving org.scala-lang#scala-library;2.10.5 ...

[info] Resolving org.scala-lang#scala-reflect;2.10.5 ...

[info] Resolving org.scalariform#scalariform_2.10;0.1.4 ...

[info] Resolving org.scala-sbt#sbt;0.13.9 ...

[info] Resolving org.scala-sbt#main;0.13.9 ...

[info] Resolving org.scala-sbt#actions;0.13.9 ...

[info] Resolving org.scala-sbt#classpath;0.13.9 ...

[info] Resolving org.scala-sbt#interface;0.13.9 ...

[info] Resolving org.scala-sbt#io;0.13.9 ...

[info] Resolving org.scala-sbt#control;0.13.9 ...

[info] Resolving org.scala-sbt#launcher-interface;1.0.0-M1 ...

[info] Resolving org.scala-sbt#completion;0.13.9 ...

[info] Resolving org.scala-sbt#collections;0.13.9 ...

[info] Resolving jline#jline;2.11 ...

[info] Resolving org.scala-sbt#api;0.13.9 ...

[info] Resolving org.scala-sbt#compiler-integration;0.13.9 ...

[info] Resolving org.scala-sbt#incremental-compiler;0.13.9 ...

[info] Resolving org.scala-sbt#logging;0.13.9 ...

[info] Resolving org.scala-sbt#process;0.13.9 ...

[info] Resolving org.scala-sbt#relation;0.13.9 ...

[info] Resolving org.scala-sbt#compile;0.13.9 ...

[info] Resolving org.scala-sbt#classfile;0.13.9 ...

[info] Resolving org.scala-sbt#persist;0.13.9 ...

[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...

[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.9 ...

[info] Resolving org.scala-sbt#ivy;0.13.9 ...

[info] Resolving org.scala-sbt#cross;0.13.9 ...

[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-c5d1b95fdcc1e1007740ffbecf4eb07abc51ec93 ...

[info] Resolving com.jcraft#jsch;0.1.46 ...

[info] Resolving org.scala-sbt#serialization_2.10;0.1.1 ...

[info] Resolving org.scala-lang.modules#scala-pickling_2.10;0.10.0 ...

[info] Resolving org.scalamacros#quasiquotes_2.10;2.0.1 ...

[info] Resolving org.json4s#json4s-core_2.10;3.2.10 ...

[info] Resolving org.json4s#json4s-ast_2.10;3.2.10 ...

[info] Resolving com.thoughtworks.paranamer#paranamer;2.6 ...

[info] Resolving org.spire-math#jawn-parser_2.10;0.6.0 ...

[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...

[info] Resolving org.scala-sbt#run;0.13.9 ...

[info] Resolving org.scala-sbt#task-system;0.13.9 ...

[info] Resolving org.scala-sbt#tasks;0.13.9 ...

[info] Resolving org.scala-sbt#tracking;0.13.9 ...

[info] Resolving org.scala-sbt#cache;0.13.9 ...

[info] Resolving org.scala-sbt#testing;0.13.9 ...

[info] Resolving org.scala-sbt#test-agent;0.13.9 ...

[info] Resolving org.scala-sbt#test-interface;1.0 ...

[info] Resolving org.scala-sbt#main-settings;0.13.9 ...

[info] Resolving org.scala-sbt#apply-macro;0.13.9 ...

[info] Resolving org.scala-sbt#command;0.13.9 ...

[info] Resolving org.scala-sbt#logic;0.13.9 ...

[info] Resolving org.scala-sbt#compiler-interface;0.13.9 ...

[info] Resolving org.scala-sbt#precompiled-2_8_2;0.13.9 ...

[info] Resolving org.scala-sbt#precompiled-2_9_2;0.13.9 ...

[info] Resolving org.scala-sbt#precompiled-2_9_3;0.13.9 ...

[info] Resolving org.scala-lang#jline;2.10.5 ...

[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from C:\Users\jshin\Dropbox\Dev\workspace\Scala\hackerrank.ensime_cache\Resolution\project
[info] Updating {file:/C:/Users/jshin/Dropbox/Dev/workspace/Scala/hackerrank/.ensime_cache/Resolution/project/}resolution-build...
[info] Resolving org.scala-sbt#global-plugins;0.0 ...

[info] Resolving org.ensime#sbt-ensime;1.0.0 ...

[info] Resolving org.scala-lang#scalap;2.10.6 ...

[info] Resolving org.scala-lang#scala-compiler;2.10.5 ...

[info] Resolving org.scala-lang#scala-library;2.10.5 ...

oh sorry for populating the chat. I didn't know you could uplaod files
Rory Graves
@rorygraves
Jul 28 2016 20:29
Oh thats weird, I'm not sure whats blowing up there
@fommil Any idea whats going on here?
I will have to try this out at the weekend.
Jay Shin
@jshin49
Jul 28 2016 21:11
im not sure how you'll reproduce my error
im on Windows 10 64 bit, scala version 2.11.8, sbt version 0.13.12, and the latest version of Sublime Text 3
any other information that might be necessary to reproduce this error i have?
Rory Graves
@rorygraves
Jul 28 2016 21:13
Fair enough. How did you install sbt/Scala?
Jay Shin
@jshin49
Jul 28 2016 21:13
ah with the standard Windows installer
from their websites
Rory Graves
@rorygraves
Jul 28 2016 21:13
Cool.
Jay Shin
@jshin49
Jul 28 2016 21:14
thanks for helping me out
Rory Graves
@rorygraves
Jul 28 2016 21:15
No problem. We will get there.
Will try to reproduce on Sat. I'm out of ideas without a Windows PC.
Jay Shin
@jshin49
Jul 28 2016 21:16
alright. In the meanwhilie, I'll keep dig into this and let you know if there was any progress