Skip to content

Commit 81d0096

Browse files
bors[bot]k-nasa
andauthored
Merge #11035
11035: Include clippy lint groups in autocomplete r=Veykril a=k-nasa ## Why close: #11027 ## Proof I confirmed that complement candidates are coming out. https://user-images.githubusercontent.com/23740172/146465758-bc7d5cdd-e2fb-48d6-abf7-804ba859c9b1.mov Co-authored-by: k-nasa <[email protected]>
2 parents 0914f24 + 71ac246 commit 81d0096

File tree

3 files changed

+206
-1006
lines changed

3 files changed

+206
-1006
lines changed

crates/ide_completion/src/completions/attribute.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
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,9 +38,17 @@ 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)?;
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);
4252
}
4353
"cfg" => {
4454
cfg::complete_cfg(acc, ctx);

0 commit comments

Comments
 (0)