Skip to content

Commit 1e980fd

Browse files
committed
Use complete range for remaining start locations
1 parent 29fb86e commit 1e980fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

crates/ruff_python_index/src/fstring_ranges.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ impl FStringRangesBuilder {
9191
}
9292
}
9393

94-
pub(crate) fn finish(self) -> FStringRanges {
94+
pub(crate) fn finish(mut self, end_location: TextSize) -> FStringRanges {
95+
while let Some(start) = self.start_locations.pop() {
96+
self.raw.insert(start, TextRange::new(start, end_location));
97+
}
9598
FStringRanges { raw: self.raw }
9699
}
97100
}

crates/ruff_python_index/src/indexer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl Indexer {
7272
Self {
7373
comment_ranges: comment_ranges_builder.finish(),
7474
continuation_lines,
75-
fstring_ranges: fstring_ranges_builder.finish(),
75+
fstring_ranges: fstring_ranges_builder.finish(locator.text_len()),
7676
}
7777
}
7878

0 commit comments

Comments
 (0)