mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 17:40:37 +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
|
@ -3,8 +3,8 @@ use std::ops::{Deref, Index, IndexMut};
|
|||
|
||||
use bitflags::bitflags;
|
||||
use ruff_text_size::TextRange;
|
||||
use rustpython_parser::ast::Stmt;
|
||||
|
||||
use crate::node::NodeId;
|
||||
use crate::scope::ScopeId;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -14,7 +14,7 @@ pub struct Binding<'a> {
|
|||
/// The context in which the binding was created.
|
||||
pub context: ExecutionContext,
|
||||
/// The statement in which the [`Binding`] was defined.
|
||||
pub source: Option<&'a Stmt>,
|
||||
pub source: Option<NodeId>,
|
||||
/// Tuple of (scope index, range) indicating the scope and range at which
|
||||
/// the binding was last used in a runtime context.
|
||||
pub runtime_usage: Option<(ScopeId, TextRange)>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue