Skip to content

Fix Python type hint reference edge cases - #2618

Merged
Widthdom merged 4 commits into
mainfrom
codex/fix-issue2059
May 24, 2026
Merged

Fix Python type hint reference edge cases#2618
Widthdom merged 4 commits into
mainfrom
codex/fix-issue2059

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Expand Python type hint reference extraction for ParamSpec/TypeVar/TypeVarTuple edge cases.
  • Preserve comma-containing Callable annotations without treating later parameter names as type references.
  • Add multiline TypeVar remapping and comment stripping for logical type factory calls.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~ReferenceExtractorTests" -p:UseSharedCompilation=false --no-restore
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • git diff --check
  • codex exec --dangerously-bypass-approvals-and-sandbox review --base origin/main

Full dotnet test CodeIndex.sln -c Release -p:UseSharedCompilation=false --no-build was attempted and showed an existing Rust symbol extractor failure in Extract_RustTraitAssociatedTypeDefaults_RecordsPropertySymbols, unrelated to this Python reference extraction change, before the run was stopped after a long quiet period.

Documentation and changelog

  • Added changelog.d/unreleased/2059.fixed.md.
  • No guide or user documentation changes were needed beyond the changelog fragment because this is a reference extraction correctness fix.

Review

  • Codex adversarial review found two Python reference false-positive risks.
  • Both findings were addressed with targeted regression tests.

Follow-up candidates

  • None.

Fixes #2059

@Widthdom
Widthdom marked this pull request as ready for review May 24, 2026 11:29
# Conflicts:
#	src/CodeIndex/Indexer/References/ReferenceExtractor.cs
@Widthdom
Widthdom merged commit 5282a8f into main May 24, 2026
10 checks passed
@Widthdom
Widthdom deleted the codex/fix-issue2059 branch May 24, 2026 14:32
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.

Python type hint edge cases: ParamSpec variance, TypeVarTuple constraints, Literal unions not extracted

1 participant