aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-30 19:16:04 +0100
committerAleksey Kladov <[email protected]>2020-07-30 19:21:32 +0100
commitfcce07d2d1b07cf4578af65b00a243e743a67f05 (patch)
treea6a9437d26f62040d62921eca2f7aafb5d1233f3 /crates/ra_ide/src/completion
parente28ea81b2b68a61b5c5eec3c815172b17256a25f (diff)
Finalize attribute grammar
Diffstat (limited to 'crates/ra_ide/src/completion')
-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(())