Skip to content

Commit

Permalink
fix(analyzer): suppression comment fails with inner comments in funct…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
fireairforce committed Dec 9, 2024
1 parent 3914be8 commit 3628241
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
biome_analyze: patch
---

# fix(analyzer): suppression comment fails with inner comments in functions
18 changes: 7 additions & 11 deletions crates/biome_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,15 @@ where
let index =
self.suppressions
.line_suppressions
.binary_search_by(|suppression| {
if suppression.text_range.end() < entry.text_range.start() {
Ordering::Less
} else if entry.text_range.end() < suppression.text_range.start() {
Ordering::Greater
} else {
Ordering::Equal
}
.partition_point(|suppression| {
suppression.text_range.end() < entry.text_range.start()
});

index
.ok()
.map(|index| &mut self.suppressions.line_suppressions[index])
if index >= self.suppressions.line_suppressions.len() {
None
} else {
Some(&mut self.suppressions.line_suppressions[index])
}
}
};

Expand Down

0 comments on commit 3628241

Please sign in to comment.