From 1e99692d5c670c483e1eaf2cd8710fe1c99272ff Mon Sep 17 00:00:00 2001 From: Auguste Rame <19855629+SuperAuguste@users.noreply.github.com> Date: Wed, 7 Dec 2022 11:39:46 -0500 Subject: [PATCH] Enable stage2 (#810) --- build.zig | 2 -- tests/language_features/comptime_interpreter.zig | 16 ++++++++-------- tests/lsp_features/selection_range.zig | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/build.zig b/build.zig index e04a158..1007ad0 100644 --- a/build.zig +++ b/build.zig @@ -13,7 +13,6 @@ pub fn build(b: *std.build.Builder) !void { const mode = b.standardReleaseOptions(); const exe = b.addExecutable("zls", "src/main.zig"); - exe.use_stage1 = true; const exe_options = b.addOptions(); exe.addOptions("build_options", exe_options); @@ -134,7 +133,6 @@ pub fn build(b: *std.build.Builder) !void { }); } - tests.use_stage1 = true; tests.addPackage(.{ .name = "zls", .source = .{ .path = "src/zls.zig" }, .dependencies = exe.packages.items }); tests.setBuildMode(.Debug); tests.setTarget(target); diff --git a/tests/language_features/comptime_interpreter.zig b/tests/language_features/comptime_interpreter.zig index ae9311e..cc42b3d 100644 --- a/tests/language_features/comptime_interpreter.zig +++ b/tests/language_features/comptime_interpreter.zig @@ -32,18 +32,18 @@ test "ComptimeInterpreter - basic test" { _ = try interpreter.interpret(0, null, .{}); - var bool_type = try interpreter.createType(std.math.maxInt(std.zig.Ast.Node.Index), .{ .@"bool" = .{} }); + var bool_type = try interpreter.createType(std.math.maxInt(std.zig.Ast.Node.Index), .{ .bool = {} }); var arg_false = ComptimeInterpreter.Value{ .interpreter = &interpreter, .node_idx = std.math.maxInt(std.zig.Ast.Node.Index), - .@"type" = bool_type, - .value_data = try interpreter.createValueData(.{ .@"bool" = false }), + .type = bool_type, + .value_data = try interpreter.createValueData(.{ .bool = false }), }; var arg_true = ComptimeInterpreter.Value{ .interpreter = &interpreter, .node_idx = std.math.maxInt(std.zig.Ast.Node.Index), - .@"type" = bool_type, - .value_data = try interpreter.createValueData(.{ .@"bool" = true }), + .type = bool_type, + .value_data = try interpreter.createValueData(.{ .bool = true }), }; const rmt = interpreter.root_type.?.getTypeInfo().@"struct".scope.declarations.get("ReturnMyType").?; @@ -57,8 +57,8 @@ test "ComptimeInterpreter - basic test" { }, .{}); defer call_with_true.scope.deinit(); - try std.testing.expectFmt("u69", "{any}", .{interpreter.formatTypeInfo(call_with_false.result.value.value_data.@"type".getTypeInfo())}); - try std.testing.expectFmt("u8", "{any}", .{interpreter.formatTypeInfo(call_with_true.result.value.value_data.@"type".getTypeInfo())}); + try std.testing.expectFmt("u69", "{any}", .{interpreter.formatTypeInfo(call_with_false.result.value.value_data.type.getTypeInfo())}); + try std.testing.expectFmt("u8", "{any}", .{interpreter.formatTypeInfo(call_with_true.result.value.value_data.type.getTypeInfo())}); } test "ComptimeInterpreter - struct" { @@ -92,5 +92,5 @@ test "ComptimeInterpreter - struct" { const z = try interpreter.call(null, rmt.node_idx, &.{}, .{}); defer z.scope.deinit(); - try std.testing.expectFmt("struct {slay: bool, var abc: comptime_int = 123, }", "{any}", .{interpreter.formatTypeInfo(z.result.value.value_data.@"type".getTypeInfo())}); + try std.testing.expectFmt("struct {slay: bool, var abc: comptime_int = 123, }", "{any}", .{interpreter.formatTypeInfo(z.result.value.value_data.type.getTypeInfo())}); } diff --git a/tests/lsp_features/selection_range.zig b/tests/lsp_features/selection_range.zig index 9eb7c5c..0b92d28 100644 --- a/tests/lsp_features/selection_range.zig +++ b/tests/lsp_features/selection_range.zig @@ -47,7 +47,7 @@ fn testSelectionRange(source: []const u8, want: []const []const u8) !void { const request = requests.SelectionRange{ .params = .{ .textDocument = .{ .uri = test_uri }, - .positions = &.{position}, + .positions = &[_]types.Position{position}, } }; const response = try ctx.requestGetResponse(?[]SelectionRange, "textDocument/selectionRange", request);