Merge pull request #544 from Vexu/IterableDir

update to IterableDir changes in Zig std
This commit is contained in:
Auguste Rame 2022-07-17 07:05:57 -04:00 committed by GitHub
commit 7f8c7430b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 15 deletions

View File

@ -1987,7 +1987,7 @@ fn completionHandler(server: *Server, arena: *std.heap.ArenaAllocator, id: types
fsc: { fsc: {
var document_path = try uri_utils.parse(arena.allocator(), handle.uri()); var document_path = try uri_utils.parse(arena.allocator(), handle.uri());
var document_dir_path = std.fs.openDirAbsolute(std.fs.path.dirname(document_path) orelse break :fsc, .{ .iterate = true }) catch break :fsc; var document_dir_path = std.fs.openIterableDirAbsolute(std.fs.path.dirname(document_path) orelse break :fsc, .{}) catch break :fsc;
defer document_dir_path.close(); defer document_dir_path.close();
if (std.mem.lastIndexOfScalar(u8, completing, '/')) |subpath_index| { if (std.mem.lastIndexOfScalar(u8, completing, '/')) |subpath_index| {
@ -2000,7 +2000,7 @@ fn completionHandler(server: *Server, arena: *std.heap.ArenaAllocator, id: types
} }
var old = document_dir_path; var old = document_dir_path;
document_dir_path = document_dir_path.openDir(subpath, .{ .iterate = true }) catch break :fsc // NOTE: Is this even safe lol? document_dir_path = document_dir_path.dir.openIterableDir(subpath, .{}) catch break :fsc // NOTE: Is this even safe lol?
old.close(); old.close();
subpath_present = true; subpath_present = true;

View File

@ -636,12 +636,12 @@ pub fn isTypeIdent(tree: Ast, token_idx: Ast.TokenIndex) bool {
.{"c_longlong"}, .{"c_ulonglong"}, .{"c_longlong"}, .{"c_ulonglong"},
.{"c_longdouble"}, .{"anyopaque"}, .{"c_longdouble"}, .{"anyopaque"},
.{"f16"}, .{"f32"}, .{"f16"}, .{"f32"},
.{"f64"}, .{"f128"}, .{"f64"}, .{"f80"},
.{"bool"}, .{"void"}, .{"f128"}, .{"bool"},
.{"noreturn"}, .{"type"}, .{"void"}, .{"noreturn"},
.{"anyerror"}, .{"comptime_int"}, .{"type"}, .{"anyerror"},
.{"comptime_float"}, .{"anyframe"}, .{"comptime_int"}, .{"comptime_float"},
.{"anytype"}, .{"anyframe"}, .{"anytype"},
}); });
const text = tree.tokenSlice(token_idx); const text = tree.tokenSlice(token_idx);