From fcce07d2d1b07cf4578af65b00a243e743a67f05 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 20:16:04 +0200 Subject: Finalize attribute grammar --- crates/ra_ide/src/completion/complete_attribute.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide/src/completion/complete_attribute.rs') diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ra_ide/src/completion/complete_attribute.rs index 109c5e9a8..2faaae974 100644 --- a/crates/ra_ide/src/completion/complete_attribute.rs +++ b/crates/ra_ide/src/completion/complete_attribute.rs @@ -13,20 +13,18 @@ use crate::completion::{ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { let attribute = ctx.attribute_under_caret.as_ref()?; - match (attribute.path(), attribute.input()) { - (Some(path), Some(ast::AttrInput::TokenTree(token_tree))) - if path.to_string() == "derive" => - { + match (attribute.path(), attribute.token_tree()) { + (Some(path), Some(token_tree)) if path.to_string() == "derive" => { complete_derive(acc, ctx, token_tree) } - (Some(path), Some(ast::AttrInput::TokenTree(token_tree))) + (Some(path), Some(token_tree)) if ["allow", "warn", "deny", "forbid"] .iter() .any(|lint_level| lint_level == &path.to_string()) => { complete_lint(acc, ctx, token_tree) } - (_, Some(ast::AttrInput::TokenTree(_token_tree))) => {} + (_, Some(_token_tree)) => {} _ => complete_attribute_start(acc, ctx, attribute), } Some(()) -- cgit v1.2.3