ruff/crates/ruff_python_ast
Micha Reiser e07741e553
Add as_group methods to AnyNodeRef (#17048)
## 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`
2025-03-28 19:42:45 +00:00
..
src Add as_group methods to AnyNodeRef (#17048) 2025-03-28 19:42:45 +00:00
ast.toml [syntax-errors] Duplicate type parameter names (#16858) 2025-03-21 15:06:22 -04:00
Cargo.toml Transition to salsa coarse-grained tracked structs (#15763) 2025-02-11 11:38:50 +01:00
generate.py Add as_group methods to AnyNodeRef (#17048) 2025-03-28 19:42:45 +00:00