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:
Dhruv Manilawala 2024-09-02 16:27:12 +05:30 committed by GitHub
parent f4bed22b05
commit 47f0b45be3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 80 additions and 18 deletions

View file

@ -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")
}