Implement `Ranged` for `TypeParam` (#32)

Required for https://github.com/astral-sh/ruff/pull/5927
This commit is contained in:
Zanie Blue 2023-07-20 19:03:17 -05:00 committed by GitHub
parent db04fd4157
commit fb365c642b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 1 deletions

View File

@ -526,7 +526,30 @@ impl Ranged for crate::TypeIgnore {
}
}
}
impl Ranged for crate::generic::TypeParamTypeVar {
fn range(&self) -> TextRange {
self.range
}
}
impl Ranged for crate::generic::TypeParamTypeVarTuple {
fn range(&self) -> TextRange {
self.range
}
}
impl Ranged for crate::generic::TypeParamParamSpec {
fn range(&self) -> TextRange {
self.range
}
}
impl Ranged for crate::TypeParam {
fn range(&self) -> TextRange {
match self {
Self::TypeVar(node) => node.range(),
Self::TypeVarTuple(node) => node.range(),
Self::ParamSpec(node) => node.range(),
}
}
}
impl Ranged for crate::generic::Decorator {
fn range(&self) -> TextRange {
self.range