@@ -414,7 +414,7 @@ pub const Handle = struct {
414414 const tracy_zone = tracy .traceNamed (@src (), "Handle.refresh" );
415415 defer tracy_zone .end ();
416416
417- const mode : Ast.Mode = if (std .mem .eql (u8 , std .fs .path .extension (handle .uri .raw ), ".zon" )) .zon else .zig ;
417+ const mode : Ast.Mode = if (std .mem .eql (u8 , std .Io . Dir .path .extension (handle .uri .raw ), ".zon" )) .zon else .zig ;
418418 var new_tree = try parseTree (allocator , text , mode );
419419 errdefer new_tree .deinit (allocator );
420420
@@ -847,7 +847,7 @@ pub fn openLspSyncedDocument(self: *DocumentStore, uri: Uri, text: []const u8) e
847847 }
848848 }
849849
850- const duped_text = try self .allocator .dupeZ (u8 , text );
850+ const duped_text = try self .allocator .dupeSentinel (u8 , text , 0 );
851851 _ = self .createAndStoreDocument (
852852 uri ,
853853 .{ .text = duped_text },
@@ -1013,11 +1013,11 @@ pub fn loadDirectoryRecursive(store: *DocumentStore, directory_uri: Uri) LoadDir
10131013 }
10141014 continue ;
10151015 }
1016- if (! std .mem .eql (u8 , std .fs .path .extension (entry .basename ), ".zig" )) continue ;
1016+ if (! std .mem .eql (u8 , std .Io . Dir .path .extension (entry .basename ), ".zig" )) continue ;
10171017
10181018 file_count += 1 ;
10191019
1020- const path = try std .fs .path .join (store .allocator , &.{ workspace_path , entry .path });
1020+ const path = try std .Io . Dir .path .join (store .allocator , &.{ workspace_path , entry .path });
10211021 defer store .allocator .free (path );
10221022
10231023 const uri : Uri = try .fromPath (store .allocator , path );
@@ -1046,7 +1046,7 @@ pub fn loadTrigramStores(
10461046 while (it .next ()) | handle | {
10471047 const uri = handle .uri .toStdUri ();
10481048
1049- var component_it = std .fs .path .componentIterator (uri .path .percent_encoded );
1049+ var component_it = std .Io . Dir .path .componentIterator (uri .path .percent_encoded );
10501050 const skip = while (component_it .next ()) | component | {
10511051 // Keep in sync with `loadDirectoryRecursive`
10521052 if (std .mem .startsWith (u8 , component .name , "." )) break true ;
@@ -1305,7 +1305,7 @@ fn loadBuildAssociatedConfiguration(io: std.Io, allocator: std.mem.Allocator, bu
13051305
13061306 const build_file_path = try build_file .uri .toFsPath (allocator );
13071307 defer allocator .free (build_file_path );
1308- const config_file_path = try std .fs .path .resolve (allocator , &.{ build_file_path , ".." , "zls.build.json" });
1308+ const config_file_path = try std .Io . Dir .path .resolve (allocator , &.{ build_file_path , ".." , "zls.build.json" });
13091309 defer allocator .free (config_file_path );
13101310
13111311 const file_buf = try std .Io .Dir .cwd ().readFileAlloc (
@@ -1373,7 +1373,7 @@ fn loadBuildConfiguration(self: *DocumentStore, build_file_uri: Uri, build_file_
13731373 const build_file_path = try build_file_uri .toFsPath (self .allocator );
13741374 defer self .allocator .free (build_file_path );
13751375
1376- const cwd = std .fs .path .dirname (build_file_path ).? ;
1376+ const cwd = std .Io . Dir .path .dirname (build_file_path ).? ;
13771377
13781378 const args = try self .prepareBuildRunnerArgs (build_file_uri );
13791379 defer {
@@ -1489,16 +1489,16 @@ fn collectPotentialBuildFiles(self: *DocumentStore, uri: Uri) error{ Canceled, O
14891489 // https://github.com/ziglang/zig/issues/15607
14901490 const root_end_index : usize = root_end_index : {
14911491 if (builtin .target .os .tag != .windows ) break :root_end_index 0 ;
1492- const component_iterator = std .fs .path .componentIterator (path );
1492+ const component_iterator = std .Io . Dir .path .componentIterator (path );
14931493 break :root_end_index component_iterator .root_end_index ;
14941494 };
14951495
14961496 var current_path : []const u8 = path ;
1497- while (std .fs .path .dirname (current_path )) | potential_root_path | : (current_path = potential_root_path ) {
1497+ while (std .Io . Dir .path .dirname (current_path )) | potential_root_path | : (current_path = potential_root_path ) {
14981498 if (potential_root_path .len < root_end_index ) break ;
14991499 if (! try buildDotZigExists (self .io , potential_root_path )) continue ;
15001500
1501- const build_path = try std .fs .path .join (self .allocator , &.{ potential_root_path , "build.zig" });
1501+ const build_path = try std .Io . Dir .path .join (self .allocator , &.{ potential_root_path , "build.zig" });
15021502 defer self .allocator .free (build_path );
15031503
15041504 try potential_build_files .ensureUnusedCapacity (self .allocator , 1 );
@@ -1534,7 +1534,7 @@ fn createBuildFile(self: *DocumentStore, uri: Uri) error{ Canceled, OutOfMemory
15341534
15351535 if (cfg .value .relative_builtin_path ) | relative_builtin_path | blk : {
15361536 const build_file_path = build_file .uri .toFsPath (self .allocator ) catch break :blk ;
1537- const absolute_builtin_path = try std .fs .path .resolve (self .allocator , &.{ build_file_path , ".." , relative_builtin_path });
1537+ const absolute_builtin_path = try std .Io . Dir .path .resolve (self .allocator , &.{ build_file_path , ".." , relative_builtin_path });
15381538 defer self .allocator .free (absolute_builtin_path );
15391539 build_file .builtin_uri = try .fromPath (self .allocator , absolute_builtin_path );
15401540 }
@@ -1731,15 +1731,15 @@ pub fn collectIncludeDirs(
17311731
17321732 try include_dirs .ensureUnusedCapacity (allocator , module .include_dirs .len );
17331733 for (module .include_dirs ) | include_path | {
1734- const absolute_path = if (std .fs .path .isAbsolute (include_path ))
1734+ const absolute_path = if (std .Io . Dir .path .isAbsolute (include_path ))
17351735 try allocator .dupe (u8 , include_path )
17361736 else blk : {
17371737 const build_file_path = resolved .build_file .uri .toFsPath (allocator ) catch | err | switch (err ) {
17381738 error .OutOfMemory = > return error .OutOfMemory ,
17391739 error .UnsupportedScheme = > continue ,
17401740 };
1741- const build_file_dirname = std .fs .path .dirname (build_file_path ) orelse continue ;
1742- break :blk try std .fs .path .join (allocator , &.{ build_file_dirname , include_path });
1741+ const build_file_dirname = std .Io . Dir .path .dirname (build_file_path ) orelse continue ;
1742+ break :blk try std .Io . Dir .path .join (allocator , &.{ build_file_dirname , include_path });
17431743 };
17441744
17451745 include_dirs .appendAssumeCapacity (absolute_path );
0 commit comments