mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 16:40:19 +00:00
Make the statement
vector private on SemanticModel
(#6348)
## Summary Instead, expose these as methods, now that we can use a reasonable nomenclature on the API.
This commit is contained in:
parent
bae87fa016
commit
61d3977f95
10 changed files with 55 additions and 25 deletions
|
@ -185,7 +185,7 @@ impl<'a> Binding<'a> {
|
|||
/// Returns the range of the binding's parent.
|
||||
pub fn parent_range(&self, semantic: &SemanticModel) -> Option<TextRange> {
|
||||
self.source
|
||||
.map(|node_id| semantic.statements[node_id])
|
||||
.map(|statement_id| semantic.statement(statement_id))
|
||||
.and_then(|parent| {
|
||||
if parent.is_import_from_stmt() {
|
||||
Some(parent.range())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue