Skip to content

Commit

Permalink
don't complete top level attrs inside nested attrs and add better lab…
Browse files Browse the repository at this point in the history
…els #4899

Signed-off-by: Benjamin Coenen <[email protected]>
  • Loading branch information
bnjjj committed Jun 22, 2020
1 parent 3df879f commit 5aad6c9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/ra_ide/src/completion/complete_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ pub(super) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
{
complete_derive(acc, ctx, token_tree)
}
(_, Some(ast::AttrInput::TokenTree(token_tree))) => {
let token_tree_str = token_tree.to_string();
let nested = token_tree_str.starts_with('(') && token_tree_str.ends_with(')');

if !nested {
complete_attribute_start(acc, ctx, attribute);
}
}
(_, Some(ast::AttrInput::TokenTree(_token_tree))) => {}
_ => complete_attribute_start(acc, ctx, attribute),
}
Some(())
Expand Down

0 comments on commit 5aad6c9

Please sign in to comment.