fix: C# bin/obj skip uses root-only marker detection, misses subdirectory project roots #63

Closed
opened 2026-08-05 12:37:19 +02:00 by buildagent · 0 comments
Member

Source: a1x dogfood (latent — not that repo's actual cause, but a real gap).

Symptom

bin/ and obj/ are skipped only when a *.csproj/*.sln sits DIRECTLY in the indexed root. If the indexed root is a SUBDIRECTORY of the solution (monorepo member; the .sln a level up), the marker check fails and every bin//obj/ tree under the root is walked and indexed as build output.

Root cause

walker::has_csharp_marker(root) (crates/indexer/src/walker.rs) reads only the root dir (non-recursive), and skip_set_for gates the bin/obj skip on it.

Fix (implemented, pending commit)

New has_csharp_marker_at_or_above(root): checks the root, then walks ancestors UP TO the enclosing git root (bounded via git_root_at_or_above). Without a git boundary it stays root-only, so an unrelated solution in an arbitrary ancestor is never adopted.
Tests: csharp_marker_at_ancestor_within_git_root_skips_bin_obj, csharp_marker_above_git_root_is_not_adopted.

**Source:** a1x dogfood (latent — not that repo's actual cause, but a real gap). ## Symptom `bin/` and `obj/` are skipped only when a `*.csproj`/`*.sln` sits DIRECTLY in the indexed root. If the indexed root is a SUBDIRECTORY of the solution (monorepo member; the `.sln` a level up), the marker check fails and every `bin/`/`obj/` tree under the root is walked and indexed as build output. ## Root cause `walker::has_csharp_marker(root)` (crates/indexer/src/walker.rs) reads only the root dir (non-recursive), and `skip_set_for` gates the bin/obj skip on it. ## Fix (implemented, pending commit) New `has_csharp_marker_at_or_above(root)`: checks the root, then walks ancestors UP TO the enclosing git root (bounded via `git_root_at_or_above`). Without a git boundary it stays root-only, so an unrelated solution in an arbitrary ancestor is never adopted. Tests: `csharp_marker_at_ancestor_within_git_root_skips_bin_obj`, `csharp_marker_above_git_root_is_not_adopted`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#63
No description provided.