aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/highlight.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/syntax_highlighting/highlight.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 84012227d..7a53268e8 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -449,12 +449,12 @@ fn highlight_method_call(
449 krate: Option<hir::Crate>, 449 krate: Option<hir::Crate>,
450 method_call: &ast::MethodCallExpr, 450 method_call: &ast::MethodCallExpr,
451) -> Option<Highlight> { 451) -> Option<Highlight> {
452 let func = sema.resolve_method_call(&method_call)?; 452 let func = sema.resolve_method_call(method_call)?;
453 453
454 let mut h = SymbolKind::Function.into(); 454 let mut h = SymbolKind::Function.into();
455 h |= HlMod::Associated; 455 h |= HlMod::Associated;
456 456
457 if func.is_unsafe(sema.db) || sema.is_unsafe_method_call(&method_call) { 457 if func.is_unsafe(sema.db) || sema.is_unsafe_method_call(method_call) {
458 h |= HlMod::Unsafe; 458 h |= HlMod::Unsafe;
459 } 459 }
460 if func.is_async(sema.db) { 460 if func.is_async(sema.db) {
@@ -526,11 +526,9 @@ fn highlight_name_ref_by_syntax(
526 }; 526 };
527 527
528 match parent.kind() { 528 match parent.kind() {
529 METHOD_CALL_EXPR => { 529 METHOD_CALL_EXPR => ast::MethodCallExpr::cast(parent)
530 return ast::MethodCallExpr::cast(parent) 530 .and_then(|it| highlight_method_call(sema, krate, &it))
531 .and_then(|it| highlight_method_call(sema, krate, &it)) 531 .unwrap_or_else(|| SymbolKind::Function.into()),
532 .unwrap_or_else(|| SymbolKind::Function.into());
533 }
534 FIELD_EXPR => { 532 FIELD_EXPR => {
535 let h = HlTag::Symbol(SymbolKind::Field); 533 let h = HlTag::Symbol(SymbolKind::Field);
536 let is_union = ast::FieldExpr::cast(parent) 534 let is_union = ast::FieldExpr::cast(parent)