From 863b1fb731e797f02daeac87a94d40a34222a062 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Aug 2020 19:12:38 +0200 Subject: :arrow_up: ungrammar --- crates/ide/src/completion/completion_context.rs | 2 +- crates/ide/src/syntax_highlighting.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/completion/completion_context.rs b/crates/ide/src/completion/completion_context.rs index 85456a66f..5adac7ebc 100644 --- a/crates/ide/src/completion/completion_context.rs +++ b/crates/ide/src/completion/completion_context.rs @@ -457,7 +457,7 @@ impl<'a> CompletionContext<'a> { if let Some(method_call_expr) = ast::MethodCallExpr::cast(parent) { // As above self.dot_receiver = method_call_expr - .expr() + .receiver() .map(|e| e.syntax().text_range()) .and_then(|r| find_node_with_range(original_file, r)); self.is_call = true; diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index dd8cfe42d..aefc86949 100644 --- a/crates/ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs @@ -724,7 +724,8 @@ fn highlight_method_call( hir::Access::Shared => (), hir::Access::Exclusive => h |= HighlightModifier::Mutable, hir::Access::Owned => { - if let Some(receiver_ty) = method_call.expr().and_then(|it| sema.type_of_expr(&it)) + if let Some(receiver_ty) = + method_call.receiver().and_then(|it| sema.type_of_expr(&it)) { if !receiver_ty.is_copy(sema.db) { h |= HighlightModifier::Consuming -- cgit v1.2.3