Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/completions/attribute.rs')
-rw-r--r--crates/ide_completion/src/completions/attribute.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs
index 6abc2a94c4..e139dcd40e 100644
--- a/crates/ide_completion/src/completions/attribute.rs
+++ b/crates/ide_completion/src/completions/attribute.rs
@@ -4,7 +4,7 @@
//! for built-in attributes.
use hir::HasAttrs;
-use ide_db::helpers::generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES};
+use ide_db::helpers::generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES, RUSTDOC_LINTS};
use itertools::Itertools;
use once_cell::sync::Lazy;
use rustc_hash::FxHashMap;
@@ -29,12 +29,16 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
};
match (name_ref, attribute.token_tree()) {
(Some(path), Some(token_tree)) => match path.text().as_str() {
- "derive" => derive::complete_derive(acc, ctx, token_tree),
"repr" => repr::complete_repr(acc, ctx, token_tree),
- "feature" => lint::complete_lint(acc, ctx, token_tree, FEATURES),
+ "derive" => derive::complete_derive(acc, ctx, &parse_comma_sep_paths(token_tree)?),
+ "feature" => {
+ lint::complete_lint(acc, ctx, &parse_comma_sep_paths(token_tree)?, FEATURES)
+ }
"allow" | "warn" | "deny" | "forbid" => {
- lint::complete_lint(acc, ctx, token_tree.clone(), DEFAULT_LINTS);
- lint::complete_lint(acc, ctx, token_tree, CLIPPY_LINTS);
+ let existing_lints = parse_comma_sep_paths(token_tree)?;
+ lint::complete_lint(acc, ctx, &existing_lints, DEFAULT_LINTS);
+ lint::complete_lint(acc, ctx, &existing_lints, CLIPPY_LINTS);
+ lint::complete_lint(acc, ctx, &existing_lints, RUSTDOC_LINTS);
}
"cfg" => {
cfg::complete_cfg(acc, ctx);