Skip to content

Fix C# constructor navigation identity filtering - #4951

Merged
Widthdom merged 4 commits into
mainfrom
fix-issue4850
Jul 28, 2026
Merged

Fix C# constructor navigation identity filtering#4951
Widthdom merged 4 commits into
mainfrom
fix-issue4850

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Resolve C# instantiate references by exact source site, generic type arity, and invocation arity.
  • Keep explicit and primary constructor candidates separate from same-named partial type declarations.
  • Preserve implicit/default construction for partial classes, value types, enums, and delegates while excluding static constructors and finalizers.
  • Return every matching same-arity overload from LSP definition/declaration requests without falling back to the type family.
  • Bump the retained reference identity contract so existing indexes rebuild affected candidates automatically.

Root cause

Constructor references and type declarations shared a name-based candidate path. In partial types this allowed a same-file type declaration or an unrelated constructor shape to outrank the callable target, while LSP position resolution could then collapse the mixed candidate set to the wrong location.

Validation

  • dotnet build CodeIndex.sln -c Release --no-restore — passed with 0 warnings and 0 errors.
  • Release Issue Resolve constructor navigation by symbol identity instead of partial-type name #4850 tests on net8.0 and net9.0 — 15/15 passed on each framework.
  • Full Release suite on net9.0 — 10,175 passed, 419 skipped, 0 failed.
  • Full Release suite on net8.0 — 10,647 passed, 7 skipped, with one unrelated MCP timeout fixture failure under parallel load; the exact failed test passed 1/1 when rerun alone.
  • dotnet format CodeIndex.sln --no-restore --verify-no-changes — passed.
  • dotnet run --project tools/CodeIndex.Changelog -- check — validated 26 fragments.
  • Local index delta refresh and status --check --jsonindex_matches_workspace: true, no failed checks.

Documentation and changelog

  • Updated the English and Japanese constructor-navigation sections in USER_GUIDE.md.
  • Updated the English and Japanese regression-maintenance guidance in TESTING_GUIDE.md.
  • Added changelog.d/unreleased/4850.fixed.md.

Follow-ups

None.

Fixes #4850

@Widthdom
Widthdom marked this pull request as ready for review July 28, 2026 06:34
@Widthdom
Widthdom merged commit 30911fb into main Jul 28, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4850 branch July 28, 2026 06:34
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.

Resolve constructor navigation by symbol identity instead of partial-type name

1 participant