Repository navigation
feat: index .razor/.cshtml via text chunking; exclude obj/ and generated .g.cs - #343
Merged
Merged
Conversation
…ted .g.cs Razor markup was invisible to the index: no extension mapping, so every .razor/.cshtml was skipped (BOIN/KRKA field test 2026-10-16: 9 .cshtml on disk, 0 in the index; component refs found only through generated *_razor.g.cs lines). Map razor|cshtml to the Html variant - Html has no extractor, so the chunker takes the text fallback: markup blocks (directives, component tags) become searchable without running the C# tree-sitter parser on them. The watcher and indexer gates key off is_indexable(), so incremental reindex follows automatically. Deliberate call (todo #254): ALWAYS_EXCLUDED gains obj (always .NET build output - closes the generated-code leak even when a repo's .gitignore misses it); bin is deliberately NOT excluded, other ecosystems keep real scripts there. ALWAYS_SKIP_FILENAME_SUFFIXES gains .g.cs and .designer.cs - the watch layer's comment always claimed .designer.cs was skipped; the list never had it. Existing indexes keep their leaked obj/ chunks until the next reindex. The accidental *_razor.g.cs coverage disappears with this - by design: real .razor files are now searchable themselves.
CHANGELOG entry under pending [1.5.33] (Fixed), one highlights line, plan ticked. Full validation green: fmt, clippy -D warnings (stage 1), cargo test --lib --bins 893+889.
…pkede/codesearch into features/razor-text-chunking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Todo #254 (field test 2026-10-16 on a customer MVC repo): Razor markup was invisible to the index — no extension mapping, so every
.razor/.cshtmlwas skipped (9.cshtmlon disk, 0 in the index). Component usage was findable only through generatedobj/**/*_razor.g.cslines — accidental coverage, not a feature.What
razor|cshtml→Language::Html(the only extension table): Html has no extractor, so the chunker rides the text fallback — directives (@model,@inject,@page) and component tags become searchable without running the C# tree-sitter parser on markup. Watcher + indexer gates key offis_indexable(), so incremental reindex follows automatically.obj/always excluded (always .NET build output — closes the generated-code leak even when a repo's.gitignoremisses it);bin/deliberately NOT excluded (real scripts in other ecosystems)..g.cs/.designer.csskipped as generated — the watch layer's comment always claimed.designer.cswas excluded; the list never had it..g.cscoverage disappears by design: real.razorfiles are searchable now. Existing indexes keep leaked chunks until the next reindex (documented).Tests
3 new: Razor detection (Html mapping,
is_indexable,detect()), constants membership (objin,binout, generated suffixes match,program.csnegative).Validation
fmt clean; clippy --all-targets -D warnings clean; cargo test --lib --bins 893+889 green.