Skip to content

Commit

Permalink
Merge pull request #18784 from Veykril/push-pqtwsvquxoty
Browse files Browse the repository at this point in the history
fix: Do not merge spans if they have different anchors
  • Loading branch information
Veykril authored Dec 29, 2024
2 parents 54b75a1 + 1f0696d commit 0337e79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/syntax-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 0337e79

Please sign in to comment.