Skip to content

Commit 7643e08

Browse files
committed
Add clippy lint group to attribute auto compleme
1 parent 4e6e65d commit 7643e08

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/ide_completion/src/completions/attribute.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
use hir::HasAttrs;
77
use ide_db::{
88
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+
},
1012
parse_tt_as_comma_sep_paths,
1113
},
1214
SymbolKind,
@@ -36,8 +38,13 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
3638
"feature" => lint::complete_lint(acc, ctx, &parse_tt_as_comma_sep_paths(tt)?, FEATURES),
3739
"allow" | "warn" | "deny" | "forbid" => {
3840
let existing_lints = parse_tt_as_comma_sep_paths(tt)?;
41+
42+
let clippy_lint_groups: Vec<Lint> =
43+
CLIPPY_LINT_GROUPS.iter().map(|g| g.lint.clone()).collect();
44+
3945
lint::complete_lint(acc, ctx, &existing_lints, DEFAULT_LINTS);
4046
lint::complete_lint(acc, ctx, &existing_lints, CLIPPY_LINTS);
47+
lint::complete_lint(acc, ctx, &existing_lints, &clippy_lint_groups);
4148
lint::complete_lint(acc, ctx, &existing_lints, RUSTDOC_LINTS);
4249
}
4350
"cfg" => {

0 commit comments

Comments
 (0)