Skip to content

Remove obsolete private language capability constants after catalog migration #5262

Description

@Widthdom

Problem and priority

P3 — lowest priority in this audit batch. The CLI retains a second set of private language capability names after language matching was delegated to LanguageCapabilityCatalog. Unused declarations add maintenance noise and suggest a source of truth that is no longer used.

Evidence

Observed with a locally built cdidx from origin/main at b52ac0fc372a22eb9667ba409d3d204c153d3188, on macOS, during the 2026-09-05–06 JST dogfood audit. dotnet build passed with zero warnings/errors. Commands below run from the repository root; CLI shorthand means dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll.

unused --actionable --json --limit 15 returns constants in src/CodeIndex/Cli/QueryCommandRunner.LanguageCapabilityConstants.cs:5–14.

The ten names are LanguageCapabilityGraph, LanguageCapabilityReferences, LanguageCapabilitySymbols, LanguageCapabilityMissingGraph, LanguageCapabilityMissingReferences, LanguageCapabilityMissingSymbols, LanguageCapabilitySearchOnly, LanguageCapabilityAll, LanguageCapabilityNone, and LanguageCapabilityMissingAny.

Exact literal navigation with find LanguageCapabilityGraph --all --json --limit 20 found only its declaration and reported complete scanning. QueryCommandRunner.Languages.cs:267–277 delegates capability matching/validation to LanguageCapabilityCatalog. The graph's unused classification alone is not proof of absence.

One-PR scope and implementation guide

  • Independently verify each of the ten names with complete locally built cdidx searches, including relevant generated/build inputs or reflection/name consumers before removal.
  • Remove only confirmed dead private declarations and the empty partial file if appropriate.
  • Preserve the authoritative catalog, accepted capability values, CLI/MCP schemas, shell completions and external behavior.
  • Do not refactor unrelated language handling or change the unused heuristic.
  • If any declaration is actually used, retain it and explain the evidence; do not force removal to satisfy this issue.

Acceptance and validation

  • All removed names are proven unused; no duplicate catalog constants remain in this partial file.
  • Build passes, and existing language catalog/parser/completion contract tests on net8.0/net9.0 remain green.
  • No new test merely asserting that a source file or constant is absent; use existing behavior tests.
  • Follow AGENT_GUIDE.md. This is intended to be behavior-neutral cleanup: document why no user-facing docs/changelog change is needed, unless implementation reveals an actual behavior change.

Prior issues

No exact prior issue was found in targeted searches for these capability constants/catalog. Treat this as maintenance cleanup, not a security vulnerability or a proven regression.

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

    Labels

    .NETPull requests that update .NET codeenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions