Skip to content

Fix unused limit handling for non-SQL scopes - #2946

Merged
Widthdom merged 2 commits into
mainfrom
fix-issue2811
Jun 2, 2026
Merged

Fix unused limit handling for non-SQL scopes#2946
Widthdom merged 2 commits into
mainfrom
fix-issue2811

Conversation

@Widthdom

@Widthdom Widthdom commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Route unused list/count queries for non-SQL scopes through a batched candidate path that avoids the expensive SQL name resolver.
  • Filter referenced symbols and C# private same-file usage before applying the requested limit.
  • Add regression coverage and a changelog fragment for unused can run for minutes without output #2811.

Fixes #2811

Validation

  • dotnet build
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --no-build --filter "FullyQualifiedName~DbReaderTests.GetUnusedSymbols"
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --no-build --filter "FullyQualifiedName~QueryCommandRunnerTests.RunUnused"
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll unused --path src/ --exclude-tests --json --limit 50
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll status --check --json
  • Adversarial review: No blocking/actionable issues found.

@Widthdom
Widthdom marked this pull request as ready for review June 2, 2026 17:37
@Widthdom
Widthdom merged commit 2dae891 into main Jun 2, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2811 branch June 2, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unused can run for minutes without output

1 participant