Rename semantic_model and model usages to semantic (#5097)

## Summary

As discussed in Discord, and similar to oxc, we're going to refer to
this as `.semantic()` everywhere.

While I was auditing usages of `model: &SemanticModel`, I also changed
as many function signatures as I could find to consistently take the
model as the _last_ argument, rather than the first.
This commit is contained in:
Charlie Marsh 2023-06-14 15:01:51 -04:00 committed by GitHub
parent 65dbfd2556
commit bae183b823
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
209 changed files with 1058 additions and 1167 deletions

View file

@ -142,11 +142,11 @@ impl<'a> Binding<'a> {
}
/// Returns the appropriate visual range for highlighting this binding.
pub fn trimmed_range(&self, semantic_model: &SemanticModel, locator: &Locator) -> TextRange {
pub fn trimmed_range(&self, semantic: &SemanticModel, locator: &Locator) -> TextRange {
match self.kind {
BindingKind::ClassDefinition | BindingKind::FunctionDefinition => {
self.source.map_or(self.range, |source| {
helpers::identifier_range(semantic_model.stmts[source], locator)
helpers::identifier_range(semantic.stmts[source], locator)
})
}
_ => self.range,
@ -154,9 +154,9 @@ impl<'a> Binding<'a> {
}
/// Returns the range of the binding's parent.
pub fn parent_range(&self, semantic_model: &SemanticModel) -> Option<TextRange> {
pub fn parent_range(&self, semantic: &SemanticModel) -> Option<TextRange> {
self.source
.map(|node_id| semantic_model.stmts[node_id])
.map(|node_id| semantic.stmts[node_id])
.and_then(|parent| {
if parent.is_import_from_stmt() {
Some(parent.range())