mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-11 14:18:04 +00:00
Implement AstNode
for Identifier
(#13207)
## Summary Follow-up to #13147, this PR implements the `AstNode` for `Identifier`. This makes it easier to create the `NodeKey` in red knot because it uses a generic method to construct the key from `AnyNodeRef` and is important for definitions that are created only on identifiers instead of `ExprName`. ## Test Plan `cargo test` and `cargo clippy`
This commit is contained in:
parent
f4bed22b05
commit
47f0b45be3
5 changed files with 80 additions and 18 deletions
|
@ -703,6 +703,7 @@ impl Format<PyFormatContext<'_>> for FormatEnclosingNode<'_> {
|
|||
| AnyNodeRef::TypeParamTypeVar(_)
|
||||
| AnyNodeRef::TypeParamTypeVarTuple(_)
|
||||
| AnyNodeRef::TypeParamParamSpec(_)
|
||||
| AnyNodeRef::Identifier(_)
|
||||
| AnyNodeRef::BytesLiteral(_) => {
|
||||
panic!("Range formatting only supports formatting logical lines")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue