mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 01:20:24 +00:00
Correctly handle references in __all__
definitions when renaming symbols in autofixes (#10527)
This commit is contained in:
parent
61b7982422
commit
9feb9b0aa8
16 changed files with 173 additions and 20 deletions
|
@ -93,6 +93,12 @@ impl ResolvedReference {
|
|||
self.flags
|
||||
.intersects(SemanticModelFlags::TYPE_CHECKING_BLOCK)
|
||||
}
|
||||
|
||||
/// Return `true` if the context is in the r.h.s. of an `__all__` definition.
|
||||
pub const fn in_dunder_all_definition(&self) -> bool {
|
||||
self.flags
|
||||
.intersects(SemanticModelFlags::DUNDER_ALL_DEFINITION)
|
||||
}
|
||||
}
|
||||
|
||||
impl Ranged for ResolvedReference {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue