summaryrefslogtreecommitdiff
path: root/src/Stream.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-09 02:04:25 -0300
committerGabriel Schneider <[email protected]>2026-11-09 02:14:10 -0300
commitc78d362fa20393621ac198861f891439f9d832e9 (patch)
tree7ba6d82f7dca1926abf7a985cf3830c69d21c90c /src/Stream.zig
parent69b993d585cfb14c607f46aba500b141b85516ff (diff)
downloadpardes-c78d362fa20393621ac198861f891439f9d832e9.tar.gz
pardes-c78d362fa20393621ac198861f891439f9d832e9.zip
locality: caller-led moves: MAX_JUMPS into Jump.zig (Core's unused alias goes), RasterPolicy and rasterPolicy beside Kind.viewOf, Names.relative beside Query.startSource, fs.find_skip beside Stream's max_walk_depth, File.drawGutter and drawWrapMarkers beside body_layer.renderBody; each unit's only users are in its new file
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Stream.zig')
-rw-r--r--src/Stream.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Stream.zig b/src/Stream.zig
index 2641fc73..11fa7a31 100644
--- a/src/Stream.zig
+++ b/src/Stream.zig
@@ -46,6 +46,11 @@ const batch_bytes = 256 * 1024;
const max_file_bytes = 16 << 20;
/// The walk goes no deeper than this many directories below its root.
const max_walk_depth = 16;
+/// Directories the walk never enters.
+const find_skip = [_][]const u8{
+ ".git", ".jj", "target", "node_modules",
+ ".venv", "__pycache__", ".zig-cache", "zig-out",
+};
/// What a worker sends: rows as fs.zig wrote them (`path:line:col-end
/// text`, a listing's `path`), relative to the search's directory. Owned by
@@ -886,7 +891,7 @@ const Worker = struct {
switch (e.kind) {
.directory => {
if (depth + 1 >= max_walk_depth or e.name[0] == '.') continue;
- if (for (filesystem.find_skip) |skip| {
+ if (for (find_skip) |skip| {
if (std.mem.eql(u8, e.name, skip)) break true;
} else false) continue;
var sub = dir.openDir(w.io, e.name, .{ .iterate = true }) catch |err| switch (err) {