aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/complete_attribute.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion/complete_attribute.rs')
-rw-r--r--crates/ra_ide/src/completion/complete_attribute.rs10
1 files changed, 4 insertions, 6 deletions
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::{
13 13
14pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { 14pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> {
15 let attribute = ctx.attribute_under_caret.as_ref()?; 15 let attribute = ctx.attribute_under_caret.as_ref()?;
16 match (attribute.path(), attribute.input()) { 16 match (attribute.path(), attribute.token_tree()) {
17 (Some(path), Some(ast::AttrInput::TokenTree(token_tree))) 17 (Some(path), Some(token_tree)) if path.to_string() == "derive" => {
18 if path.to_string() == "derive" =>
19 {
20 complete_derive(acc, ctx, token_tree) 18 complete_derive(acc, ctx, token_tree)
21 } 19 }
22 (Some(path), Some(ast::AttrInput::TokenTree(token_tree))) 20 (Some(path), Some(token_tree))
23 if ["allow", "warn", "deny", "forbid"] 21 if ["allow", "warn", "deny", "forbid"]
24 .iter() 22 .iter()
25 .any(|lint_level| lint_level == &path.to_string()) => 23 .any(|lint_level| lint_level == &path.to_string()) =>
26 { 24 {
27 complete_lint(acc, ctx, token_tree) 25 complete_lint(acc, ctx, token_tree)
28 } 26 }
29 (_, Some(ast::AttrInput::TokenTree(_token_tree))) => {} 27 (_, Some(_token_tree)) => {}
30 _ => complete_attribute_start(acc, ctx, attribute), 28 _ => complete_attribute_start(acc, ctx, attribute),
31 } 29 }
32 Some(()) 30 Some(())