Make sure zig lib path retrieved from zig env
is absolute (#799)
This commit is contained in:
parent
6ab2c68355
commit
3ab859a304
@ -150,9 +150,8 @@ pub fn configChanged(config: *Config, allocator: std.mem.Allocator, builtin_crea
|
||||
var env = getZigEnv(allocator, exe_path) orelse break :blk;
|
||||
defer std.json.parseFree(Env, env, .{ .allocator = allocator });
|
||||
|
||||
// We know this is allocated with `allocator`, we just steal it!
|
||||
config.zig_lib_path = env.lib_dir.?;
|
||||
env.lib_dir = null;
|
||||
// Make sure the path is absolute
|
||||
config.zig_lib_path = try std.fs.realpathAlloc(allocator, env.lib_dir.?);
|
||||
logger.info("Using zig lib path '{s}'", .{config.zig_lib_path.?});
|
||||
} else {
|
||||
logger.warn("Zig executable path not specified in zls.json and could not be found in PATH", .{});
|
||||
|
Loading…
Reference in New Issue
Block a user