From 3ffd5dd2a63e8efe182e79439a879ec1f9420b77 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 11:47:28 +0300 Subject: migrate ra_analysis to new rowan --- crates/ra_analysis/src/completion/complete_keyword.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 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 28194c908..d350f06ce 100644 --- a/crates/ra_analysis/src/completion/complete_keyword.rs +++ b/crates/ra_analysis/src/completion/complete_keyword.rs @@ -2,7 +2,7 @@ use ra_syntax::{ algo::visit::{visitor, Visitor}, AstNode, ast::{self, LoopBodyOwner}, - SyntaxKind::*, SyntaxNodeRef, + SyntaxKind::*, SyntaxNode, }; use crate::completion::{CompletionContext, CompletionItem, Completions, CompletionKind, CompletionItemKind}; @@ -76,7 +76,7 @@ pub(super) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte acc.add_all(complete_return(fn_def, ctx.can_be_stmt)); } -fn is_in_loop_body(leaf: SyntaxNodeRef) -> bool { +fn is_in_loop_body(leaf: &SyntaxNode) -> bool { for node in leaf.ancestors() { if node.kind() == FN_DEF || node.kind() == LAMBDA_EXPR { break; @@ -95,7 +95,7 @@ fn is_in_loop_body(leaf: SyntaxNodeRef) -> bool { false } -fn complete_return(fn_def: ast::FnDef, can_be_stmt: bool) -> Option { +fn complete_return(fn_def: &ast::FnDef, can_be_stmt: bool) -> Option { let snip = match (can_be_stmt, fn_def.ret_type().is_some()) { (true, true) => "return $0;", (true, false) => "return;", -- cgit v1.2.3