mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-20 10:30:56 +00:00
Use NodeId
for Binding
source (#4234)
This commit is contained in:
parent
c1f0661225
commit
a9fc648faf
7 changed files with 97 additions and 96 deletions
|
@ -252,7 +252,9 @@ impl<'a> Context<'a> {
|
|||
.take(scope_index)
|
||||
.all(|scope| scope.get(name).is_none())
|
||||
{
|
||||
return Some((binding.source.unwrap(), format!("{name}.{member}")));
|
||||
if let Some(source) = binding.source {
|
||||
return Some((self.stmts[source], format!("{name}.{member}")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -268,7 +270,9 @@ impl<'a> Context<'a> {
|
|||
.take(scope_index)
|
||||
.all(|scope| scope.get(name).is_none())
|
||||
{
|
||||
return Some((binding.source.unwrap(), (*name).to_string()));
|
||||
if let Some(source) = binding.source {
|
||||
return Some((self.stmts[source], (*name).to_string()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -283,7 +287,9 @@ impl<'a> Context<'a> {
|
|||
.take(scope_index)
|
||||
.all(|scope| scope.get(name).is_none())
|
||||
{
|
||||
return Some((binding.source.unwrap(), format!("{name}.{member}")));
|
||||
if let Some(source) = binding.source {
|
||||
return Some((self.stmts[source], format!("{name}.{member}")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue