mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 02:06:57 +00:00
fix: Do not merge spans if they have different anchors
This commit is contained in:
parent
dc6cea57a2
commit
49b509310c
1 changed files with 1 additions and 1 deletions
|
|
@ -1058,7 +1058,7 @@ where
|
||||||
// We don't do what rustc does exactly, rustc does something clever when the spans have different syntax contexts
|
// 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`.
|
// but this runs afoul of our separation between `span` and `hir-expand`.
|
||||||
SpanData {
|
SpanData {
|
||||||
range: if a.ctx == b.ctx {
|
range: if a.ctx == b.ctx && a.anchor == b.anchor {
|
||||||
TextRange::new(
|
TextRange::new(
|
||||||
std::cmp::min(a.range.start(), b.range.start()),
|
std::cmp::min(a.range.start(), b.range.start()),
|
||||||
std::cmp::max(a.range.end(), b.range.end()),
|
std::cmp::max(a.range.end(), b.range.end()),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue