Files
ruff/crates/ruff_python_codegen
Alex Waygood 71b790029c [ty] Move ty_ide's importer to ty_python_semantic (#28170)
Future autofixes will need to introduce imports alongside code changes.
In particular, there are cases where inserting `assert_never(...)` would
be useful, but the fix often also needs to import `assert_never`. The
importer currently lives in `ty_ide`, so diagnostics emitted by
`ty_python_semantic` cannot use it.

Move the importer into `ty_python_semantic` and reuse it from
completions and inlay hints. As its first use in a diagnostic, attach
the `reveal_type` import fix directly to `undefined-reveal`, replacing
the custom LSP handling. The fix imports from `typing` on Python 3.11+
and `typing_extensions` on older Python versions.

Cache source-style detection and top-level import discovery in Salsa per
file, so diagnostics in separate inference regions and IDE features can
share the setup. The cached data does not retain the parsed AST or a
copy of the source text.

Stacked on #28169.
2026-09-06 00:29:01 +01:00
..
2026-09-03 12:36:42 -04:00
2026-09-03 12:36:42 -04:00

ruff_python_codegen

This crate is an internal component of Ruff. The Rust API exposed here is unstable and will have frequent breaking changes.

This version (0.0.12) is a component of Ruff 0.16.6. The source can be found here.

See Ruff's crate versioning policy for details on versioning.