|
6 | 6 |
|
7 | 7 | use ide_db::{
|
8 | 8 | helpers::{
|
9 |
| - generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES, RUSTDOC_LINTS}, |
| 9 | + generated_lints::{ |
| 10 | + Lint, CLIPPY_LINTS, CLIPPY_LINT_GROUPS, DEFAULT_LINTS, FEATURES, RUSTDOC_LINTS, |
| 11 | + }, |
10 | 12 | parse_tt_as_comma_sep_paths,
|
11 | 13 | },
|
12 | 14 | SymbolKind,
|
@@ -36,9 +38,17 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
|
36 | 38 | "feature" => lint::complete_lint(acc, ctx, &parse_tt_as_comma_sep_paths(tt)?, FEATURES),
|
37 | 39 | "allow" | "warn" | "deny" | "forbid" => {
|
38 | 40 | let existing_lints = parse_tt_as_comma_sep_paths(tt)?;
|
39 |
| - lint::complete_lint(acc, ctx, &existing_lints, DEFAULT_LINTS); |
40 |
| - lint::complete_lint(acc, ctx, &existing_lints, CLIPPY_LINTS); |
41 |
| - lint::complete_lint(acc, ctx, &existing_lints, RUSTDOC_LINTS); |
| 41 | + |
| 42 | + let lints: Vec<Lint> = CLIPPY_LINT_GROUPS |
| 43 | + .iter() |
| 44 | + .map(|g| &g.lint) |
| 45 | + .chain(DEFAULT_LINTS.iter()) |
| 46 | + .chain(CLIPPY_LINTS.iter()) |
| 47 | + .chain(RUSTDOC_LINTS) |
| 48 | + .cloned() |
| 49 | + .collect(); |
| 50 | + |
| 51 | + lint::complete_lint(acc, ctx, &existing_lints, &lints); |
42 | 52 | }
|
43 | 53 | "cfg" => {
|
44 | 54 | cfg::complete_cfg(acc, ctx);
|
|
0 commit comments