From a864ef66736d3cfbdffed8b98a3c46be7985db74 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:40:11 -0300 Subject: idioms #13, the language-server client: Cx reads a file through the query's io (Io.Dir, Io.File) rather than libc open and read, notification dispatches on a stringToEnum switch, a status post too long is cut rather than dropped, failure is ?Err not ?anyerror, Rename's other files are tried rather than lost on OOM, Ask's messages are proven to fit (its buffer 160), its @put/@edit parse is a switch, query names Err, and std.fs.path is std.Io.Dir.path Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/lsp/Scip.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lsp/Scip.zig') diff --git a/src/lsp/Scip.zig b/src/lsp/Scip.zig index 8deffe26..3d3cc648 100644 --- a/src/lsp/Scip.zig +++ b/src/lsp/Scip.zig @@ -67,7 +67,7 @@ pub const Index = struct { } pub fn root(ix: *const Index) []const u8 { - return std.fs.path.dirname(ix.path()) orelse "/"; + return std.Io.Dir.path.dirname(ix.path()) orelse "/"; } /// The document of the file at `abs`, or null. @@ -217,7 +217,7 @@ pub fn find(io: std.Io, dir: []const u8) Error!?*Index { for (0..8) |_| { const p = std.fmt.bufPrint(&buf, "{s}/index.scip", .{if (std.mem.eql(u8, d, "/")) "" else d}) catch return null; if (statPath(io, p, .{})) |st| return try use(io, p, st) else |_| {} - d = std.fs.path.dirname(d) orelse return null; + d = std.Io.Dir.path.dirname(d) orelse return null; } return null; } -- cgit v1.3