mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 18:02:58 +00:00
![]() ## Summary This PR adds `as_<group>` methods to `AnyNodeRef` to e.g. convert an `AnyNodeRef` to an `ExprRef`. I need this for go to definition where the fallback is to test if `AnyNodeRef` is an expression and then call `inferred_type` (listing this mapping at every call site where we need to convert `AnyNodeRef` to an `ExprRef` is a bit painful ;)) Split out from https://github.com/astral-sh/ruff/pull/16901 ## Test Plan `cargo test` |
||
---|---|---|
.. | ||
src | ||
ast.toml | ||
Cargo.toml | ||
generate.py |