@@ -9,8 +9,7 @@ use lsp_types::{
9
9
TextDocumentIdentifier , TextEdit , WorkspaceEdit ,
10
10
} ;
11
11
use ra_ide_api:: {
12
- AssistId , Cancelable , FileId , FilePosition , FileRange , FoldKind , Query , RangeInfo ,
13
- RunnableKind , Severity ,
12
+ AssistId , Cancelable , FileId , FilePosition , FileRange , FoldKind , Query , RunnableKind , Severity ,
14
13
} ;
15
14
use ra_prof:: profile;
16
15
use ra_syntax:: { AstNode , SyntaxKind , TextRange , TextUnit } ;
@@ -267,13 +266,8 @@ pub fn handle_goto_definition(
267
266
None => return Ok ( None ) ,
268
267
Some ( it) => it,
269
268
} ;
270
- let nav_range = nav_info. range ;
271
- let res = nav_info
272
- . info
273
- . into_iter ( )
274
- . map ( |nav| ( position. file_id , RangeInfo :: new ( nav_range, nav) ) )
275
- . try_conv_with_to_vec ( & world) ?;
276
- Ok ( Some ( res. into ( ) ) )
269
+ let res = ( position. file_id , nav_info) . try_conv_with ( & world) ?;
270
+ Ok ( Some ( res) )
277
271
}
278
272
279
273
pub fn handle_goto_implementation (
@@ -285,13 +279,8 @@ pub fn handle_goto_implementation(
285
279
None => return Ok ( None ) ,
286
280
Some ( it) => it,
287
281
} ;
288
- let nav_range = nav_info. range ;
289
- let res = nav_info
290
- . info
291
- . into_iter ( )
292
- . map ( |nav| ( position. file_id , RangeInfo :: new ( nav_range, nav) ) )
293
- . try_conv_with_to_vec ( & world) ?;
294
- Ok ( Some ( res. into ( ) ) )
282
+ let res = ( position. file_id , nav_info) . try_conv_with ( & world) ?;
283
+ Ok ( Some ( res) )
295
284
}
296
285
297
286
pub fn handle_goto_type_definition (
@@ -303,13 +292,8 @@ pub fn handle_goto_type_definition(
303
292
None => return Ok ( None ) ,
304
293
Some ( it) => it,
305
294
} ;
306
- let nav_range = nav_info. range ;
307
- let res = nav_info
308
- . info
309
- . into_iter ( )
310
- . map ( |nav| ( position. file_id , RangeInfo :: new ( nav_range, nav) ) )
311
- . try_conv_with_to_vec ( & world) ?;
312
- Ok ( Some ( res. into ( ) ) )
295
+ let res = ( position. file_id , nav_info) . try_conv_with ( & world) ?;
296
+ Ok ( Some ( res) )
313
297
}
314
298
315
299
pub fn handle_parent_module (
0 commit comments