zls icon indicating copy to clipboard operation
zls copied to clipboard

Error when opening a zig project folder

Open jfrancisco-neto opened this issue 3 years ago • 3 comments

Zig Version

0.11.0-dev.3395+1e7dcaa3a

Zig Language Server Version

0.11.0-dev.479+c28a59c

Steps to Reproduce

  1. Open an folder with hello world project.

Expected Behavior

To not show errors ?

Actual Behavior

Showing the errors:

Failed to check for update. Reason: (0 , Dc.default) is not a function
info : ( main ): Starting ZLS 0.11.0-dev.479+c28a59c @ 'c:\Users\jfran\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zls_install\zls.exe'
info : ( main ): No config file zls.json found.
info : (config): Using zig executable 'C:\zig\zig.exe'
info : (config): Using zig lib path 'C:\zig\lib'
info : (config): Using build runner global cache path 'C:\Users\jfran\AppData\Local\zig'
info : (config): Detected runtime zig version: '0.11.0-dev.3395+1e7dcaa3a'
info : (server): client is 'Visual Studio Code-1.79.2'
info : (server): zls initializing
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_apply_edits = true, .supports_will_save = true, .supports_will_save_wait_until = true, .supports_publish_diagnostics = true, .supports_code_action_fixall = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true, .supports_workspace_did_change_configuration_dynamic_registration = true }
info : (server): Using offset encoding: utf-16
info : (server): Setting configuration...
warning: (server): Ignoring new value for "zls.record_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.replay_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.builtin_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.zig_lib_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.global_cache_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_global_cache_path": the given new value is invalid
thread 16884 panic: reached unreachable code
???:?:?: 0x7ff748c1bef1 in ??? (zls.exe)
???:?:?: 0x7ff748c17f34 in ??? (zls.exe)
???:?:?: 0x7ff748c72f66 in ??? (zls.exe)
???:?:?: 0x7ff748c38db3 in ??? (zls.exe)
???:?:?: 0x7ff748c21541 in ??? (zls.exe)
???:?:?: 0x7ff748c26b33 in ??? (zls.exe)
???:?:?: 0x7ff748c28561 in ??? (zls.exe)
???:?:?: 0x7ffc03717613 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc038626f0 in ??? (ntdll.dll)
[Info  - 4:48:24 PM] Connection to server got closed. Server will restart.
info : ( main ): Starting ZLS 0.11.0-dev.479+c28a59c @ 'c:\Users\jfran\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zls_install\zls.exe'
info : ( main ): No config file zls.json found.
info : (config): Using zig executable 'C:\zig\zig.exe'
info : (config): Using zig lib path 'C:\zig\lib'
info : (config): Using build runner global cache path 'C:\Users\jfran\AppData\Local\zig'
info : (config): Detected runtime zig version: '0.11.0-dev.3395+1e7dcaa3a'
info : (server): client is 'Visual Studio Code-1.79.2'
info : (server): zls initializing
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_apply_edits = true, .supports_will_save = true, .supports_will_save_wait_until = true, .supports_publish_diagnostics = true, .supports_code_action_fixall = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true, .supports_workspace_did_change_configuration_dynamic_registration = true }
info : (server): Using offset encoding: utf-16
info : (server): Setting configuration...
warning: (server): Ignoring new value for "zls.record_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.replay_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.builtin_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.zig_lib_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.global_cache_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_global_cache_path": the given new value is invalid
thread 15816 panic: reached unreachable code
???:?:?: 0x7ff748c1bef1 in ??? (zls.exe)
???:?:?: 0x7ff748c17f34 in ??? (zls.exe)
???:?:?: 0x7ff748c72f66 in ??? (zls.exe)
???:?:?: 0x7ff748c38db3 in ??? (zls.exe)
???:?:?: 0x7ff748c21541 in ??? (zls.exe)
???:?:?: 0x7ff748c26b33 in ??? (zls.exe)
???:?:?: 0x7ff748c28561 in ??? (zls.exe)
???:?:?: 0x7ffc03717613 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc038626f0 in ??? (ntdll.dll)
[Info  - 4:48:24 PM] Connection to server got closed. Server will restart.
info : ( main ): Starting ZLS 0.11.0-dev.479+c28a59c @ 'c:\Users\jfran\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zls_install\zls.exe'
info : ( main ): No config file zls.json found.
info : (config): Using zig executable 'C:\zig\zig.exe'
info : (config): Using zig lib path 'C:\zig\lib'
info : (config): Using build runner global cache path 'C:\Users\jfran\AppData\Local\zig'
info : (config): Detected runtime zig version: '0.11.0-dev.3395+1e7dcaa3a'
info : (server): client is 'Visual Studio Code-1.79.2'
info : (server): zls initializing
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_apply_edits = true, .supports_will_save = true, .supports_will_save_wait_until = true, .supports_publish_diagnostics = true, .supports_code_action_fixall = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true, .supports_workspace_did_change_configuration_dynamic_registration = true }
info : (server): Using offset encoding: utf-16
info : (server): Setting configuration...
warning: (server): Ignoring new value for "zls.record_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.replay_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.builtin_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.zig_lib_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.global_cache_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_global_cache_path": the given new value is invalid
thread 9308 panic: reached unreachable code
???:?:?: 0x7ff748c1bef1 in ??? (zls.exe)
???:?:?: 0x7ff748c17f34 in ??? (zls.exe)
???:?:?: 0x7ff748c72f66 in ??? (zls.exe)
???:?:?: 0x7ff748c38db3 in ??? (zls.exe)
???:?:?: 0x7ff748c21541 in ??? (zls.exe)
???:?:?: 0x7ff748c26b33 in ??? (zls.exe)
???:?:?: 0x7ff748c28561 in ??? (zls.exe)
???:?:?: 0x7ffc03717613 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc038626f0 in ??? (ntdll.dll)
[Info  - 4:48:24 PM] Connection to server got closed. Server will restart.
info : ( main ): Starting ZLS 0.11.0-dev.479+c28a59c @ 'c:\Users\jfran\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zls_install\zls.exe'
info : ( main ): No config file zls.json found.
info : (config): Using zig executable 'C:\zig\zig.exe'
info : (config): Using zig lib path 'C:\zig\lib'
info : (config): Using build runner global cache path 'C:\Users\jfran\AppData\Local\zig'
info : (config): Detected runtime zig version: '0.11.0-dev.3395+1e7dcaa3a'
info : (server): client is 'Visual Studio Code-1.79.2'
info : (server): zls initializing
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_apply_edits = true, .supports_will_save = true, .supports_will_save_wait_until = true, .supports_publish_diagnostics = true, .supports_code_action_fixall = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true, .supports_workspace_did_change_configuration_dynamic_registration = true }
info : (server): Using offset encoding: utf-16
info : (server): Setting configuration...
warning: (server): Ignoring new value for "zls.record_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.replay_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.builtin_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.zig_lib_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.global_cache_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_global_cache_path": the given new value is invalid
thread 3108 panic: reached unreachable code
???:?:?: 0x7ff748c1bef1 in ??? (zls.exe)
???:?:?: 0x7ff748c17f34 in ??? (zls.exe)
???:?:?: 0x7ff748c72f66 in ??? (zls.exe)
???:?:?: 0x7ff748c38db3 in ??? (zls.exe)
???:?:?: 0x7ff748c21541 in ??? (zls.exe)
???:?:?: 0x7ff748c26b33 in ??? (zls.exe)
???:?:?: 0x7ff748c28561 in ??? (zls.exe)
???:?:?: 0x7ffc03717613 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc038626f0 in ??? (ntdll.dll)
[Info  - 4:48:25 PM] Connection to server got closed. Server will restart.
info : ( main ): Starting ZLS 0.11.0-dev.479+c28a59c @ 'c:\Users\jfran\AppData\Roaming\Code\User\globalStorage\ziglang.vscode-zig\zls_install\zls.exe'
info : ( main ): No config file zls.json found.
info : (config): Using zig executable 'C:\zig\zig.exe'
info : (config): Using zig lib path 'C:\zig\lib'
info : (config): Using build runner global cache path 'C:\Users\jfran\AppData\Local\zig'
info : (config): Detected runtime zig version: '0.11.0-dev.3395+1e7dcaa3a'
info : (server): client is 'Visual Studio Code-1.79.2'
info : (server): zls initializing
info : (server): Server.ClientCapabilities{ .supports_snippets = true, .supports_apply_edits = true, .supports_will_save = true, .supports_will_save_wait_until = true, .supports_publish_diagnostics = true, .supports_code_action_fixall = true, .hover_supports_md = true, .completion_doc_supports_md = true, .label_details_support = true, .supports_configuration = true, .supports_workspace_did_change_configuration_dynamic_registration = true }
info : (server): Using offset encoding: utf-16
info : (server): Setting configuration...
warning: (server): Ignoring new value for "zls.record_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.replay_session_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.builtin_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.zig_lib_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.global_cache_path": the given new value is invalid
warning: (server): Ignoring new value for "zls.build_runner_global_cache_path": the given new value is invalid
thread 14112 panic: reached unreachable code
???:?:?: 0x7ff748c1bef1 in ??? (zls.exe)
???:?:?: 0x7ff748c17f34 in ??? (zls.exe)
???:?:?: 0x7ff748c72f66 in ??? (zls.exe)
???:?:?: 0x7ff748c38db3 in ??? (zls.exe)
???:?:?: 0x7ff748c21541 in ??? (zls.exe)
???:?:?: 0x7ff748c26b33 in ??? (zls.exe)
???:?:?: 0x7ff748c28561 in ??? (zls.exe)
???:?:?: 0x7ffc03717613 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffc038626f0 in ??? (ntdll.dll)
[Error - 4:48:25 PM] The Zig Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

jfrancisco-neto avatar Jun 15 '23 19:06 jfrancisco-neto

Check the extension settings and see if your zig path has a leading slash. Removing that fixed it for me.

sebastianhoffmann avatar Jun 17 '23 00:06 sebastianhoffmann

It worked! I think something went wrong when the extension created the basic config.

jfrancisco-neto avatar Jun 17 '23 01:06 jfrancisco-neto

This isn't a bug in zls but in the vscode extension when using the dialog to specify the zig executable path. I opened a pull request for the fix there: https://github.com/ziglang/vscode-zig/pull/117

sebastianhoffmann avatar Jun 17 '23 01:06 sebastianhoffmann