From 852299dd8d056b90446508757d8c6dacf8975abe Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 03:57:20 -0300 Subject: build: the `-Dtree-sitter=disabled` tier is deleted (pardes-build-2 item 2; P31's Q5, decided on the evidence 2026-11-20): a pardes with no tree-sitter at all, whose syntax.zig stubbed `ts` with four opaque types and answered every call empty; it did not compile on the base (`zig build install -Dplatform=tui -Dtree-sitter=disabled`: core/indent.zig:48 `struct 'syntax.ts__struct_3541' has no member named 'Tree'`, since indent.zig reads the parse tree the stub never had) and nobody set it; out with it: the `disabled` value of `TreeSitterGrammars`, build/core.zig's `treeSitter` made always (its module and its queries no longer optional, so `TreeSitter.wire` and `core.module` add them plainly), the stub `ts` and `ts_queries`, `syntax.enabled` and every branch that was for it: 32 guard lines and 16 terms of a condition in core/syntax.zig (its `start` and `stop` unwrapped), whole test guards in core/draw.zig, Stream.zig, File.zig, Query.zig, Core.zig (2), mouse.zig, replica.zig (2), test/output.zig (7), test/panes.zig (11) and test/behaviour/{panes,settings}.zig, a term in Stream.zig's two worker tests, `TreeContext.enabled` (builtins.zig) and the config table's condition on it (config.zig), test/output.zig's two conditions on the grammars; abi/wire.zig hashes the grammar set as the same four words (`true true` for highlighting and the Zig grammar, which every set has now), so `pardes version`'s semantics line did not move: 8b6382fddba7b382 on tui, gui, the bare build's two, both statics and FreeBSD, 0520895ac88d25ad with -Dtree-sitter=minimal, as at item 1; the manual's option table and the changelog say it; build.zig and build/ 2,981 -> 2,974 lines; every shape configures (11) and builds (tui, gui, bare, static musl and gui, FreeBSD, -Dtree-sitter=minimal, the macOS library for Linux and aarch64-macos); tui core-test 856/1006 (150 skipped), shell-test 1046/1049, pane-test 183/184, behaviour-test 275/275 and -- --replay 275/275, term-test 17/17, kitty-test 45/45, addon-test 5/5, lib-test, hxlib 538 cases 0 mismatches, process-test 0 of 144 failed (diffstack failed once and passed on the runner's own retry), gui unit-test 1643/1647 (the perf check's BaselineHarnessMismatch, the base's); load 5-26 on 16 cores Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/behaviour/panes.zig | 1 - test/behaviour/settings.zig | 2 -- test/output.zig | 11 ++--------- test/panes.zig | 12 ------------ 4 files changed, 2 insertions(+), 24 deletions(-) (limited to 'test') diff --git a/test/behaviour/panes.zig b/test/behaviour/panes.zig index dcde9c4d..4d4c812c 100644 --- a/test/behaviour/panes.zig +++ b/test/behaviour/panes.zig @@ -888,7 +888,6 @@ test "panes: truncating body empties it, and a stat says the length after" { } test "panes: a rename colours a source its new name's language names, its text unchanged" { - if (@import("pardes_options").grammars == .disabled) return error.SkipZigTest; var s = try Session.initFile(std.testing.allocator, "fn check() void {}\n"); defer s.deinit(); const n = try s.focused(); diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index cacee701..a6e09f35 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -158,7 +158,6 @@ test "settings: Back and Forward written to exec keep to the focused file" { }); } -const syntax = @import("pardes_options").grammars != .disabled; /// The style /screen draws the cell `into` cells into the first place /// `text` is drawn. @@ -190,7 +189,6 @@ fn keywordsIn(s: *Session, want: []const u8) !usize { } test "settings: keywords stay coloured in every row a pane grows into" { - if (!syntax) return error.SkipZigTest; var s = try Session.initFile(std.testing.allocator, std.mem.asBytes(&@as([100][33]u8, @splat("pub fn f() void { if (true) {} }\n".*)))); defer s.deinit(); try s.write(s.at("/pane/{d}/name", .{try s.focused()}), "/resize.zig\n"); diff --git a/test/output.zig b/test/output.zig index c5ddddd5..77de7649 100644 --- a/test/output.zig +++ b/test/output.zig @@ -138,7 +138,7 @@ test "location producers retain rendered location match and diagnostic styles" { } else if (origin == .search or origin == .cmd) { try std.testing.expectEqual(pardes.Color{ .rgb = chrome.search_bg }, first.style.bg); } - if (!diagnostic and pardes.syntax.enabled) { + if (!diagnostic) { const number = start + std.mem.indexOf(u8, code, "42").?; try std.testing.expectEqual(pardes.Color{ .rgb = p.theme().num }, outputCell(p, surface, id, number).style.fg); } @@ -428,7 +428,6 @@ test "Mini dump preserves its exact virtual snapshot and body writes detach colo } test "Mini syntax colors survive themes and rendering without source access" { - if (!pardes.syntax.enabled) return error.SkipZigTest; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "demo.zig", .data = "pub fn main() void {\n if (true) return;\n}\n" }); @@ -619,7 +618,6 @@ fn selectedOutputText(pane: *const pardes.Pane) ?[]const u8 { } test "LookNext/LookPrev skips formatted context and selects comment match locations" { - if (!pardes.syntax.enabled) return error.SkipZigTest; for ([_]panes.Output.Origin{ .search, .{ .query = .references } }) |origin| { for ([_]bool{ false, true }) |tslocations| { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 }); @@ -786,7 +784,7 @@ test "identical result refresh keeps warm content caches without allocation" { const index = try panes.File.lineIndex(p.gpa, file); const styles = try std.testing.allocator.dupe(u8, file.highlights); defer std.testing.allocator.free(styles); - if (@import("pardes_options").grammars != .disabled) try std.testing.expect(styles.len > 0); + try std.testing.expect(styles.len > 0); const revision = file.revision; const saved_revision = file.saved_revision; const body_ptr = file.content.ptr; @@ -1048,7 +1046,6 @@ test "result alignment chunks assign boundary context to nearest match with prev } test "declaration context ellipses mark only final header lines before omitted source" { - if (!pardes.syntax.enabled) return error.SkipZigTest; const text = "const Outer = struct {\n" ++ "\n" ++ " pub fn run(\n" ++ @@ -1161,7 +1158,6 @@ test "LSP occurrence tint follows the supplied source span through context" { } test "result context upper bound stops at earliest enclosing declaration" { - if (!pardes.syntax.enabled) return error.SkipZigTest; const text = "// unrelated prelude\n" ++ "const unrelated = 1;\n" ++ "\n" ++ @@ -1227,7 +1223,6 @@ test "result context upper bound stops at earliest enclosing declaration" { } test "stacked search and LSP results retain source tint navigation and dump ownership" { - if (!pardes.syntax.enabled) return error.SkipZigTest; const first = "\tfoo + 界 + foo;"; const second = " return foo;"; const source_text = "const Box = struct {\n fn run() void {\n" ++ first ++ "\n const neighbor = 42;\n" ++ second ++ "\n }\n};\n"; @@ -1348,7 +1343,6 @@ test "stacked search and LSP results retain source tint navigation and dump owne } test "location analysis cache refreshes unsaved ancestry and query context" { - if (!pardes.syntax.enabled) return error.SkipZigTest; const before = "const Outer = struct {\n" ++ " fn first() void {\n" ++ " marker();\n" ++ @@ -1429,7 +1423,6 @@ test "location analysis cache refreshes unsaved ancestry and query context" { } test "location cache eviction retains early colors and honors disk and unsaved replacements" { - if (!pardes.syntax.enabled) return error.SkipZigTest; var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); var dir_buf: [4096]u8 = undefined; diff --git a/test/panes.zig b/test/panes.zig index dbdbec2f..6bda3519 100644 --- a/test/panes.zig +++ b/test/panes.zig @@ -152,7 +152,6 @@ const BodyHitTests = struct { } test "compact TreeContext mouse follows source rows in reclaimed space" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 64, .rows = 18 }); defer p.deinit(); p.view().row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 8, .tagline_h = 10 }; @@ -201,7 +200,6 @@ const BodyHitTests = struct { const LineNumberLookTests = struct { test "right-click on a line number looks at that line, sticky context headers included" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 64, .rows = 18 }); defer p.deinit(); p.view().row_metrics = .{ .body_w = 10, .body_h = 20, .tagline_w = 8, .tagline_h = 10 }; @@ -259,7 +257,6 @@ const TreeContextTests = struct { } test "TreeContext separators mark source gaps without splitting multiline signatures" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 64, .rows = 18 }); defer p.deinit(); const pane = try setZigFile(p, "const Box = struct {\n\n // omitted member comment\n\n pub fn work(\n value: usize,\n ) void {\n" ++ std.mem.asBytes(&@as([30][16]u8, @splat(" // body\n".*))) ++ " }\n};\n"); @@ -291,7 +288,6 @@ const TreeContextTests = struct { test "TreeContext Look to an open file discards the old viewport extent" { for ([_]bool{ false, true }) |context| { - if (context and !syntax.enabled) continue; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 64, .rows = 18 }); defer p.deinit(); const pane = try setZigFile(p, "pub fn work() void {\n" ++ std.mem.asBytes(&@as([100][12]u8, @splat(" // body\n".*))) ++ "}\n"); @@ -316,7 +312,6 @@ const TreeContextTests = struct { } test "TreeContext sticky declarations preserve the body while clicked and edited" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 64, .rows = 18 }); defer p.deinit(); const pane = try setZigFile(p, source); @@ -368,7 +363,6 @@ const TreeContextTests = struct { } test "TreeContext unwrapped headers map Unicode and survive source replacement" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 48, .rows = 14 }); defer p.deinit(); const pane = try setZigFile(p, "pub fn @\"界name\"(\n\tvalue: usize,\n) void {\n" ++ std.mem.asBytes(&@as([12][15]u8, @splat(" _ = value;\n".*))) ++ "}\n"); @@ -407,7 +401,6 @@ const TreeContextTests = struct { } test "TreeContext clipped headers leave wrapped body cursor coordinates intact" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 24, .rows = 12 }); defer p.deinit(); const body = " // 012345678901234567890123456789界tail"; @@ -1717,7 +1710,6 @@ const OutputTests = struct { } test "Callstack aligns source below locations and keeps exact emphasis and navigation" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 30 }); defer p.deinit(); const source = " pub fn caller(\n value: u32,\n ) void {\n work(value);\n }\n"; @@ -1759,7 +1751,6 @@ const OutputTests = struct { } test "Callstack signatures share unsaved tree context and keep guides out of Look selections" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 110, .rows = 30 }); defer p.deinit(); const source = "const Box = struct {\n" ++ @@ -1853,7 +1844,6 @@ const OutputTests = struct { } test "Locations context uses unsaved sources and navigation visits only matches" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 }); defer p.deinit(); p.locations_config.layout = .@"inline"; @@ -1968,7 +1958,6 @@ const OutputTests = struct { } test "Locations visible declarations are muted and stars count scopes rather than signature lines" { - if (!syntax.enabled) return error.SkipZigTest; const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 120, .rows = 40 }); defer p.deinit(); p.locations_config.layout = .@"inline"; @@ -3541,7 +3530,6 @@ test "cancelled normal gestures leave no count or subprefix through raw tty mode } test "Zig keywords keep every rendered byte colored across line-number widths" { - if (!syntax.enabled) return error.SkipZigTest; const gpa = std.testing.allocator; const samples = [_][]const u8{ "pub fn main() void { if (true) {} }\n", -- cgit v1.3