diff options
Diffstat (limited to 'crates/completion/src/completions/attribute.rs')
-rw-r--r-- | crates/completion/src/completions/attribute.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/completion/src/completions/attribute.rs b/crates/completion/src/completions/attribute.rs index a52ca107e..e5522980d 100644 --- a/crates/completion/src/completions/attribute.rs +++ b/crates/completion/src/completions/attribute.rs | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | use itertools::Itertools; | 6 | use itertools::Itertools; |
7 | use rustc_hash::FxHashSet; | 7 | use rustc_hash::FxHashSet; |
8 | use syntax::{ast, AstNode, SyntaxKind}; | 8 | use syntax::{ast, AstNode, T}; |
9 | 9 | ||
10 | use crate::{ | 10 | use crate::{ |
11 | context::CompletionContext, | 11 | context::CompletionContext, |
@@ -205,8 +205,7 @@ fn complete_lint( | |||
205 | fn parse_comma_sep_input(derive_input: ast::TokenTree) -> Result<FxHashSet<String>, ()> { | 205 | fn parse_comma_sep_input(derive_input: ast::TokenTree) -> Result<FxHashSet<String>, ()> { |
206 | match (derive_input.left_delimiter_token(), derive_input.right_delimiter_token()) { | 206 | match (derive_input.left_delimiter_token(), derive_input.right_delimiter_token()) { |
207 | (Some(left_paren), Some(right_paren)) | 207 | (Some(left_paren), Some(right_paren)) |
208 | if left_paren.kind() == SyntaxKind::L_PAREN | 208 | if left_paren.kind() == T!['('] && right_paren.kind() == T![')'] => |
209 | && right_paren.kind() == SyntaxKind::R_PAREN => | ||
210 | { | 209 | { |
211 | let mut input_derives = FxHashSet::default(); | 210 | let mut input_derives = FxHashSet::default(); |
212 | let mut current_derive = String::new(); | 211 | let mut current_derive = String::new(); |
@@ -218,7 +217,7 @@ fn parse_comma_sep_input(derive_input: ast::TokenTree) -> Result<FxHashSet<Strin | |||
218 | .skip(1) | 217 | .skip(1) |
219 | .take_while(|token| token != &right_paren) | 218 | .take_while(|token| token != &right_paren) |
220 | { | 219 | { |
221 | if SyntaxKind::COMMA == token.kind() { | 220 | if T![,] == token.kind() { |
222 | if !current_derive.is_empty() { | 221 | if !current_derive.is_empty() { |
223 | input_derives.insert(current_derive); | 222 | input_derives.insert(current_derive); |
224 | current_derive = String::new(); | 223 | current_derive = String::new(); |