@@ -1358,17 +1358,18 @@ pub(crate) fn code_lens(
13581358 } )
13591359 }
13601360 }
1361- AnnotationKind :: HasImpls { pos : file_range , data } => {
1361+ AnnotationKind :: HasImpls { pos, data } => {
13621362 if !client_commands_config. show_reference {
13631363 return Ok ( ( ) ) ;
13641364 }
1365- let line_index = snap. file_line_index ( file_range . file_id ) ?;
1365+ let line_index = snap. file_line_index ( pos . file_id ) ?;
13661366 let annotation_range = range ( & line_index, annotation. range ) ;
1367- let url = url ( snap, file_range. file_id ) ;
1367+ let url = url ( snap, pos. file_id ) ;
1368+ let pos = position ( & line_index, pos. offset ) ;
13681369
13691370 let id = lsp_types:: TextDocumentIdentifier { uri : url. clone ( ) } ;
13701371
1371- let doc_pos = lsp_types:: TextDocumentPositionParams :: new ( id, annotation_range . start ) ;
1372+ let doc_pos = lsp_types:: TextDocumentPositionParams :: new ( id, pos ) ;
13721373
13731374 let goto_params = lsp_types:: request:: GotoImplementationParams {
13741375 text_document_position_params : doc_pos,
@@ -1391,7 +1392,7 @@ pub(crate) fn code_lens(
13911392 command:: show_references (
13921393 implementation_title ( locations. len ( ) ) ,
13931394 & url,
1394- annotation_range . start ,
1395+ pos ,
13951396 locations,
13961397 )
13971398 } ) ;
@@ -1411,28 +1412,24 @@ pub(crate) fn code_lens(
14111412 } ) ( ) ,
14121413 } )
14131414 }
1414- AnnotationKind :: HasReferences { pos : file_range , data } => {
1415+ AnnotationKind :: HasReferences { pos, data } => {
14151416 if !client_commands_config. show_reference {
14161417 return Ok ( ( ) ) ;
14171418 }
1418- let line_index = snap. file_line_index ( file_range . file_id ) ?;
1419+ let line_index = snap. file_line_index ( pos . file_id ) ?;
14191420 let annotation_range = range ( & line_index, annotation. range ) ;
1420- let url = url ( snap, file_range. file_id ) ;
1421+ let url = url ( snap, pos. file_id ) ;
1422+ let pos = position ( & line_index, pos. offset ) ;
14211423
14221424 let id = lsp_types:: TextDocumentIdentifier { uri : url. clone ( ) } ;
14231425
1424- let doc_pos = lsp_types:: TextDocumentPositionParams :: new ( id, annotation_range . start ) ;
1426+ let doc_pos = lsp_types:: TextDocumentPositionParams :: new ( id, pos ) ;
14251427
14261428 let command = data. map ( |ranges| {
14271429 let locations: Vec < lsp_types:: Location > =
14281430 ranges. into_iter ( ) . filter_map ( |range| location ( snap, range) . ok ( ) ) . collect ( ) ;
14291431
1430- command:: show_references (
1431- reference_title ( locations. len ( ) ) ,
1432- & url,
1433- annotation_range. start ,
1434- locations,
1435- )
1432+ command:: show_references ( reference_title ( locations. len ( ) ) , & url, pos, locations)
14361433 } ) ;
14371434
14381435 acc. push ( lsp_types:: CodeLens {
0 commit comments