Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Windows 10, VS Code: HIE server crashes - spaces in path not handled properly? #565

Closed
mpilgrem opened this issue May 12, 2018 · 6 comments

Comments

@mpilgrem
Copy link
Contributor

I have almost identical setups on two Windows 10 machines. HIE/Haskell Language Server (HLS) works with VS Code on one, but fails on startup on the other with the following 'notification' message ('HelloWorld' is the name of the test Haskell project, created with stack new HelloWorld):

The Haskell HIE (HelloWorld) server crashed 5 times in the last 3 minutes. The server will not be restarted.

and messages in 'OUTPUT' ('Haskell HIE (HelloWorld)') like:

[Info  - 20:04:10] Connection to server got closed. Server will restart.
Pilgrem\AppData\Roaming\local\bin\hie.exe] was unexpected at this time.
[Error - 20:04:10] Connection to server got closed. Server will not be restarted.

One difference between the setups is that there is a space in the path on the one that is failing and not in the one that works. That is, hie.exe is located (on the one that fails) at:

>where hie
C:\Users\Mike Pilgrem\AppData\Roaming\local\bin\hie.exe

and the 'output' above seems to reference only the part of the path after the space.

I wondered if HIE or the Haskell Language Server extension for VS Code was failing to treat paths with spaces correctly?

For reference:

  • hie.exe --version is Version 0.2.0.0, Git revision 753deb91f9b9b39f14722315277d9fd587716bde (1341 commits) x86_64 ghc-8.2.2
  • code --version is 1.23.1, d0182c3417d225529c6d5ad24b7572815d0de9ac, x64
  • Haskell Language Server is version 0.0.16
@johnsonwj
Copy link

Are there any useful messages in AppData\Local\Temp\hie.log?

@mpilgrem
Copy link
Contributor Author

mpilgrem commented May 17, 2018

@johnsonwj, there is no hie.log file at that location.

If I move hie.exe to a location on my PATH with no spaces in the path, everything then works as expected - which is an easy work-around but not the desired behaviour.

A little knowledge can be a dangerous thing, but I wondered in repository alanz/vscode-hie-server, file src/extension.ts, whether:

const serverPath =
    useCustomWrapper || hieExecutablePath ? startupScript : context.asAbsolutePath(path.join('.', startupScript));

should be modified to put quotation marks around the string on Windows? - given:

const serverOptions: ServerOptions = {
    run: { command: serverPath, transport: TransportKind.stdio, args: runArgs },
    debug: { command: serverPath, transport: TransportKind.stdio, args: debugArgs }
  };

but I did not know how to test that idea.

@Anrock
Copy link
Collaborator

Anrock commented May 23, 2018

Probably it's really vscode hie plugin - reproducable on vscode, not reproducable with neovim on the same project, same hie binary, same path.

@mpilgrem
Copy link
Contributor Author

I'll open an issue in that repository then.

@alanz
Copy link
Collaborator

alanz commented Dec 24, 2018

Does anything need to be done in hie for this?

@alanz alanz added this to the Some time milestone Dec 24, 2018
@jneira
Copy link
Member

jneira commented Oct 1, 2019

Hi, not sure how but i just tried:

  • Put hie in a path with spaces and setting it in the extension option Hie Executable Path
  • Set the location with spaces of hie in %PATH% (removing the previous extension option)

And the hie server is launced in both cases.

Hie version:

Version 0.12.0.0, Git revision 38cf06b9d290cdaafef24e0ae8f62c9dd5dac3e8 (dirty)
(3011 commits) x86_64 ghc-8.6.5

vscode version: 1.38.1

So it seems this is fixed, i think we can close it, @mpilgrem feel free to reopen if you still are hitting it

@jneira jneira closed this as completed Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants