From 343df88ac7579316a5500fa7f4a07602809af669 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 4 Jun 2021 18:35:19 +0200 Subject: Generate default lint completions --- crates/ide_completion/src/completions/attribute.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/ide_completion/src/completions/attribute.rs') 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 @@ //! This module uses a bit of static metadata to provide completions //! for built-in attributes. +use ide_db::helpers::generated_lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES}; use once_cell::sync::Lazy; use rustc_hash::{FxHashMap, FxHashSet}; use syntax::{algo::non_trivia_sibling, ast, AstNode, Direction, NodeOrToken, SyntaxKind, T}; use crate::{ context::CompletionContext, - generated_lint_completions::{CLIPPY_LINTS, FEATURES}, item::{CompletionItem, CompletionItemKind, CompletionKind}, Completions, }; mod derive; mod lint; -pub(crate) use self::lint::LintCompletion; pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { let attribute = ctx.attribute_under_caret.as_ref()?; @@ -25,7 +24,7 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) "derive" => derive::complete_derive(acc, ctx, token_tree), "feature" => lint::complete_lint(acc, ctx, token_tree, FEATURES), "allow" | "warn" | "deny" | "forbid" => { - lint::complete_lint(acc, ctx, token_tree.clone(), lint::DEFAULT_LINT_COMPLETIONS); + lint::complete_lint(acc, ctx, token_tree.clone(), DEFAULT_LINTS); lint::complete_lint(acc, ctx, token_tree, CLIPPY_LINTS); } _ => (), -- cgit v1.2.3