Skip to content

Preserve Python reference columns after string literals - #5381

Merged
Widthdom merged 2 commits into
mainfrom
fix-issue5362
Sep 15, 2026
Merged

Widthdom merged 2 commits into
mainfrom
fix-issue5362

Conversation

@Widthdom

@Widthdom Widthdom commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Python string masking replaced literals with "", shifting subsequent reference columns. Preserve their UTF-16 width so s = '😀'; 終了() records column 15 and LSP reports character 14. Repeated calls retain separate source positions, and string/comment decoys remain excluded.

Bump the Python extractor contract to 3 so a normal whole-workspace index refresh repairs unchanged files written under contracts 1 or 2. No forced rebuild or schema migration is required.

Fixes #5362

Validation

  • Reproduced the pre-fix column regression on .NET 8 and .NET 9.
  • Verified real UTF-8 indexing, persisted resolved reference rows, CLI JSON columns and initialized Content-Length-framed LSP ranges across empty, ASCII, BMP, astral, escaped, raw, byte, adjacent, triple-quoted and literal f-strings.
  • Verified normal refresh from Python extractor contracts 1 and 2, retaining unrelated-file reuse.
  • Symbol/reference extractor, LSP and focused indexing regressions: .NET 8 passed 2,677 tests; .NET 9 passed 2,648 tests with 29 intended runtime-specific skips.
  • Post-commit solution build passed with zero warnings/errors (--no-restore -m:1 -nr:false -p:UseSharedCompilation=false).
  • Repository-built CLI smoke: lib.py:4:15, resolved target, one candidate.
  • Changelog fragment validation and git diff --check passed.
  • The CI whitespace check passed locally using dotnet format whitespace CodeIndex.sln --verify-no-changes --no-restore --verbosity minimal (the command behind dev.sh lint).
  • Post-commit dogfood refresh passed; normal full indexing refreshed the remaining Python contracts while skipping 1,576 unchanged files. Root freshness, folded-name readiness, index completeness and graph completeness are healthy.

Documentation

  • Added bilingual coordinate and refresh guidance in docs/python-reference-coordinates.md, linked from both developer-guide sections.
  • Updated both testing-guide sections.
  • Changelog fragment: changelog.d/unreleased/5362.fixed.md.

Adversarial review

Codex reviewed origin/main..HEAD and the subsequent whitespace-only CI fix in two rounds: No blocking/actionable issues found.

@Widthdom
Widthdom merged commit ec9e8c4 into main Sep 15, 2026
11 checks passed
@Widthdom
Widthdom deleted the fix-issue5362 branch September 15, 2026 14:55
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.

Preserve Python reference columns after string literals

1 participant