Skip to content

Remove declaration-only private helpers and unused extractor fields #5283

Description

@Widthdom

Evidence

unused --actionable --json --limit 8 was cross-checked using repository-wide find <name> --all --count --json. Each of these had exactly one text occurrence (the declaration) in a complete scan:

  • FormatSearchGuardFilterScope: src/CodeIndex/Cli/QueryCommandRunner.SearchRecipes.cs:5638.
  • ResolveReferenceTargetAtPosition: src/CodeIndex/Lsp/LspServer.PositionResolution.cs:101.
  • EmptyMarkdownReferenceDefinitionTargets: src/CodeIndex/Indexer/Symbols/SymbolExtractor.Markdown.cs:12.
  • JavaScriptTypeScriptArrowAssignmentValueRegex: src/CodeIndex/Indexer/Symbols/SymbolExtractor.Patterns.cs:725.

The last is a static compiled Regex with initialization cost and no observed consumer. No runtime performance improvement has been measured yet.

One-PR implementation scope

Consolidate the four cleanup candidates into one small removal PR. Before removing each, verify reflection/generated usage and test-only access against a fresh index. If any has a real contract consumer, retain it and document the evidence. Avoid broad refactoring, new analyzers, symbol extraction changes, or separate micro-issues per member.

Acceptance and tests

Build with warnings-as-errors and run the affected search, LSP and symbol-extractor tests. Existing behavior stays unchanged. Do not add tests that merely assert a private name was deleted; add behavioral coverage only if investigation reveals a missing contract. Update the relevant cleanup/performance changelog fragment without claiming an unmeasured speedup.

Related history

#5262 removed obsolete language-capability constants. These are different members remaining after that cleanup; this does not imply its deleted constants returned.

Baseline and delivery requirements

  • Priority: P3; posting order 10/10 in the 2026-09-06 dogfood set. Candidate IDs: D007.
  • Reproduced/inspected with locally built cdidx 1.46.1, macOS arm64, .NET 8, at 7ceb37749fd47995bafed03f2d5ae308a400f4c2; dotnet build passed with zero warnings/errors. Root and workspace index checks were healthy. The full test suites were not run during discovery.
  • Implement as one focused PR for this issue. Follow AGENT_GUIDE.md and the applicable workflows, dogfood the freshly built binary, and run the applicable regression checks (including supported net8/net9 lanes where relevant).
  • Keep user-facing help/docs and CLI/MCP contracts synchronized for affected surfaces; add the required bilingual changelog.d/unreleased/ fragment. Preserve backward compatibility, bounded resource use and cross-platform filesystem behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions