@@ -77,28 +77,29 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
77
77
}
78
78
}
79
79
80
- fn has_completion_relevance ( hasher : & mut TentHasher , relevance : & CompletionRelevance ) {
80
+ fn hash_completion_relevance ( hasher : & mut TentHasher , relevance : & CompletionRelevance ) {
81
81
use ide_completion:: {
82
82
CompletionRelevancePostfixMatch , CompletionRelevanceReturnType ,
83
83
CompletionRelevanceTypeMatch ,
84
84
} ;
85
85
86
+ hasher. update ( & [
87
+ u8:: from ( relevance. exact_name_match ) ,
88
+ u8:: from ( relevance. is_local ) ,
89
+ u8:: from ( relevance. is_name_already_imported ) ,
90
+ u8:: from ( relevance. requires_import ) ,
91
+ u8:: from ( relevance. is_private_editable ) ,
92
+ ] ) ;
86
93
if let Some ( type_match) = & relevance. type_match {
87
94
let label = match type_match {
88
95
CompletionRelevanceTypeMatch :: CouldUnify => "could_unify" ,
89
96
CompletionRelevanceTypeMatch :: Exact => "exact" ,
90
97
} ;
91
98
hasher. update ( label) ;
92
99
}
93
- hasher. update ( & [ u8:: from ( relevance. exact_name_match ) , u8:: from ( relevance. is_local ) ] ) ;
94
100
if let Some ( trait_) = & relevance. trait_ {
95
101
hasher. update ( & [ u8:: from ( trait_. is_op_method ) , u8:: from ( trait_. notable_trait ) ] ) ;
96
102
}
97
- hasher. update ( & [
98
- u8:: from ( relevance. is_name_already_imported ) ,
99
- u8:: from ( relevance. requires_import ) ,
100
- u8:: from ( relevance. is_private_editable ) ,
101
- ] ) ;
102
103
if let Some ( postfix_match) = & relevance. postfix_match {
103
104
let label = match postfix_match {
104
105
CompletionRelevancePostfixMatch :: NonExact => "non_exact" ,
@@ -139,7 +140,7 @@ fn completion_item_hash(item: &CompletionItem, is_ref_completion: bool) -> [u8;
139
140
if let Some ( documentation) = & item. documentation {
140
141
hasher. update ( documentation. as_str ( ) ) ;
141
142
}
142
- has_completion_relevance ( & mut hasher, & item. relevance ) ;
143
+ hash_completion_relevance ( & mut hasher, & item. relevance ) ;
143
144
if let Some ( ( mutability, text_size) ) = & item. ref_match {
144
145
hasher. update ( mutability. as_keyword_for_ref ( ) ) ;
145
146
hasher. update ( u32:: from ( * text_size) . to_le_bytes ( ) ) ;
0 commit comments