From 3ac3923e314954451a38a94918552b60ad3a93b3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:08:54 -0300 Subject: A Rename the server answers for this file alone, while other open files of its language say the name, is previewed, never applied; Lspwhy shows the files synced first zls renaming at a declaration answers with that file's edits only, cold or warm, whatever it was told of (checked against zls directly: from a call site in main.zig it renames both files, from the declaration in util.zig it never does), so the first Rename applied in util.zig and left main.zig broken. The client now looks for the old name in the other open files of the language; when one says it and the answer left it alone, the edits are a preview with a row naming each such file, and the message row says the server renamed in this file only. Lspwhy carries the open files too, so its trace shows `synced X first` for the query it explains. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index ca0980f4..b15cfb00 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -6770,8 +6770,14 @@ pub const Pardes = struct { p.fs.lsp_result = rp.serial; }; if (w.kind == .rename) { - var said_buf: [96]u8 = undefined; - p.setMessage(w.pane, std.fmt.bufPrint(&said_buf, "Rename: {d} edit(s) across files, previewed, not applied", .{nrows}) catch "Rename: previewed"); + var said_buf: [128]u8 = undefined; + // Rows that only name a file the server left alone (lsp_client + // renameEdits) are no edits. + const unrenamed = std.mem.count(u8, rows, ", which the server did not rename\n"); + p.setMessage(w.pane, if (unrenamed > 0) + std.fmt.bufPrint(&said_buf, "Rename: previewed, not applied: the server renamed in this file only, and {d} other open file(s) say the name", .{unrenamed}) catch "Rename: previewed" + else + std.fmt.bufPrint(&said_buf, "Rename: {d} edit(s) across files, previewed, not applied", .{nrows}) catch "Rename: previewed"); } if (panes.Output.traits(from).jumps) { const result = p.panes[pane.search_pane orelse return] orelse return; -- cgit v1.3