From 284e89406906b97eec8e0f91bce2955a5e94b880 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 22 Dec 2018 01:34:22 +0300 Subject: cleanup --- crates/ra_analysis/src/completion/complete_keyword.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crates/ra_analysis/src/completion/complete_keyword.rs') diff --git a/crates/ra_analysis/src/completion/complete_keyword.rs b/crates/ra_analysis/src/completion/complete_keyword.rs index 1e6d7008d..2c7891920 100644 --- a/crates/ra_analysis/src/completion/complete_keyword.rs +++ b/crates/ra_analysis/src/completion/complete_keyword.rs @@ -5,7 +5,13 @@ use ra_syntax::{ SyntaxKind::*, SyntaxNodeRef, }; -use crate::completion::{CompletionContext, CompletionItem, Completions, CompletionKind::*}; +use crate::completion::{CompletionContext, CompletionItem, Completions, CompletionKind}; + +fn keyword(kw: &str, snippet: &str) -> CompletionItem { + CompletionItem::new(CompletionKind::Keyword, kw) + .snippet(snippet) + .build() +} pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionContext) { if !ctx.is_trivial_path { @@ -60,10 +66,6 @@ fn complete_return(fn_def: ast::FnDef, is_stmt: bool) -> Option Some(keyword("return", snip)) } -fn keyword(kw: &str, snippet: &str) -> CompletionItem { - CompletionItem::new(Keyword, kw).snippet(snippet).build() -} - #[cfg(test)] mod tests { use crate::completion::{CompletionKind, check_completion}; -- cgit v1.2.3