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

zls-vscode crash - not found `zls.json` #29

Closed kassane closed 2 years ago

kassane commented 2 years ago

I have always used the same configuration and today for the first time after updating zig, this error occurs.

zls installpath: /home/kassane/.local/bin - with zls.json

zls.json config:

$> cat /home/kassane/.local/bin/zls.json
{
  "zig_lib_path": "/home/kassane/.local/lib/zig",
  "zig_exe_path":"/home/kassane/.local/bin",
  "enable_snippets": true,
  "warn_style": true,
  "enable_semantic_tokens": true,
  "operator_completions": true,
  "include_at_in_builtins": false,
  "max_detail_length": 1048576
}

Latest test

Zig version : v0.10.0 [master] - build dev.327+beb7495e1

Debug output:

Enabled debug logging
[Info  - 14:35:56] [info-main] No config file zls.json found.
[Info  - 14:35:56] [info-main] Using zig executable /home/kassane/.local/bin/zig
[Info  - 14:35:56] [info-main] Using zig lib path '/home/kassane/.local/lib/zig'
[err-default] FileNotFound
/home/kassane/.local/lib/zig/std/fs.zig:1521:23: 0x2a3354 in std.fs.Dir.openDirFlagsZ (zls)
            os.openatZ(self.fd, sub_path_c, flags, 0);
                      ^
/home/kassane/.local/lib/zig/std/fs.zig:1530:25: 0x2a3390 in std.fs.Dir.openDirFlagsZ (zls)
            else => |e| return e,
                        ^
/home/kassane/.local/lib/zig/std/fs.zig:0:0: 0x25d7ee in std.fs.Dir.openDir (zls)
/home/kassane/.local/lib/zig/std/fs.zig:1447:13: 0x25d7f6 in std.fs.Dir.openDir (zls)
            return self.openDirZ(&sub_path_c, args);
            ^
/home/kassane/.local/lib/zig/std/heap/arena_allocator.zig:0:16: 0x2524dd in main (zls)
[Error - 14:35:56] Connection to server got closed. Server will not be restarted.

Ref.: #410

kassane commented 2 years ago

I redo the process with zls config and solved it.