nwolverson / purescript-language-server

MIT License
183 stars 41 forks source link

IDE Formatter spawing doesn't work on windows #160

Closed wclr closed 2 years ago

wclr commented 2 years ago

It is a known issue that the node's spawn is not consistent across OS. It gives an error in the output when running formatter command - ENOENT.

On windows spawn should be run with additional { shell: true } to work in this case. Though current Node.ChildProcess version doesn't support the shell param for spawn. -(

Also, I noticed that using Purescript IDE formatter works visibly slower (~1 sec) than when using vscode configured formatter (formats almost immediately):

"[purescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
nwolverson commented 2 years ago

I don't recall why the shell version was avoided, but this is why which (or rather node-which) was called for execing purs etc, that's not done for formatters at least partly because there was some slowness issue and it was called each time.

1s is crazy slow, yes via language server is going to introduce some delay, yes windows seems likely to be slower, but that's massive.