diff options
author | Paul Daniel Faria <[email protected]> | 2020-06-28 21:04:00 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-08-10 13:44:54 +0100 |
commit | c5cc24cb312c70159e63315ea49769b575e8cb65 (patch) | |
tree | fc2f5fe712e5776e0356c8e4f09135692a5ccc20 /crates/ra_ide/src/syntax_highlighting.rs | |
parent | aca3d6c57ec2c668cdb51eca34d6f7bc8fa7412b (diff) |
Revert function structs back to using bool to track self param, use first param for self information in syntax highlighting instead
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide/src/syntax_highlighting.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs index 02b16b13c..d5a5f69cc 100644 --- a/crates/ra_ide/src/syntax_highlighting.rs +++ b/crates/ra_ide/src/syntax_highlighting.rs | |||
@@ -4,7 +4,7 @@ mod injection; | |||
4 | #[cfg(test)] | 4 | #[cfg(test)] |
5 | mod tests; | 5 | mod tests; |
6 | 6 | ||
7 | use hir::{Name, Semantics, VariantDef}; | 7 | use hir::{Name, Semantics, TypeRef, VariantDef}; |
8 | use ra_ide_db::{ | 8 | use ra_ide_db::{ |
9 | defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass}, | 9 | defs::{classify_name, classify_name_ref, Definition, NameClass, NameRefClass}, |
10 | RootDatabase, | 10 | RootDatabase, |
@@ -756,8 +756,13 @@ fn is_method_call_unsafe( | |||
756 | } | 756 | } |
757 | 757 | ||
758 | let func = sema.resolve_method_call(&method_call_expr)?; | 758 | let func = sema.resolve_method_call(&method_call_expr)?; |
759 | if func.self_param(sema.db)?.is_ref { | 759 | if func.has_self_param(sema.db) { |
760 | Some(()) | 760 | let params = func.params(sema.db); |
761 | if matches!(params.into_iter().next(), Some(TypeRef::Reference(..))) { | ||
762 | Some(()) | ||
763 | } else { | ||
764 | None | ||
765 | } | ||
761 | } else { | 766 | } else { |
762 | None | 767 | None |
763 | } | 768 | } |