mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 11:37:31 +00:00
update blocklike
This commit is contained in:
parent
11717ca5d4
commit
e3deeec2f2
5 changed files with 10 additions and 13 deletions
|
|
@ -391,9 +391,7 @@ impl CompletedMarker {
|
|||
|
||||
pub(crate) fn last_token(&self, p: &Parser<'_>) -> Option<SyntaxKind> {
|
||||
let end_pos = self.end_pos as usize;
|
||||
if end_pos > p.events.len() {
|
||||
return None;
|
||||
}
|
||||
debug_assert_eq!(p.events[end_pos - 1], Event::Finish);
|
||||
p.events[..end_pos].iter().rev().find_map(|event| match event {
|
||||
Event::Token { kind, .. } => Some(*kind),
|
||||
_ => None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue