@@ -15,10 +15,10 @@ use syntax::{
1515 ast:: { self , HasLoopBody } ,
1616 match_ast, AstNode ,
1717 SyntaxKind :: { self , IDENT , INT_NUMBER } ,
18- SyntaxNode , SyntaxToken , TextRange , T ,
18+ SyntaxToken , TextRange , T ,
1919} ;
2020
21- use crate :: { navigation_target:: ToNav , references , NavigationTarget , TryToNav } ;
21+ use crate :: { navigation_target:: ToNav , NavigationTarget , TryToNav } ;
2222
2323#[ derive( PartialEq , Eq , Hash ) ]
2424pub struct HighlightedRange {
@@ -81,7 +81,7 @@ pub(crate) fn highlight_related(
8181 }
8282 T ! [ |] if config. closure_captures => highlight_closure_captures ( sema, token, file_id) ,
8383 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) ,
8585 _ => None ,
8686 }
8787}
@@ -129,7 +129,6 @@ fn highlight_closure_captures(
129129
130130fn highlight_references (
131131 sema : & Semantics < ' _ , RootDatabase > ,
132- node : & SyntaxNode ,
133132 token : SyntaxToken ,
134133 FilePosition { file_id, offset } : FilePosition ,
135134) -> Option < Vec < HighlightedRange > > {
@@ -239,7 +238,7 @@ fn highlight_references(
239238 continue ;
240239 }
241240 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 ) )
243242 . then_some ( ReferenceCategory :: Write ) ;
244243 HighlightedRange { range, category }
245244 } ) ;
0 commit comments