File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -376,16 +376,20 @@ impl ToNav for hir::Local {
376376impl ToNav for hir:: TypeParam {
377377 fn to_nav ( & self , db : & RootDatabase ) -> NavigationTarget {
378378 let src = self . source ( db) ;
379- let range = match src. value {
379+ let full_range = match & src. value {
380380 Either :: Left ( it) => it. syntax ( ) . text_range ( ) ,
381381 Either :: Right ( it) => it. syntax ( ) . text_range ( ) ,
382382 } ;
383+ let focus_range = match & src. value {
384+ Either :: Left ( _) => None ,
385+ Either :: Right ( it) => it. name ( ) . map ( |it| it. syntax ( ) . text_range ( ) ) ,
386+ } ;
383387 NavigationTarget {
384388 file_id : src. file_id . original_file ( db) ,
385389 name : self . name ( db) . to_string ( ) . into ( ) ,
386390 kind : TYPE_PARAM ,
387- full_range : range ,
388- focus_range : None ,
391+ full_range,
392+ focus_range,
389393 container_name : None ,
390394 description : None ,
391395 docs : None ,
Original file line number Diff line number Diff line change @@ -754,14 +754,14 @@ mod tests {
754754 #[ test]
755755 fn goto_for_type_param ( ) {
756756 check_goto (
757- "
757+ r# "
758758 //- /lib.rs
759- struct Foo<T> {
759+ struct Foo<T: Clone > {
760760 t: <|>T,
761761 }
762- " ,
763- "T TYPE_PARAM FileId(1) 11..12" ,
764- "T" ,
762+ "# ,
763+ "T TYPE_PARAM FileId(1) 11..19 11.. 12" ,
764+ "T: Clone|T " ,
765765 ) ;
766766 }
767767
You can’t perform that action at this time.
0 commit comments