@@ -15,10 +15,10 @@ use syntax::{
15
15
ast:: { self , HasLoopBody } ,
16
16
match_ast, AstNode ,
17
17
SyntaxKind :: { self , IDENT , INT_NUMBER } ,
18
- SyntaxNode , SyntaxToken , TextRange , T ,
18
+ SyntaxToken , TextRange , T ,
19
19
} ;
20
20
21
- use crate :: { navigation_target:: ToNav , references , NavigationTarget , TryToNav } ;
21
+ use crate :: { navigation_target:: ToNav , NavigationTarget , TryToNav } ;
22
22
23
23
#[ derive( PartialEq , Eq , Hash ) ]
24
24
pub struct HighlightedRange {
@@ -81,7 +81,7 @@ pub(crate) fn highlight_related(
81
81
}
82
82
T ! [ |] if config. closure_captures => highlight_closure_captures ( sema, token, file_id) ,
83
83
T ! [ move] if config. closure_captures => highlight_closure_captures ( sema, token, file_id) ,
84
- _ if config. references => highlight_references ( sema, & syntax , token, pos) ,
84
+ _ if config. references => highlight_references ( sema, token, pos) ,
85
85
_ => None ,
86
86
}
87
87
}
@@ -129,7 +129,6 @@ fn highlight_closure_captures(
129
129
130
130
fn highlight_references (
131
131
sema : & Semantics < ' _ , RootDatabase > ,
132
- node : & SyntaxNode ,
133
132
token : SyntaxToken ,
134
133
FilePosition { file_id, offset } : FilePosition ,
135
134
) -> Option < Vec < HighlightedRange > > {
@@ -239,7 +238,7 @@ fn highlight_references(
239
238
continue ;
240
239
}
241
240
let hl_range = nav. focus_range . map ( |range| {
242
- let category = references :: decl_mutability ( & def, node , range )
241
+ let category = matches ! ( def, Definition :: Local ( l ) if l . is_mut ( sema . db ) )
243
242
. then_some ( ReferenceCategory :: Write ) ;
244
243
HighlightedRange { range, category }
245
244
} ) ;
0 commit comments