diff options
Diffstat (limited to 'core/dump.zig')
| -rw-r--r-- | core/dump.zig | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/dump.zig b/core/dump.zig index 2dde9c8c..663ee083 100644 --- a/core/dump.zig +++ b/core/dump.zig @@ -1379,7 +1379,7 @@ test "restored syntax context caches are rebuilt from the text rather than loade const f = &pane.file.?; const declarations = try p.tree_sitter_gpa.alloc(pardes.syntax.ContextDeclaration, 1); @memset(std.mem.sliceAsBytes(declarations), 0); - f.context.replace(p.tree_sitter_gpa, declarations, f.revision); + f.context.replace(p.tree_sitter_gpa, .{ .declarations = declarations }, f.revision); // Older builds persisted these two fields; the schema reader must skip them too. const OldFile = struct { path: []const u8, @@ -1405,13 +1405,14 @@ test "restored syntax context caches are rebuilt from the text rather than loade 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); + // This build's: the revision kept, the declarations and the symbols + // parsed again from the text, with the syntax allocator. + var want = try pardes.syntax.context(syntax_gpa.allocator(), f.path, f.content); + defer want.deinit(syntax_gpa.allocator()); for (q.panes) |slot| if (slot) |restored| if (restored.file) |file| { try std.testing.expectEqual(f.context.revision, file.context.revision); - try std.testing.expectEqualSlices(pardes.syntax.ContextDeclaration, want, file.context.declarations); + try std.testing.expectEqualSlices(pardes.syntax.ContextDeclaration, want.declarations, file.context.declarations); + try std.testing.expectEqualSlices(pardes.syntax.Symbol, want.symbols, file.context.symbols); }; } |
