diff options
author | Benjamin Coenen <[email protected]> | 2020-06-22 12:39:05 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-06-22 12:39:05 +0100 |
commit | 5aad6c9fa69915c4810a8e93d793d76de211f2ca (patch) | |
tree | aca84f1709aa759baf8ab9a35f11ead1b7241011 /crates | |
parent | 3df879f139b0a40f400c23cb495eaf776b325047 (diff) |
don't complete top level attrs inside nested attrs and add better labels #4899
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide/src/completion/complete_attribute.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/ra_ide/src/completion/complete_attribute.rs b/crates/ra_ide/src/completion/complete_attribute.rs index 443b3b87d..ade17a1ff 100644 --- a/crates/ra_ide/src/completion/complete_attribute.rs +++ b/crates/ra_ide/src/completion/complete_attribute.rs | |||
@@ -20,14 +20,7 @@ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext) | |||
20 | { | 20 | { |
21 | complete_derive(acc, ctx, token_tree) | 21 | complete_derive(acc, ctx, token_tree) |
22 | } | 22 | } |
23 | (_, Some(ast::AttrInput::TokenTree(token_tree))) => { | 23 | (_, Some(ast::AttrInput::TokenTree(_token_tree))) => {} |
24 | let token_tree_str = token_tree.to_string(); | ||
25 | let nested = token_tree_str.starts_with('(') && token_tree_str.ends_with(')'); | ||
26 | |||
27 | if !nested { | ||
28 | complete_attribute_start(acc, ctx, attribute); | ||
29 | } | ||
30 | } | ||
31 | _ => complete_attribute_start(acc, ctx, attribute), | 24 | _ => complete_attribute_start(acc, ctx, attribute), |
32 | } | 25 | } |
33 | Some(()) | 26 | Some(()) |