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;
|
var env = getZigEnv(allocator, exe_path) orelse break :blk;
|
||||||
defer std.json.parseFree(Env, env, .{ .allocator = allocator });
|
defer std.json.parseFree(Env, env, .{ .allocator = allocator });
|
||||||
|
|
||||||
// We know this is allocated with `allocator`, we just steal it!
|
// Make sure the path is absolute
|
||||||
config.zig_lib_path = env.lib_dir.?;
|
config.zig_lib_path = try std.fs.realpathAlloc(allocator, env.lib_dir.?);
|
||||||
env.lib_dir = null;
|
|
||||||
logger.info("Using zig lib path '{s}'", .{config.zig_lib_path.?});
|
logger.info("Using zig lib path '{s}'", .{config.zig_lib_path.?});
|
||||||
} else {
|
} else {
|
||||||
logger.warn("Zig executable path not specified in zls.json and could not be found in PATH", .{});
|
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