11516: fix: Don't count commas when looking for the derive attribute in diagnostics r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2022-02-21 12:44:10 +00:00 committed by GitHub
commit 36f302355b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]))
})();