Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"null" (string type) in zls.json causes crash #1129

Closed
20kano opened this issue Apr 14, 2023 · 16 comments · Fixed by #1366
Closed

"null" (string type) in zls.json causes crash #1129

20kano opened this issue Apr 14, 2023 · 16 comments · Fixed by #1366
Labels
bug Something isn't working

Comments

@20kano
Copy link

20kano commented Apr 14, 2023

Zig Version

0.11.0-dev.2571+31738de28

Zig Language Server Version

0.11.0-dev.378+5457cec

Steps to Reproduce

I have just started it..

I can't tell if it's a bug or a problem with my settings...

Expected Behavior

No error.

Actual Behavior

[Info  - 12:26:57] Connection to server got closed. Server will restart.
info : (config): Using zig executable '/home/tsukasa/lang/zig/zig'
info : (config): Using zig lib path '/home/tsukasa/lang/zig/lib'
info : (config): Using build runner global cache path '/home/tsukasa/.cache/zig'
info : (config): Detected runtime zig version: '0.11.0-dev.2571+31738de28'
info : (server): client is 'Visual Studio Code-1.77.3'
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.zig_exe_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
info : (config): Using zig executable '/home/tsukasa/lang/zig/zig'
info : (config): Using zig lib path '/home/tsukasa/lang/zig/lib'
info : (config): Using build runner global cache path '/home/tsukasa/.cache/zig'
info : (config): Detected runtime zig version: '0.11.0-dev.2571+31738de28'
thread 32898 panic: reached unreachable code
[Error - 12:26:58] 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.
@20kano 20kano added the bug Something isn't working label Apr 14, 2023
@llogick
Copy link
Contributor

llogick commented Apr 14, 2023

Would you be able to reproduce the issue with a debug build of ZLS?

@20kano
Copy link
Author

20kano commented Apr 14, 2023

Huh!? I replaced it with a debug build and it works fine.
Same version..

And, When I revert to the original, still get the same error..

Both 0.11.0-dev.378+5457cec

@20kano
Copy link
Author

20kano commented Apr 14, 2023

Tried new -Doptimize=ReleaseSafe one, it gives same error.

@leecannon
Copy link
Member

@20kano Just to check do you have the comptime interpreter option enabled? If so, disable it.

@20kano
Copy link
Author

20kano commented Apr 14, 2023

It has been off.
"use_comptime_interpreter": false,

@leecannon
Copy link
Member

Okay, any chance of seeing the code that it is crashing with.

@20kano
Copy link
Author

20kano commented Apr 14, 2023

debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/io/reader.zig`
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/os.zig`
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/testing.zig`
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/Thread.zig`
debug: (server): Took 237ms to process method textDocument/semanticTokens/full
thread 116818 panic: reached unreachable code
/home/tsukasa/lang/zig/lib/std/debug.zig:281:14: 0x3717cc in assert (zls)
    if (!ok) unreachable; // assertion failure
             ^
/home/tsukasa/lang/zig/lib/std/fs.zig:2729:27: 0x37d01a in openFileAbsolute (zls)
    assert(path.isAbsolute(absolute_path));
                          ^
/home/tsukasa/lang/zls/src/DocumentStore.zig:833:39: 0x50a991 in createDocumentFromURI (zls)
    var file = std.fs.openFileAbsolute(file_path, .{}) catch return null;
                                      ^
/home/tsukasa/lang/zls/src/DocumentStore.zig:145:47: 0x50a59f in getOrLoadHandleInternal (zls)
    handle.* = (try self.createDocumentFromURI(uri, false)) orelse return error.Unknown; // error name doesn't matter
                                              ^
/home/tsukasa/lang/zls/src/DocumentStore.zig:136:40: 0x46a9c0 in getOrLoadHandle (zls)
    return self.getOrLoadHandleInternal(uri) catch null;
                                       ^
/home/tsukasa/lang/zls/src/analysis.zig:1054:66: 0x501172 in resolveTypeOfNodeUncached (zls)
                const new_handle = analyser.store.getOrLoadHandle(import_uri) orelse return null;
                                                                 ^
/home/tsukasa/lang/zls/src/analysis.zig:679:63: 0x466506 in resolveTypeOfNodeInternal (zls)
    const type_handle = try analyser.resolveTypeOfNodeUncached(node_handle);
                                                              ^
/home/tsukasa/lang/zls/src/analysis.zig:724:58: 0x4fe69b in resolveTypeOfNodeUncached (zls)
            return try analyser.resolveTypeOfNodeInternal(value);
                                                         ^
/home/tsukasa/lang/zls/src/analysis.zig:679:63: 0x466506 in resolveTypeOfNodeInternal (zls)
    const type_handle = try analyser.resolveTypeOfNodeUncached(node_handle);
                                                              ^
/home/tsukasa/lang/zls/src/analysis.zig:1362:46: 0x46ac80 in resolveTypeOfNode (zls)
    return analyser.resolveTypeOfNodeInternal(node_handle);
                                             ^
/home/tsukasa/lang/zls/src/features/semantic_tokens.zig:338:55: 0x4e27b1 in writeNodeTokens (zls)
            if (try builder.analyser.resolveTypeOfNode(.{ .node = node, .handle = handle })) |decl_type| {
                                                      ^
/home/tsukasa/lang/zls/src/features/semantic_tokens.zig:1053:28: 0x45aeeb in writeSemanticTokens (zls)
        try writeNodeTokens(&builder, child);
                           ^
/home/tsukasa/lang/zls/src/Server.zig:836:22: 0x4207f3 in semanticTokensFullHandler (zls)
        server.config.semantic_tokens == .partial,
                     ^
/home/tsukasa/lang/zls/src/Server.zig:1504:35: 0x3da4e8 in processMessage (zls)
                break :blk handler(server, params) catch |err| {
                                  ^
/home/tsukasa/lang/zls/src/Server.zig:1361:26: 0x38410a in processJsonRpc (zls)
    server.processMessage(message) catch |err| switch (message) {
                         ^
/home/tsukasa/lang/zls/src/main.zig:81:30: 0x38389b in loop (zls)
        server.processJsonRpc(json_message);
                             ^
/home/tsukasa/lang/zls/src/main.zig:396:13: 0x384c98 in main (zls)
    try loop(server, record_file, replay_file);
            ^
/home/tsukasa/lang/zig/lib/std/start.zig:628:37: 0x36c20e in posixCallMainAndExit (zls)
            const result = root.main() catch |err| {
                                    ^
/home/tsukasa/lang/zig/lib/std/start.zig:387:5: 0x36bc71 in _start (zls)
    @call(.never_inline, posixCallMainAndExit, .{});
    ^
[Error - 21:45:20] 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.

@20kano
Copy link
Author

20kano commented Apr 14, 2023

This seems to happen when CompileStep.zig is opened.

@llogick
Copy link
Contributor

llogick commented Apr 14, 2023

I haven't been able to reproduce it, but the error trace points to an @import and a file_path that isn't absolute..

Might be able to catch it with a

log.debug("createDocumentFromURI -> file_path: {s}", .{file_path});

in /home/tsukasa/lang/zls/src/DocumentStore.zig at line 832, right before

/home/tsukasa/lang/zls/src/DocumentStore.zig:833:39: 0x50a991 in createDocumentFromURI (zls)
    var file = std.fs.openFileAbsolute(file_path, .{}) catch return null;

.

@20kano
Copy link
Author

20kano commented Apr 15, 2023

[Info  - 20:58:05] Connection to server got closed. Server will restart.
info : (config): Using zig executable '/home/tsukasa/lang/zig/zig'
info : (config): Using zig lib path '/home/tsukasa/lang/zig/lib'
info : (config): Using build runner global cache path '/home/tsukasa/.cache/zig'
info : (config): Detected runtime zig version: '0.11.0-dev.2582+25e3851fe'
info : (server): client is 'Visual Studio Code-1.77.3'
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
debug: (server): Took 2ms to process method initialize
debug: (server): Dynamically registering method 'workspace/didChangeConfiguration'
debug: (server): Took 1ms to process method initialized
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/main_linux.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/main_linux.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/trade_build.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (server): Took 71ms to process method textDocument/didOpen
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/main.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (server): Took 4ms to process method textDocument/didOpen
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/android/AndroidBuilder.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (server): Took 7ms to process method textDocument/didOpen
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zls/src/main.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zls/src/main.zig` with build file `file:///home/tsukasa/lang/zls/build.zig`
debug: (store ): Opened document `file:///home/tsukasa/lang/zls/src/DocumentStore.zig` with build file `file:///home/tsukasa/lang/zls/build.zig`
debug: (server): Took 73ms to process method textDocument/didOpen
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.zig_exe_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
debug: (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 : (config): Using zig executable '/home/tsukasa/lang/zig/zig'
info : (config): Using zig lib path '/home/tsukasa/lang/zig/lib'
info : (config): Using build runner global cache path '/home/tsukasa/.cache/zig'
info : (config): Detected runtime zig version: '0.11.0-dev.2582+25e3851fe'
debug: (server): Took 2ms to process method textDocument/documentSymbol
debug: (server): Took 9ms to process method textDocument/codeAction
debug: (server): Took 2ms to process method textDocument/foldingRange
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/std.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/std.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/Build.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/Build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/Build/CompileStep.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/Build/CompileStep.zig`
debug: (server): Took 89ms to process method textDocument/semanticTokens/full
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/debug.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/debug.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/mem.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/mem.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/source.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/source.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/trade.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/trade.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/gui.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/gui.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/window.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/window.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/layout.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/layout.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/button.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/button.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/spacer.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/spacer.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/chartview.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/chartview.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/periodselector.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/periodselector.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/time/dt.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/time/dt.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/mt4.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/mt4.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/bar.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/bar.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/account.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/account.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/mem/Allocator.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/mem/Allocator.zig`
debug: (server): Took 232ms to process method textDocument/semanticTokens/full
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/sokol/build_sokol.zig
debug: (store ): Opened document `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/src/trade/chart/gui/sokol/build_sokol.zig` with build file `file:///home/tsukasa/develop/zigprojects/tradeapps/tradeapp/build.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/zig.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/zig.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/zig/CrossTarget.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/zig/CrossTarget.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/target.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/target.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/target/arm.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/target/arm.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/Build/WriteFileStep.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/Build/WriteFileStep.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/builtin.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/builtin.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/Build/RunStep.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/Build/RunStep.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/fs.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/fs.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/Build/Step.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/Build/Step.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/array_list.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/array_list.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/io.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/io.zig`
debug: (store ): createDocumentFromURI -> file_path: /home/tsukasa/lang/zig/lib/std/io/writer.zig
debug: (store ): Opened document `file:///home/tsukasa/lang/zig/lib/std/io/writer.zig`
debug: (server): Took 322ms to process method textDocument/semanticTokens/full
debug: (store ): createDocumentFromURI -> file_path: null
thread 2941 panic: reached unreachable code
/home/tsukasa/lang/zig/lib/std/debug.zig:281:14: 0x3718cc in assert (zls)
    if (!ok) unreachable; // assertion failure
             ^
/home/tsukasa/lang/zig/lib/std/fs.zig:2729:27: 0x37d11a in openFileAbsolute (zls)
    assert(path.isAbsolute(absolute_path));
                          ^
/home/tsukasa/lang/zls/src/DocumentStore.zig:833:39: 0x50aab9 in createDocumentFromURI (zls)
    var file = std.fs.openFileAbsolute(file_path, .{}) catch return null;

@llogick
Copy link
Contributor

llogick commented Apr 15, 2023

Makes me wanna have a look at your zls.json and any vscode settings related to ZLS — do you remember entering/specifying null for any of them?

@20kano
Copy link
Author

20kano commented Apr 15, 2023

{
	"$schema": "https://raw.githubusercontent.com/zigtools/zls/master/schema.json",
	"enable_snippets": true,
	"enable_ast_check_diagnostics": false,
	"enable_autofix": false,
	"enable_import_embedfile_argument_completions": false,
	"semantic_tokens": "full",
	"enable_inlay_hints": false,
	"inlay_hints_show_builtin": false,
	"inlay_hints_exclude_single_argument": false,
	"inlay_hints_hide_redundant_param_names": false,
	"inlay_hints_hide_redundant_param_names_last_token": false,
	"operator_completions": true,
	"warn_style": false,
	"highlight_global_var_declarations": false,
	"use_comptime_interpreter": false,
	"include_at_in_builtins": false,
	"skip_std_references": false,
	"max_detail_length": 1048576,
	"prefer_ast_check_as_child_process": true,
	"record_session": false,
	"record_session_path": "null",
	"replay_session_path": "null",
	"builtin_path": "null",
	"zig_lib_path": "/home/tsukasa/lang/zig/lib/zig",
	"zig_exe_path": "/home/tsukasa/lang/zig/zig",
	"build_runner_path": "/home/tsukasa/.cache/zls/build_runner.zig",
	"global_cache_path": "null",
	"build_runner_global_cache_path": "null"
}

@20kano
Copy link
Author

20kano commented Apr 15, 2023

範囲を選択_009
範囲を選択_010
範囲を選択_011
範囲を選択_012
範囲を選択_013
範囲を選択_014
範囲を選択_015

@20kano
Copy link
Author

20kano commented Apr 15, 2023

For example, zig_lib_path, zls.json has a value, but VSCode has a blank value. Why is this?

@llogick
Copy link
Contributor

llogick commented Apr 15, 2023

Here,

  "global_cache_path": "null",
  "build_runner_global_cache_path": "null"

"null" is a string (I didn't consider how schema,json presents it). You can either make it null (no quotes) or omit the setting and ZLS will use the default which happens to be null for both.

For example, zig_lib_path, zls.json has a value, but VSCode has a blank value. Why is this?

zls.json is primary/any editor (or rather in case the editor doesn't support lsp settings), if the editor does support them they get requested and if not set/blank the ones from zls.json are used.

@20kano
Copy link
Author

20kano commented Apr 16, 2023

Works, Thanks!

@20kano 20kano changed the title crash many times.. null string type in vls.json causes crash Apr 20, 2023
@20kano 20kano changed the title null string type in vls.json causes crash "null" (string type) in vls.json causes crash Apr 20, 2023
@20kano 20kano changed the title "null" (string type) in vls.json causes crash "null" (string type) in zls.json causes crash Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants