From cee019b1ea138c6efce131c4ae955e26a62e62aa Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 4 Oct 2024 15:06:05 -0400 Subject: [PATCH] editor: Qualify `RangeExt::overlaps` call to prevent phantom diagnostics (#18743) This PR qualifies a call to `RangeExt::overlaps` to avoid some confusion in rust-analyzer not being able to distinguish between `RangeExt::overlaps` and `AnchorRangeExt::overlaps` and producing phantom diagnostics. We may also want to consider renaming the method on `AnchorRangeExt` to disambiguate them. Release Notes: - N/A --- crates/editor/src/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 6fdcb22605de90bb09bdb9a98e5cfa121fdfed81..62c2240828ee4272a2b29a4dc220907571003085 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -10792,7 +10792,7 @@ impl Editor { .selections .all::(cx) .iter() - .any(|selection| selection.range().overlaps(&intersection_range)); + .any(|selection| RangeExt::overlaps(&selection.range(), &intersection_range)); self.unfold_ranges(std::iter::once(intersection_range), true, autoscroll, cx) }