mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-10 13:48:35 +00:00
Move runtime execution context into add_reference calls (#6003)
This commit is contained in:
parent
4aac801277
commit
4b2ec7d562
2 changed files with 14 additions and 27 deletions
|
@ -257,7 +257,7 @@ impl<'a> SemanticModel<'a> {
|
|||
.get(symbol)
|
||||
.map_or(true, |binding_id| {
|
||||
// Treat the deletion of a name as a reference to that name.
|
||||
self.add_local_reference(binding_id, range, ExecutionContext::Runtime);
|
||||
self.add_local_reference(binding_id, range);
|
||||
self.bindings[binding_id].is_unbound()
|
||||
});
|
||||
|
||||
|
@ -917,26 +917,18 @@ impl<'a> SemanticModel<'a> {
|
|||
}
|
||||
|
||||
/// Add a reference to the given [`BindingId`] in the local scope.
|
||||
pub fn add_local_reference(
|
||||
&mut self,
|
||||
binding_id: BindingId,
|
||||
range: TextRange,
|
||||
context: ExecutionContext,
|
||||
) {
|
||||
let reference_id = self.resolved_references.push(self.scope_id, range, context);
|
||||
pub fn add_local_reference(&mut self, binding_id: BindingId, range: TextRange) {
|
||||
let reference_id =
|
||||
self.resolved_references
|
||||
.push(self.scope_id, range, ExecutionContext::Runtime);
|
||||
self.bindings[binding_id].references.push(reference_id);
|
||||
}
|
||||
|
||||
/// Add a reference to the given [`BindingId`] in the global scope.
|
||||
pub fn add_global_reference(
|
||||
&mut self,
|
||||
binding_id: BindingId,
|
||||
range: TextRange,
|
||||
context: ExecutionContext,
|
||||
) {
|
||||
let reference_id = self
|
||||
.resolved_references
|
||||
.push(ScopeId::global(), range, context);
|
||||
pub fn add_global_reference(&mut self, binding_id: BindingId, range: TextRange) {
|
||||
let reference_id =
|
||||
self.resolved_references
|
||||
.push(ScopeId::global(), range, ExecutionContext::Runtime);
|
||||
self.bindings[binding_id].references.push(reference_id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue