diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-20 00:03:29 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-20 00:03:29 -0300 |
| commit | 3a3601f984d25f1e03cee3ac47da7eeb2548e511 (patch) | |
| tree | 445331cb8ad346989c4e4f6a3ceff54411064e4a /core/dump.zig | |
| parent | 8a1f65a2d374796b9b5559c4aab87c8d1e8f6e68 (diff) | |
| parent | 528530ed065b2059d16b08efd92103d1dbbccc31 (diff) | |
| download | pardes-3a3601f984d25f1e03cee3ac47da7eeb2548e511.tar.gz pardes-3a3601f984d25f1e03cee3ac47da7eeb2548e511.zip | |
integration: a far client's seven small faults on the renamed tree: pardes-far-faults (a refocus that no longer asks the session's host about a newer build; a drag in a kind's pane grown too short; a draw's token that no rollback takes back; a text's declarations dumped so a joined client's query reads what the session's does; a search that goes on at once on a far client; two tests of what cannot happen) and pardes-merge24, merged without a textual conflict; the coordinator's gate in the ledger (reorg/merge25)
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/dump.zig')
| -rw-r--r-- | core/dump.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/dump.zig b/core/dump.zig index a8dd170a..e6cdceec 100644 --- a/core/dump.zig +++ b/core/dump.zig @@ -406,6 +406,7 @@ fn loadKnowing(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: for (others) |o| gpa.free(o.panes); gpa.free(others); l.shared.shrinkRetainingCapacity(at); + for (p.panes) |slot| if (slot) |pane| if (pane.file) |*f| f.context.reload(p.tree_sitter_gpa, f.path, f.content, f.revision); p.readSessionFacts(); return p; } @@ -491,6 +492,7 @@ fn loadImage(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: ?* try views.undumpedOld(p, others, gpa); } l.made.shrinkRetainingCapacity(at); + for (p.panes) |slot| if (slot) |pane| if (pane.file) |*f| f.context.reload(p.tree_sitter_gpa, f.path, f.content, f.revision); p.readSessionFacts(); return p; } @@ -1200,7 +1202,7 @@ test "an old dump's file, a byte dump, is read by -l and by a Restore of its pat try std.testing.expectEqualSlices(u8, bytes, again); } -test "restored syntax context caches are rebuilt rather than loaded with the core allocator" { +test "restored syntax context caches are rebuilt from the text rather than loaded with the core allocator" { const gpa = std.testing.allocator; var syntax_gpa: std.heap.DebugAllocator(.{}) = .init; defer std.testing.expect(syntax_gpa.deinit() == .ok) catch @panic("syntax allocator leaked"); @@ -1237,9 +1239,13 @@ test "restored syntax context caches are rebuilt rather than loaded with the cor defer gpa.free(bytes); const q = try load(gpa, opts, bytes, null); defer q.deinit(); + // This build's: the revision kept, the declarations parsed again from + // the text, with the syntax allocator. + const want = try pardes.syntax.contextDeclarations(syntax_gpa.allocator(), f.path, f.content); + defer syntax_gpa.allocator().free(want); for (q.panes) |slot| if (slot) |restored| if (restored.file) |file| { - try std.testing.expectEqual(@as(usize, 0), file.context.declarations.len); - try std.testing.expectEqual(@as(?u32, null), file.context.revision); + try std.testing.expectEqual(f.context.revision, file.context.revision); + try std.testing.expectEqualSlices(pardes.syntax.ContextDeclaration, want, file.context.declarations); }; } |
