diff --git a/build.zig b/build.zig index 36b51873c8..4505b178d8 100644 --- a/build.zig +++ b/build.zig @@ -66,9 +66,8 @@ pub fn build(b: *Build) !void { test_options.step.name = "ZLS test options"; test_options.addOptionPath("zig_exe_path", .zig_exe); - // https://codeberg.org/ziglang/zig/issues/35766 - // test_options.addOptionPath("zig_lib_path", .zig_lib); - // test_options.addOptionPath("global_cache_path", std.Build.LazyPath.cache_root.join(b.allocator, "zls") catch @panic("OOM")); + test_options.addOptionPathUntracked("zig_lib_path", .zig_lib); + test_options.addOptionPathUntracked("global_cache_path", std.Build.LazyPath.cache_root.join(b.allocator, "zls") catch @panic("OOM")); break :blk test_options.createModule(); }; @@ -335,7 +334,7 @@ fn getVersion(b: *Build) std.SemanticVersion { const io = b.graph.io; const git_file = b.root.openFile(io, ".git", .{ .allow_directory = false }) catch |err| switch (err) { error.IsDir => { - b.dependOnFileContents(b.path(".git/logs/HEAD")); + b.dependOnFileMetadata(b.path(".git/logs/HEAD")); break :git; }, error.FileNotFound => { diff --git a/build.zig.zon b/build.zig.zon index 123567fe74..457c65a2f7 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -10,7 +10,7 @@ // nix flake update --commit-lock-file // ``` // If you do not use Nix, a ZLS maintainer can take care of this. - .minimum_zig_version = "0.17.0-dev.1936+5a625d5f3", + .minimum_zig_version = "0.17.0-dev.2375+d8aab4878", // Must be kept in sync with the `deps.nix` for the Nix flake. // If you do not use Nix, a ZLS maintainer can take care of this. .dependencies = .{ diff --git a/src/DiagnosticsCollection.zig b/src/DiagnosticsCollection.zig index 00cdafd6a6..65549a06fa 100644 --- a/src/DiagnosticsCollection.zig +++ b/src/DiagnosticsCollection.zig @@ -127,8 +127,7 @@ pub fn pushErrorBundle( const tracy_zone = tracy.trace(@src()); defer tracy_zone.end(); - var new_error_bundle: std.zig.ErrorBundle.Wip = undefined; - try new_error_bundle.init(collection.allocator); + var new_error_bundle: std.zig.ErrorBundle.Wip = try .init(collection.allocator); defer new_error_bundle.deinit(); collection.mutex.lockUncancelable(collection.io); @@ -623,8 +622,7 @@ fn createTestingErrorBundle( }, compile_log_text: []const u8, ) error{OutOfMemory}!std.zig.ErrorBundle { - var eb: std.zig.ErrorBundle.Wip = undefined; - try eb.init(std.testing.allocator); + var eb: std.zig.ErrorBundle.Wip = try .init(std.testing.allocator); errdefer eb.deinit(); for (messages) |msg| { diff --git a/src/features/diagnostics.zig b/src/features/diagnostics.zig index ef64f6c853..82f9366b90 100644 --- a/src/features/diagnostics.zig +++ b/src/features/diagnostics.zig @@ -41,8 +41,7 @@ pub fn generateDiagnostics( .{ .error_bundle = error_bundle }, ); } else { - var wip: std.zig.ErrorBundle.Wip = undefined; - try wip.init(server.allocator); + var wip: std.zig.ErrorBundle.Wip = try .init(server.allocator); defer wip.deinit(); try collectParseDiagnostics(&handle.tree, &wip); @@ -310,8 +309,7 @@ pub fn getAstCheckDiagnostics(server: *Server, handle: *DocumentStore.Handle) er if (!zir.hasCompileErrors()) return .empty; - var eb: std.zig.ErrorBundle.Wip = undefined; - try eb.init(server.allocator); + var eb: std.zig.ErrorBundle.Wip = try .init(server.allocator); defer eb.deinit(); try eb.addZirErrorMessages(zir, handle.tree, handle.tree.source, ""); return try eb.toOwnedBundle(""); @@ -322,8 +320,7 @@ pub fn getAstCheckDiagnostics(server: *Server, handle: *DocumentStore.Handle) er if (!zoir.hasCompileErrors()) return .empty; - var eb: std.zig.ErrorBundle.Wip = undefined; - try eb.init(server.allocator); + var eb: std.zig.ErrorBundle.Wip = try .init(server.allocator); defer eb.deinit(); try eb.addZoirErrorMessages(zoir, handle.tree, handle.tree.source, ""); return try eb.toOwnedBundle(""); @@ -396,8 +393,7 @@ pub fn getErrorBundleFromStderr( var notes: std.ArrayList(std.zig.ErrorBundle.MessageIndex) = .empty; defer notes.deinit(allocator); - var error_bundle: std.zig.ErrorBundle.Wip = undefined; - try error_bundle.init(allocator); + var error_bundle: std.zig.ErrorBundle.Wip = try .init(allocator); defer error_bundle.deinit(); const eb_empty_string = try error_bundle.addString(""); diff --git a/src/main.zig b/src/main.zig index 67ee9cea8f..122635968f 100644 --- a/src/main.zig +++ b/src/main.zig @@ -315,8 +315,7 @@ fn loadConfigFromFile(io: std.Io, allocator: std.mem.Allocator, file_path: []con &scanner, parse_options, ) catch |err| { - var eb: std.zig.ErrorBundle.Wip = undefined; - try eb.init(allocator); + var eb: std.zig.ErrorBundle.Wip = try .init(allocator); errdefer eb.deinit(); const src_path = try eb.addString(file_path); diff --git a/tests/add_analysis_cases.zig b/tests/add_analysis_cases.zig index c01284ad11..d1f3b9ab9f 100644 --- a/tests/add_analysis_cases.zig +++ b/tests/add_analysis_cases.zig @@ -24,7 +24,7 @@ pub fn addCases( }), }); - b.dependOnDirectory(b.path(cases_path)); + b.dependOnDirectoryContents(b.path(cases_path)); var dir = b.root.openDir(b.graph.io, cases_path, .{ .iterate = true }) catch |err| std.debug.panic("failed to open '{f}': {}", .{ b.path(cases_path), err }); diff --git a/tests/context.zig b/tests/context.zig index 2f9419037c..b3db24a05f 100644 --- a/tests/context.zig +++ b/tests/context.zig @@ -35,9 +35,8 @@ pub const Context = struct { const cwd = try std.process.currentPathAlloc(io, allocator); defer allocator.free(cwd); config.zig_exe_path = try std.Io.Dir.path.resolve(allocator, &.{ cwd, test_options.zig_exe_path }); - // https://codeberg.org/ziglang/zig/issues/35766 - // config.zig_lib_path = try std.Io.Dir.path.resolve(allocator, &.{ cwd, test_options.zig_lib_path }); - // config.global_cache_path = try std.Io.Dir.path.resolve(allocator, &.{ cwd, test_options.global_cache_path }); + config.zig_lib_path = try std.Io.Dir.path.resolve(allocator, &.{ cwd, test_options.zig_lib_path }); + config.global_cache_path = try std.Io.Dir.path.resolve(allocator, &.{ cwd, test_options.global_cache_path }); } const environ_map = try cached_config_arena.allocator().create(std.process.Environ.Map); @@ -59,9 +58,8 @@ pub const Context = struct { std.debug.assert(server.config_manager.zig_lib_dir != null); std.debug.assert(server.document_store.config.zig_lib_dir != null); - // https://codeberg.org/ziglang/zig/issues/35766 - // std.debug.assert(server.config_manager.global_cache_dir != null); - // std.debug.assert(server.document_store.config.global_cache_dir != null); + std.debug.assert(server.config_manager.global_cache_dir != null); + std.debug.assert(server.document_store.config.global_cache_dir != null); var context: Context = .{ .server = server, diff --git a/tests/lifecycle.zig b/tests/lifecycle.zig index 4dc52cf155..e89c8ed8f3 100644 --- a/tests/lifecycle.zig +++ b/tests/lifecycle.zig @@ -21,9 +21,8 @@ test "LSP lifecycle" { try config_manager.setConfiguration(.frontend, &.{ .zig_exe_path = try std.Io.Dir.path.resolve(arena, &.{ cwd, test_options.zig_exe_path }), - // https://codeberg.org/ziglang/zig/issues/35766 - // .zig_lib_path = try std.Io.Dir.path.resolve(arena, &.{ cwd, test_options.zig_lib_path }), - // .global_cache_path = try std.Io.Dir.path.resolve(arena, &.{ cwd, test_options.global_cache_path }), + .zig_lib_path = try std.Io.Dir.path.resolve(arena, &.{ cwd, test_options.zig_lib_path }), + .global_cache_path = try std.Io.Dir.path.resolve(arena, &.{ cwd, test_options.global_cache_path }), }); } diff --git a/tests/lsp_features/completion.zig b/tests/lsp_features/completion.zig index 2564b13bfc..e5bb62b3e4 100644 --- a/tests/lsp_features/completion.zig +++ b/tests/lsp_features/completion.zig @@ -3701,9 +3701,6 @@ test "empty doc comment" { test "filesystem" { if (@import("builtin").target.cpu.arch.isWasm()) return error.SkipZigTest; - // https://codeberg.org/ziglang/zig/issues/35766 - if (true) return error.SkipZigTest; - try testCompletion( \\const foo = @import(""); , &.{ @@ -3721,9 +3718,6 @@ test "filesystem" { test "filesystem string literal ends with non ASCII symbol" { if (@import("builtin").target.cpu.arch.isWasm()) return error.SkipZigTest; - // https://codeberg.org/ziglang/zig/issues/35766 - if (true) return error.SkipZigTest; - try testCompletion( \\const foo = @import(" 🠁 , &.{