Skip to content

[ty] Visit parameters in source order#23403

Merged
charliermarsh merged 1 commit intomainfrom
charlie/args-source
Feb 19, 2026
Merged

[ty] Visit parameters in source order#23403
charliermarsh merged 1 commit intomainfrom
charlie/args-source

Conversation

@charliermarsh
Copy link
Member

Summary

Previously, Parameters::visit_source_order used ParametersIterator which visits in type-based order. For well-formed Python code, this matches source order; but error recovery can produce ASTs like def foo(**kwargs, a):.

@charliermarsh charliermarsh added bug Something isn't working ty Multi-file analysis & type inference labels Feb 18, 2026
@charliermarsh charliermarsh marked this pull request as ready for review February 18, 2026 21:45
@AlexWaygood AlexWaygood added the server Related to the LSP server label Feb 18, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 18, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would flatten the state onto the ParametersSourceOrderIterator struct (see inline comment), but LGTM!

@charliermarsh charliermarsh enabled auto-merge (squash) February 19, 2026 02:42
@charliermarsh charliermarsh merged commit 8fb1123 into main Feb 19, 2026
45 checks passed
@charliermarsh charliermarsh deleted the charlie/args-source branch February 19, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants