Skip to content

Normalize C# field initializer symbols - #4970

Merged
Widthdom merged 3 commits into
mainfrom
fix-issue4865
Jul 29, 2026
Merged

Normalize C# field initializer symbols#4970
Widthdom merged 3 commits into
mainfrom
fix-issue4865

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Emit ordinary C# fields, including collection-expression and target-typed initializers, as field symbols while preserving real properties and existing symbol metadata.
  • Replace oversized top-level initializer bodies with deterministic markers while retaining modifiers, types, declarators, and comment-safe declaration structure.
  • Bump the C# extractor contract and carry field identity through persisted receiver resolution, search declaration metadata, reference lookup, and LSP document/completion projections.

Root cause

The ordinary-field matcher reused an internal property kind, and the previous size bound truncated a flattened initializer prefix. Downstream receiver, search, and LSP paths therefore continued to assume those members were properties even after public normalization.

Validation

  • dotnet build CodeIndex.sln -c Release --no-restore — passed with 0 warnings and 0 errors.
  • Focused Issue Normalize C# field symbols for collection expressions and large initializers #4865 regression tests — 5 passed on net8.0 and 5 passed on net9.0.
  • Full net9.0 Release suite — 10,268 passed, 420 skipped, 0 failed.
  • Full net8.0 Release suite — 10,741 passed, 7 skipped, 1 unrelated watcher timing failure covered by Stabilize net8 subproject watcher reconciliation for ancestor .gitignore changes #4955; the same test passed in an isolated Debug retry and reproduced in isolated Release retries.
  • dotnet format CodeIndex.sln --no-restore --verify-no-changes — passed.
  • dotnet run --project tools/CodeIndex.Changelog -- check — validated all 36 fragments.
  • git diff --check and cdidx status --check --json — passed; the local index matches the committed workspace.
  • Two Codex adversarial-review rounds completed; all actionable findings from both rounds were addressed.

Documentation and changelog

  • Updated the bilingual field-symbol contract and test guidance in DEVELOPER_GUIDE.md and TESTING_GUIDE.md.
  • Added bilingual fragment changelog.d/unreleased/4865.fixed.md.

Follow-up candidates

Fixes #4865

@Widthdom
Widthdom marked this pull request as ready for review July 29, 2026 02:05
@Widthdom
Widthdom merged commit 8e23404 into main Jul 29, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4865 branch July 29, 2026 02:05
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.

Normalize C# field symbols for collection expressions and large initializers

1 participant