Skip to content

Fix JSON array symbol hierarchy - #4973

Merged
Widthdom merged 6 commits into
mainfrom
fix-issue4874
Jul 29, 2026
Merged

Fix JSON array symbol hierarchy#4973
Widthdom merged 6 commits into
mainfrom
fix-issue4874

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Normalize JSON and JSON Lines array paths so array indices attach directly while literal object keys remain dot-qualified.
  • Preserve root arrays, nested arrays and objects, empty containers, comments, compact one-line inputs, and legal empty/NUL-containing keys with accurate line and parent metadata.
  • Keep JSON/JSONL outline paths parent-first with correct depth and pagination, without changing JavaScript bracketed-property behavior.
  • Bump the JSON and JSON Lines extractor contracts so existing indexes are rebuilt with the corrected hierarchy.

Root cause and impact

Array indices and object-property boundaries shared path-composition logic, which could duplicate parent names or conflate literal bracket-prefixed keys with array elements. Line lookup also depended on raw-text matching, so comments, bounded skips, compact files, and empty property names could misalign later symbols. As a result, symbols, definitions, and outlines could expose incorrect paths, parents, depths, or signatures for valid JSON/JSONL inputs.

The updated extraction and outline contracts now preserve an unambiguous hierarchy across those cases.

Validation

  • dotnet build CodeIndex.sln -c Release --no-restore -p:UseSharedCompilation=false — succeeded with 0 warnings and 0 errors.
  • Issue Fix duplicated JSON array-object paths and flattened depth #4874 focused tests on net8.0 and net9.0 — 10 passed on each framework.
  • Broader JSON extraction tests on net8.0 — 24 passed.
  • Broader outline tests on net8.0 — 50 passed.
  • Full Release net8.0 suite — 10,809 passed, 7 skipped, 0 failed.
  • Full Release net9.0 suite — 10,334 passed, 420 skipped, with one unrelated filesystem-watcher test failure already tracked by Use one membership and invalidation policy for scan, status, and watch #4592; the same test failed in isolation under concurrent load, while its net8.0 full-suite run passed.
  • dotnet format CodeIndex.sln --no-restore --verify-no-changes — passed.
  • Changelog fragment checker — all 48 fragments passed.
  • git diff --check — passed.
  • Codex adversarial review — no blocking/actionable issues found.

Documentation and changelog

  • Updated the English and Japanese JSON/JSON Lines sections in DEVELOPER_GUIDE.md.
  • Added changelog.d/unreleased/4874.fixed.md.

Follow-up candidates

  • None.

Fixes #4874

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

Fix duplicated JSON array-object paths and flattened depth

1 participant