Unnamed repository; edit this file 'description' to name the repository.
Merge #11516
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 <[email protected]>
| -rw-r--r-- | crates/hir/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index c75ceed9e3..a26d8e9ebf 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -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])) })(); |