mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Fix float-split hack not setting up spans correctly
This commit is contained in:
parent
8423893d1c
commit
394d11b0fa
15 changed files with 197 additions and 58 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
use std::hash::Hash;
|
||||
|
||||
use stdx::never;
|
||||
use syntax::TextRange;
|
||||
use tt::Span;
|
||||
|
||||
|
@ -59,11 +60,10 @@ impl<S: Span> TokenMap<S> {
|
|||
.max_by_key(|(_, _, intersection)| intersection.len())
|
||||
.map(|(_, &s, _)| s)
|
||||
.or_else(|| {
|
||||
if self.real_file {
|
||||
None
|
||||
} else {
|
||||
panic!("no span for range {range:?} in {:#?}", self.span_map)
|
||||
if !self.real_file {
|
||||
never!("no span for range {:?} in {:#?}", range, self.span_map);
|
||||
}
|
||||
None
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue