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 f4a8048
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 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
19 changes: 7 additions & 12 deletions crates/biome_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use biome_console::markup;
use biome_parser::AnyParse;
use std::cmp::Ordering;
use std::collections::{BTreeMap, BinaryHeap};
use std::fmt::{Debug, Display, Formatter};
use std::ops;
Expand Down Expand Up @@ -450,19 +449,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 f4a8048

Please sign in to comment.