Skip to content

Commit 1f0696d

Browse files
committed
fix: Do not merge spans if they have different anchors
1 parent 47f497d commit 1f0696d

File tree

1 file changed

+1
-1
lines changed
  • src/tools/rust-analyzer/crates/syntax-bridge/src

1 file changed

+1
-1
lines changed

src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ where
10581058
// We don't do what rustc does exactly, rustc does something clever when the spans have different syntax contexts
10591059
// but this runs afoul of our separation between `span` and `hir-expand`.
10601060
SpanData {
1061-
range: if a.ctx == b.ctx {
1061+
range: if a.ctx == b.ctx && a.anchor == b.anchor {
10621062
TextRange::new(
10631063
std::cmp::min(a.range.start(), b.range.start()),
10641064
std::cmp::max(a.range.end(), b.range.end()),

0 commit comments

Comments
 (0)