diff options
Diffstat (limited to 'crates/ide_completion/src/completions/attribute.rs')
-rw-r--r-- | crates/ide_completion/src/completions/attribute.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs index c48bb9e66..f80d7eec3 100644 --- a/crates/ide_completion/src/completions/attribute.rs +++ b/crates/ide_completion/src/completions/attribute.rs | |||
@@ -3,20 +3,19 @@ | |||
3 | //! This module uses a bit of static metadata to provide completions | 3 | //! This module uses a bit of static metadata to provide completions |
4 | //! for built-in attributes. | 4 | //! for built-in attributes. |
5 | 5 | ||
6 | use ide_db::helpers::generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES}; | ||
6 | use once_cell::sync::Lazy; | 7 | use once_cell::sync::Lazy; |
7 | use rustc_hash::{FxHashMap, FxHashSet}; | 8 | use rustc_hash::{FxHashMap, FxHashSet}; |
8 | use syntax::{algo::non_trivia_sibling, ast, AstNode, Direction, NodeOrToken, SyntaxKind, T}; | 9 | use syntax::{algo::non_trivia_sibling, ast, AstNode, Direction, NodeOrToken, SyntaxKind, T}; |
9 | 10 | ||
10 | use crate::{ | 11 | use crate::{ |
11 | context::CompletionContext, | 12 | context::CompletionContext, |
12 | generated_lint_completions::{CLIPPY_LINTS, FEATURES}, | ||
13 | item::{CompletionItem, CompletionItemKind, CompletionKind}, | 13 | item::{CompletionItem, CompletionItemKind, CompletionKind}, |
14 | Completions, | 14 | Completions, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | mod derive; | 17 | mod derive; |
18 | mod lint; | 18 | mod lint; |
19 | pub(crate) use self::lint::LintCompletion; | ||
20 | 19 | ||
21 | pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { | 20 | pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { |
22 | let attribute = ctx.attribute_under_caret.as_ref()?; | 21 | let attribute = ctx.attribute_under_caret.as_ref()?; |
@@ -25,7 +24,7 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) | |||
25 | "derive" => derive::complete_derive(acc, ctx, token_tree), | 24 | "derive" => derive::complete_derive(acc, ctx, token_tree), |
26 | "feature" => lint::complete_lint(acc, ctx, token_tree, FEATURES), | 25 | "feature" => lint::complete_lint(acc, ctx, token_tree, FEATURES), |
27 | "allow" | "warn" | "deny" | "forbid" => { | 26 | "allow" | "warn" | "deny" | "forbid" => { |
28 | lint::complete_lint(acc, ctx, token_tree.clone(), lint::DEFAULT_LINT_COMPLETIONS); | 27 | lint::complete_lint(acc, ctx, token_tree.clone(), DEFAULT_LINTS); |
29 | lint::complete_lint(acc, ctx, token_tree, CLIPPY_LINTS); | 28 | lint::complete_lint(acc, ctx, token_tree, CLIPPY_LINTS); |
30 | } | 29 | } |
31 | _ => (), | 30 | _ => (), |