From 4b694d4f0f009c5e54827d2bf8e3500d05a9d69b Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 9 Jul 2024 19:26:18 +0200 Subject: [PATCH] fix(windows): use std.fs.path.isAbsolute in Project.make_URI --- src/Project.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Project.zig b/src/Project.zig index b3d7468..27835ef 100644 --- a/src/Project.zig +++ b/src/Project.zig @@ -114,7 +114,7 @@ fn get_file_lsp(self: *Self, file_path: []const u8) !LSP { fn make_URI(self: *Self, file_path: ?[]const u8) ![]const u8 { var buf = std.ArrayList(u8).init(self.a); if (file_path) |path| { - if (path.len > 0 and path[0] == std.fs.path.sep) { + if (std.fs.path.isAbsolute(path)) { try buf.writer().print("file://{s}", .{path}); } else { try buf.writer().print("file://{s}/{s}", .{ self.name, path });