These are chat archives for ensime/ensime-atom

24th
May 2016
Alec Zorab
@AlecZorab
May 24 2016 14:14
before I try and chase this down too much - has anyone seen an issue on windows where atom ends up occupying two entire cores spinning full time? The internal profiler seems to think it's all happening in C:\Users\azorab\.atom\packages\Ensime\node_modules\fs-extra\lib\mkdirs\mkdirs.js:24(anonymous function), but that might well be a red herring
Alec Zorab
@AlecZorab
May 24 2016 14:31

.... Apparently I have a loop of

Error: ENOENT: no such file or directory, mkdir 'C:\Users\azorab\AppData\Local\Temp\d-116424-10800-1cqa11fC:' at Error (native)
Error: EEXIST: file already exists, mkdir 'C:\Users\azorab\AppData\Local\Temp' at Error (native)

I'm not a javascript expert, but that seems unusual

Viktor Hedefalk
@hedefalk
May 24 2016 15:03
Ouch, that seems to suck…
Can you provide a full stack to see where the problem arises from our code? We're using a library to get a temp file area and there's either a bug in our code how it's used or a bug in this lib…
Alec Zorab
@AlecZorab
May 24 2016 15:06
well, that file path looks pretty dodgy to me
since I'm not sure that windows paths can have colons in them
Viktor Hedefalk
@hedefalk
May 24 2016 15:07
Oh, yeah…
But I'm really keen on seeing from where in ensime-atom this occurs…
Alec Zorab
@AlecZorab
May 24 2016 15:07
C:\Users\azorab\.atom\packages\Ensime\node_modules\fs-extra\lib\mkdirs\mkdirs.js:24(anonymous function) is what the debugger is showing me
Viktor Hedefalk
@hedefalk
May 24 2016 15:07
So a stack would be great…
Alec Zorab
@AlecZorab
May 24 2016 15:08
I'll see what I can do, but it's a callback loop
soooo not much to go on
Viktor Hedefalk
@hedefalk
May 24 2016 15:08
Ah, ok…
Was this on startup or after a while?
Alec Zorab
@AlecZorab
May 24 2016 15:09
if I double-click any file in the tree
after starting ensime
Viktor Hedefalk
@hedefalk
May 24 2016 15:10
Ok, so probably when ensime-atom tries to typecheck the file. It writes out the file content to a temp file and sends a path to this to ensime-server…
I guess you're already up and running with devtools since you're profiling… Can you open up client.js/coffee and put a break point in typecheckBuffer to see what path's are set there…
AH!
Found the bug…
Ok, silly me!
Problem was I just put the absolute path of the real file as a relative subpath of the temp file area:

tempFilePath = getTempDir() + path

Spot the issue? :)

Alec Zorab
@AlecZorab
May 24 2016 15:14
hah
Viktor Hedefalk
@hedefalk
May 24 2016 15:14
Works fine in *nix :)
But of course this chokes on Windows with two colons…
Please open a ticket on either ensime-atom or ensime-node (where the code is)
I'll fix it tonight if you don't beat me to it. PR would be awesome :) hint, hint. The same issue on getCompletions and maybe more places…
Alec Zorab
@AlecZorab
May 24 2016 15:30
Unfortunately, I'm unlikely to be able to get to it today, I've got vacation starting in a couple of hours and many things to do before then
Viktor Hedefalk
@hedefalk
May 24 2016 18:04
@AlecZorab np
ensime/ensime-atom#233