Skip to content

Optimize search snippet and guard line processing - #3317

Merged
Widthdom merged 6 commits into
mainfrom
fix-issue3088-3087-3086-3085-3084-3083
Jun 6, 2026
Merged

Optimize search snippet and guard line processing#3317
Widthdom merged 6 commits into
mainfrom
fix-issue3088-3087-3086-3085-3084-3083

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stream search snippet line scanning so bounded excerpts no longer split or normalize whole content arrays.
  • Cap tracked snippet match indexes while preserving dropped-match accounting.
  • Precompute guarded-search primary terms, bound guard window extraction, cache repeated guard windows, and reuse prepared match-line context for enclosing-symbol lookup.

Validation

  • dotnet build
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter FullyQualifiedName~SearchSnippetFormatterTests
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter FullyQualifiedName~DbSearchReaderIssueTests
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter FullyQualifiedName~Search_EnclosingSymbolUsesPreparedMatchLineContext_Issue3086
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Codex adversarial review: No blocking/actionable issues found.

Documentation / Changelog

  • Added bilingual changelog fragments:
    • changelog.d/unreleased/3083.fixed.md
    • changelog.d/unreleased/3084.fixed.md
    • changelog.d/unreleased/3085.fixed.md
    • changelog.d/unreleased/3086.fixed.md
    • changelog.d/unreleased/3087.fixed.md
    • changelog.d/unreleased/3088.fixed.md

Follow-up Candidates

  • None.

Fixes #3083
Fixes #3084
Fixes #3085
Fixes #3086
Fixes #3087
Fixes #3088

@Widthdom
Widthdom marked this pull request as ready for review June 6, 2026 02:59
@Widthdom
Widthdom merged commit 67f7075 into main Jun 6, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue3088-3087-3086-3085-3084-3083 branch June 6, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment