From 71b09a3ffe7b40838ed4fd6b2290dac0be14395f Mon Sep 17 00:00:00 2001 From: FalsePattern <30945458+FalsePattern@users.noreply.github.com> Date: Wed, 21 Jun 2023 17:47:58 +0200 Subject: [PATCH] fix legacy json in tests --- src/zls.zig | 1 + tests/context.zig | 2 +- tests/language_features/cimport.zig | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/zls.zig b/src/zls.zig index ab68744..8870132 100644 --- a/src/zls.zig +++ b/src/zls.zig @@ -30,6 +30,7 @@ pub const goto = @import("features/goto.zig"); pub const hover_handler = @import("features/hover.zig"); pub const selection_range = @import("features/selection_range.zig"); pub const diagnostics = @import("features/diagnostics.zig"); +pub const legacy_json = @import("legacy_json.zig"); comptime { const std = @import("std"); diff --git a/tests/context.zig b/tests/context.zig index e523ba0..a718ad9 100644 --- a/tests/context.zig +++ b/tests/context.zig @@ -60,7 +60,7 @@ pub const Context = struct { } pub fn deinit(self: *Context) void { - @import("../src/legacy_json.zig").parseFree(Config, allocator, self.config.*); + zls.legacy_json.parseFree(Config, allocator, self.config.*); allocator.destroy(self.config); self.request("shutdown", "{}", null) catch {}; diff --git a/tests/language_features/cimport.zig b/tests/language_features/cimport.zig index 069b519..94da1b4 100644 --- a/tests/language_features/cimport.zig +++ b/tests/language_features/cimport.zig @@ -108,7 +108,7 @@ fn testTranslate(c_source: []const u8) !translate_c.Result { if (!std.process.can_spawn) return error.SkipZigTest; var config: zls.Config = .{}; - defer @import("../../src/legacy_json.zig").parseFree(zls.Config, allocator, config); + defer zls.legacy_json.parseFree(zls.Config, allocator, config); var runtime_zig_version: ?zls.ZigVersionWrapper = null; defer if (runtime_zig_version) |*v| v.free();