From 420e7f2fefa81037edc5b433c03354e2a3ad9fc8 Mon Sep 17 00:00:00 2001 From: Techatrix <19954306+Techatrix@users.noreply.github.com> Date: Mon, 10 Oct 2022 19:22:54 +0200 Subject: [PATCH] correctly resolve `import("builtin")` --- src/DocumentStore.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DocumentStore.zig b/src/DocumentStore.zig index 6afe27d..00e63fe 100644 --- a/src/DocumentStore.zig +++ b/src/DocumentStore.zig @@ -871,8 +871,11 @@ pub fn uriFromImportStr(self: *const DocumentStore, allocator: std.mem.Allocator defer allocator.free(std_path); return try URI.fromPath(allocator, std_path); } else if (std.mem.eql(u8, import_str, "builtin")) { - if (handle.associated_build_file) |builtin_uri| { - return try allocator.dupe(u8, builtin_uri); + if (handle.associated_build_file) |build_file_uri| { + const build_file = self.build_files.get(build_file_uri).?; + if (build_file.builtin_uri) |builtin_uri| { + return try allocator.dupe(u8, builtin_uri); + } } if (self.config.builtin_path) |_| { return try URI.fromPath(allocator, self.config.builtin_path.?);