mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +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![,])
|
||||
.into_iter()
|
||||
.filter(|&(comma, _)| !comma)
|
||||
.nth(*derive_index as usize)
|
||||
.and_then(|(_, mut g)| g.find(|t| t.kind() == T![ident]))
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue