about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-12-29 10:44:04 +0000
committerGitHub <noreply@github.com>2024-12-29 10:44:04 +0000
commit0337e79c5c32b9f6cd4cafe22b0914b2a35a9df3 (patch)
tree1d05303107a06d079cccbcfd2869feaf979a4d39
parent54b75a1479024989870e8f95c376209432c9bc95 (diff)
parent1f0696de4300a3bce39352f1d50364711b3694b7 (diff)
downloadrust-0337e79c5c32b9f6cd4cafe22b0914b2a35a9df3.tar.gz
rust-0337e79c5c32b9f6cd4cafe22b0914b2a35a9df3.zip
Merge pull request #18784 from Veykril/push-pqtwsvquxoty
fix: Do not merge spans if they have different anchors
-rw-r--r--src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs b/src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs
index 3a05b83e497..add6b1d5e04 100644
--- a/src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs
+++ b/src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs
@@ -1058,7 +1058,7 @@ where
         // We don't do what rustc does exactly, rustc does something clever when the spans have different syntax contexts
         // but this runs afoul of our separation between `span` and `hir-expand`.
         SpanData {
-            range: if a.ctx == b.ctx {
+            range: if a.ctx == b.ctx && a.anchor == b.anchor {
                 TextRange::new(
                     std::cmp::min(a.range.start(), b.range.start()),
                     std::cmp::max(a.range.end(), b.range.end()),