Skip to content

Commit

Permalink
Use complete range for remaining start locations
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmanila committed Oct 25, 2023
1 parent 29fb86e commit 1e980fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion crates/ruff_python_index/src/fstring_ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ impl FStringRangesBuilder {
}
}

pub(crate) fn finish(self) -> FStringRanges {
pub(crate) fn finish(mut self, end_location: TextSize) -> FStringRanges {
while let Some(start) = self.start_locations.pop() {
self.raw.insert(start, TextRange::new(start, end_location));
}
FStringRanges { raw: self.raw }
}
}
2 changes: 1 addition & 1 deletion crates/ruff_python_index/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Indexer {
Self {
comment_ranges: comment_ranges_builder.finish(),
continuation_lines,
fstring_ranges: fstring_ranges_builder.finish(),
fstring_ranges: fstring_ranges_builder.finish(locator.text_len()),
}
}

Expand Down

0 comments on commit 1e980fd

Please sign in to comment.