mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Fix mbe::Shift::new not accounting for non-ident token ids
This commit is contained in:
parent
0bc3003960
commit
a9c4c6da4c
2 changed files with 10 additions and 7 deletions
|
@ -120,12 +120,15 @@ impl Shift {
|
|||
_ => tree_id,
|
||||
}
|
||||
}
|
||||
tt::TokenTree::Leaf(tt::Leaf::Ident(ident))
|
||||
if ident.id != tt::TokenId::unspecified() =>
|
||||
{
|
||||
Some(ident.id.0)
|
||||
tt::TokenTree::Leaf(leaf) => {
|
||||
let id = match leaf {
|
||||
tt::Leaf::Literal(it) => it.id,
|
||||
tt::Leaf::Punct(it) => it.id,
|
||||
tt::Leaf::Ident(it) => it.id,
|
||||
};
|
||||
|
||||
(id != tt::TokenId::unspecified()).then(|| id.0)
|
||||
}
|
||||
_ => None,
|
||||
})
|
||||
.max()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue