zigtools / zls-vscode

Deprecated, please use https://github.com/ziglang/vscode-zig
https://github.com/ziglang/vscode-zig
MIT License
85 stars 15 forks source link

Install server command failed with ENOENT: no such file or directory, mkdir '[...]' #43

Closed mjoork closed 2 years ago

mjoork commented 2 years ago

The install command is failing with an uncaught error:

ENOENT: no such file or directory, mkdir 'c:\Users\mark\AppData\Roaming\Code\User\globalStorage\augusterame.zls-vscode\zls_install'

Runtime Status tab

The output log just states failing to start the server:

[Error - 11:09:28 PM] Zig Language Server client: couldn't create connection to server.
Error: Unsupported server configuration {
    "command": "",
    "args": []
}
    at c:\Users\mark\.vscode\extensions\augusterame.zls-vscode-1.1.0\node_modules\vscode-languageclient\lib\node\main.js:464:35
    at async LanguageClient.createConnection (c:\Users\mark\.vscode\extensions\augusterame.zls-vscode-1.1.0\node_modules\vscode-languageclient\lib\common\client.js:1052:28)
    at async LanguageClient.start (c:\Users\mark\.vscode\extensions\augusterame.zls-vscode-1.1.0\node_modules\vscode-languageclient\lib\common\client.js:617:32)
mjoork commented 2 years ago

On Windows, mkdir command indeed creates all intermediate directories as well, wonder why it fails to do so invoked by VSCode...

mjoork commented 2 years ago

I found the issue. Sorry for opening this, but maybe will be helpful for someone.

The problem was in my terminal multiplexer - cmder. When using full installation, cmder creates some aliases for some commands to mimic *NIX commands, so when you run VSCode from cmder using code, it was invoking a unix command mkdir without -p.

mjoork commented 2 years ago

I tried replicating that it works when VSCode isn't run from inside cmder. The issue is not resolved. It still fails with the same error. Creating a directory manually helps though.

P.S.: I kindly apologize for doing so much actions on this issue in a short amount of time.

SuperAuguste commented 2 years ago

Thanks for opening an issue! It's definitely not a terminal related issue as we're using the mkdir syscall through node's fs rather than a terminal command; the fix for this is adding mkdirp to the extension; I'll fix it tomorrow!

SuperAuguste commented 2 years ago

Update the extension and try using it now, this issue should be fixed!

mjoork commented 2 years ago

Thank you, unfortunately can't test it right now, but I believe you that it was fixed.