aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide/src/completion/complete_attribute.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ra_ide/src/completion/complete_attribute.rs
index 4eaaa0b6f..f17266221 100644
--- a/crates/ra_ide/src/completion/complete_attribute.rs
+++ b/crates/ra_ide/src/completion/complete_attribute.rs
@@ -3,10 +3,7 @@
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
6use ra_syntax::{ 6use ra_syntax::{ast, AstNode, SyntaxKind};
7 ast::{self, AttrInput, AttrKind},
8 AstNode, SyntaxKind,
9};
10use rustc_hash::FxHashSet; 7use rustc_hash::FxHashSet;
11 8
12use crate::completion::{ 9use crate::completion::{
@@ -18,7 +15,9 @@ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
18 let attribute = ctx.attribute_under_caret.as_ref()?; 15 let attribute = ctx.attribute_under_caret.as_ref()?;
19 16
20 match (attribute.path(), attribute.input()) { 17 match (attribute.path(), attribute.input()) {
21 (Some(path), Some(AttrInput::TokenTree(token_tree))) if path.to_string() == "derive" => { 18 (Some(path), Some(ast::AttrInput::TokenTree(token_tree)))
19 if path.to_string() == "derive" =>
20 {
22 complete_derive(acc, ctx, token_tree) 21 complete_derive(acc, ctx, token_tree)
23 } 22 }
24 _ => complete_attribute_start(acc, ctx, attribute), 23 _ => complete_attribute_start(acc, ctx, attribute),
@@ -42,7 +41,7 @@ fn complete_attribute_start(acc: &mut Completions, ctx: &CompletionContext, attr
42 _ => {} 41 _ => {}
43 } 42 }
44 43
45 if attribute.kind() == AttrKind::Inner || !attr_completion.should_be_inner { 44 if attribute.kind() == ast::AttrKind::Inner || !attr_completion.should_be_inner {
46 acc.add(item); 45 acc.add(item);
47 } 46 }
48 } 47 }