mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
fix: Don't count commas when looking for the derive attribute in diagnostics
This commit is contained in:
parent
d6ed146a1c
commit
8cdef2ffcf
1 changed files with 1 additions and 0 deletions
|
@ -649,6 +649,7 @@ fn emit_def_diagnostic(db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>, diag:
|
||||||
})
|
})
|
||||||
.group_by(|t| t.kind() == T![,])
|
.group_by(|t| t.kind() == T![,])
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
.filter(|&(comma, _)| !comma)
|
||||||
.nth(*derive_index as usize)
|
.nth(*derive_index as usize)
|
||||||
.and_then(|(_, mut g)| g.find(|t| t.kind() == T![ident]))
|
.and_then(|(_, mut g)| g.find(|t| t.kind() == T![ident]))
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue