From e618d129030b10ddd55d76c3e451799c7dba3f8d Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 10 Jan 2021 16:40:52 +0100 Subject: Replace SyntaxKind usage with T! macro where applicable --- crates/completion/src/completions/trait_impl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/completion/src/completions/trait_impl.rs') diff --git a/crates/completion/src/completions/trait_impl.rs b/crates/completion/src/completions/trait_impl.rs index aa9c845da..135ae49dc 100644 --- a/crates/completion/src/completions/trait_impl.rs +++ b/crates/completion/src/completions/trait_impl.rs @@ -93,11 +93,11 @@ fn completion_match(ctx: &CompletionContext) -> Option<(ImplCompletionKind, Synt // `impl .. { const $0 }` // ERROR 0 // CONST_KW <- * - SyntaxKind::CONST_KW => 0, + T![const] => 0, // `impl .. { fn/type $0 }` // FN/TYPE_ALIAS 0 // FN_KW <- * - SyntaxKind::FN_KW | SyntaxKind::TYPE_KW => 0, + T![fn] | T![type] => 0, // `impl .. { fn/type/const foo$0 }` // FN/TYPE_ALIAS/CONST 1 // NAME 0 @@ -121,7 +121,7 @@ fn completion_match(ctx: &CompletionContext) -> Option<(ImplCompletionKind, Synt let impl_def = ast::Impl::cast(impl_item.parent()?.parent()?)?; let kind = match impl_item.kind() { // `impl ... { const $0 fn/type/const }` - _ if token.kind() == SyntaxKind::CONST_KW => ImplCompletionKind::Const, + _ if token.kind() == T![const] => ImplCompletionKind::Const, SyntaxKind::CONST | SyntaxKind::ERROR => ImplCompletionKind::Const, SyntaxKind::TYPE_ALIAS => ImplCompletionKind::TypeAlias, SyntaxKind::FN => ImplCompletionKind::Fn, -- cgit v1.2.3